From 31fe9e0edb29345afed3eb5fc55cba42bb833f66 Mon Sep 17 00:00:00 2001 From: dev02 Date: Tue, 28 Nov 2023 14:24:36 +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=E5=88=A4=E6=96=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../NiagaraDataSynchronizeRepository.cs | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/Repository/BackendRepository/Implement/NiagaraDataSynchronizeRepository.cs b/Repository/BackendRepository/Implement/NiagaraDataSynchronizeRepository.cs index 198b170..665065e 100644 --- a/Repository/BackendRepository/Implement/NiagaraDataSynchronizeRepository.cs +++ b/Repository/BackendRepository/Implement/NiagaraDataSynchronizeRepository.cs @@ -169,30 +169,30 @@ namespace Repository.BackendRepository.Implement sb.Clear(); stopwatchSection.Stop(); await KeepTimeLog("Insert into import_niagara_tag", stopwatchSection.ElapsedMilliseconds); + } - //巨蛋特殊處理 - if (isDome) + //巨蛋特殊處理 + if (isDome) + { + stopwatchSection = new Stopwatch(); + stopwatchSection.Start(); + sb.Append($@" -- tag 第二碼為小類(除了安全系統之外) + update import_niagara_tag set device_name_tag = device_system_tag + where (device_system_tag <> 'S' and device_system_tag <> 'CWB' and device_system_tag <> 'B' and + (device_system_tag <> 'FM' or device_system_tag <> 'APS' or device_system_tag <> 'VICL')); + + update import_niagara_tag a + join variable b on a.device_name_tag COLLATE utf8mb4_general_ci = b.system_value and b.deleted = 0 and b.system_type = 'device_system_category_layer3' + join variable v1 on b.system_parent_id = v1.id + set device_system_tag = v1.system_value -- tag 第二碼為小類(除了安全系統之外) + where (device_system_tag <> 'S' and device_system_tag <> 'CWB' and device_system_tag <> 'B' and + (device_system_tag <> 'FM' or device_system_tag <> 'APS' or device_system_tag <> 'VICL')); -- 安全系統 第二段大類 第四段小類"); + using (TransactionScope scope = new TransactionScope(TransactionScopeAsyncFlowOption.Enabled)) { - stopwatchSection = new Stopwatch(); - stopwatchSection.Start(); - sb.Append($@" -- tag 第二碼為小類(除了安全系統之外) - update import_niagara_tag set device_name_tag = device_system_tag - where (device_system_tag <> 'S' and device_system_tag <> 'CWB' and device_system_tag <> 'B' and - (device_system_tag <> 'FM' or device_system_tag <> 'APS' or device_system_tag <> 'VICL')); - - update import_niagara_tag a - join variable b on a.device_name_tag COLLATE utf8mb4_general_ci = b.system_value and b.deleted = 0 and b.system_type = 'device_system_category_layer3' - join variable v1 on b.system_parent_id = v1.id - set device_system_tag = v1.system_value -- tag 第二碼為小類(除了安全系統之外) - where (device_system_tag <> 'S' and device_system_tag <> 'CWB' and device_system_tag <> 'B' and - (device_system_tag <> 'FM' or device_system_tag <> 'APS' or device_system_tag <> 'VICL')); -- 安全系統 第二段大類 第四段小類"); - using (TransactionScope scope = new TransactionScope(TransactionScopeAsyncFlowOption.Enabled)) - { - await conn.ExecuteAsync(sb.ToString()); - } - stopwatchSection.Stop(); - await KeepTimeLog("巨蛋特殊處理", stopwatchSection.ElapsedMilliseconds); + await conn.ExecuteAsync(sb.ToString()); } + stopwatchSection.Stop(); + await KeepTimeLog("巨蛋特殊處理", stopwatchSection.ElapsedMilliseconds); } stopwatch.Stop(); await KeepTimeLog("InsertNiagaraTagList", stopwatch.ElapsedMilliseconds);