From 5921479a436976d1289358e418666ecdbbae4e99 Mon Sep 17 00:00:00 2001 From: dev02 Date: Thu, 30 Nov 2023 12:41:44 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=BE=8C=E7=AB=AF]=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=90=8C=E6=AD=A5=E8=A8=98=E9=8C=84=E6=89=80=E6=9C=89=E8=A8=AD?= =?UTF-8?q?=E5=82=99=E9=8C=AF=E8=AA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../NiagaraDataSynchronizeRepository.cs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) 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); }