diff --git a/Repository/BackendRepository/Implement/NiagaraDataSynchronizeRepository.cs b/Repository/BackendRepository/Implement/NiagaraDataSynchronizeRepository.cs index 665065e..23d36b6 100644 --- a/Repository/BackendRepository/Implement/NiagaraDataSynchronizeRepository.cs +++ b/Repository/BackendRepository/Implement/NiagaraDataSynchronizeRepository.cs @@ -1863,6 +1863,25 @@ SET FOREIGN_KEY_CHECKS = 1;"; await conn.ExecuteAsync(sb.ToString()); sb.Clear(); } + + var isDome = await conn.QueryFirstAsync("select system_value from variable where system_type = 'project_name'"); + //巨蛋特殊處理 + if (!string.IsNullOrEmpty(isDome) && isDome.Contains("ibms_dome")) + { + stopwatchSection = new Stopwatch(); + stopwatchSection.Start(); + sb.Clear(); + // tag 第二碼為小類(除了安全系統之外)安全系統 第二段大類 第四段小類 + sb.Append($@"update import_niagara_device_control_point a + join variable b on a.device_name_tag = b.system_value COLLATE utf8mb4_0900_ai_ci and b.deleted = 0 and b.system_type = 'device_system_category_layer3' + join variable v1 on b.system_parent_id = v1.id + set a.device_system_tag = v1.system_value + where a.device_system_tag not in ('S', 'CWB', 'B') and not (a.device_system_tag in ('FM', 'APS', 'VICL'));"); + await conn.ExecuteAsync(sb.ToString()); + stopwatchSection.Stop(); + await KeepTimeLog("巨蛋特殊處理", stopwatchSection.ElapsedMilliseconds); + } + stopwatchSection.Stop(); await KeepTimeLog("insert into import_niagara_device_control_point", stopwatchSection.ElapsedMilliseconds); }