[BE] 更新資料同步 巨蛋特殊處理 SQL 語法

This commit is contained in:
keke 2023-08-29 16:27:59 +08:00
parent 495c7b0293
commit b93423d714

View File

@ -143,12 +143,12 @@ namespace Repository.BackendRepository.Implement
{ {
sb.Append($@" -- tag 第二碼為小類(除了安全系統之外) sb.Append($@" -- tag 第二碼為小類(除了安全系統之外)
update import_niagara_tag set device_name_tag = device_system_tag update import_niagara_tag set device_name_tag = device_system_tag
where (device_system_tag <> 'S' and device_system_tag <> 'CWB' and (device_name_tag <> 'EL' or device_name_tag <> 'ES')); where (device_system_tag <> 'S' and device_system_tag <> 'CWB' and device_system_tag <> 'B' and (device_name_tag <> 'EL' or device_name_tag <> 'ES'));
update import_niagara_tag a join dic_system b update import_niagara_tag a join dic_system b
on a.device_name_tag COLLATE utf8mb4_general_ci = b.s2_code on a.device_name_tag COLLATE utf8mb4_general_ci = b.s2_code
set device_system_tag = b.s1_code -- tag () set device_system_tag = b.s1_code -- tag ()
where (device_system_tag <> 'S' and device_system_tag <> 'CWB' and (device_name_tag <> 'EL' or device_name_tag <> 'ES')); -- "); where (device_system_tag <> 'S' and device_system_tag <> 'CWB' and device_system_tag <> 'B' and (device_name_tag <> 'EL' or device_name_tag <> 'ES')); -- ");
await conn.ExecuteAsync(sb.ToString()); await conn.ExecuteAsync(sb.ToString());
} }
} }