From 6fd9f6f087195a0a580d49291ab2d1003e8fd310 Mon Sep 17 00:00:00 2001 From: dev02 Date: Thu, 7 Sep 2023 16:37:20 +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=95=8F=E9=A1=8C=20[=E5=89=8D=E7=AB=AF]=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=88=97=E8=A1=A8=E8=B3=87=E6=96=99=E9=A1=AF?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FrontendWebApi/ApiControllers/BuildController.cs | 3 ++- .../Implement/NiagaraDataSynchronizeRepository.cs | 8 +++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/FrontendWebApi/ApiControllers/BuildController.cs b/FrontendWebApi/ApiControllers/BuildController.cs index 76f78ef..56b30a8 100644 --- a/FrontendWebApi/ApiControllers/BuildController.cs +++ b/FrontendWebApi/ApiControllers/BuildController.cs @@ -180,7 +180,7 @@ namespace FrontendWebApi.ApiControllers v2.system_key subfull_name, v2.system_priority subpriority from building_menu me - left join building b on b.building_tag = me.building_tag and b.deleted = 0 + join building b on b.building_tag = me.building_tag and b.deleted = 0 left join variable v1 on me.main_system_tag = v1.system_value and v1.deleted = 0 and v1.system_type = 'device_system_category_layer2' left join variable v2 on me.sub_system_tag = v2.system_value and v2.deleted = 0 and v2.system_type = 'device_system_category_layer3' inner join ( @@ -196,6 +196,7 @@ namespace FrontendWebApi.ApiControllers left join auth_page ap on ra.AuthCode = ap.AuthCode where ap.AuthType = 1 ) shower on shower.building_tag = me.building_tag and shower.ShowView = v2.id + where me.is_link = 1 order by b.priority, v1.system_priority, v2.system_priority, v2.created_at DESC", new { Account = account }); var floorsql = await backendRepository.GetAllAsync(@" diff --git a/Repository/BackendRepository/Implement/NiagaraDataSynchronizeRepository.cs b/Repository/BackendRepository/Implement/NiagaraDataSynchronizeRepository.cs index 24942c8..da787f3 100644 --- a/Repository/BackendRepository/Implement/NiagaraDataSynchronizeRepository.cs +++ b/Repository/BackendRepository/Implement/NiagaraDataSynchronizeRepository.cs @@ -143,12 +143,14 @@ namespace Repository.BackendRepository.Implement { 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_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_system_tag <> 'FM' or device_system_tag <> 'APS' or device_system_tag <> 'VICL')); update import_niagara_tag a join dic_system b on a.device_name_tag COLLATE utf8mb4_general_ci = b.s2_code set device_system_tag = b.s1_code -- tag 第二碼為小類(除了安全系統之外) - 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')); -- 安全系統 第二段大類 第四段小類"); + 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')); -- 安全系統 第二段大類 第四段小類"); await conn.ExecuteAsync(sb.ToString()); } } @@ -663,7 +665,7 @@ namespace Repository.BackendRepository.Implement ) AS a ON b.building_tag COLLATE utf8mb4_0900_ai_ci = a.device_building_tag COLLATE utf8mb4_0900_ai_ci and a.device_system_tag COLLATE utf8mb4_0900_ai_ci = b.main_system_tag COLLATE utf8mb4_0900_ai_ci and a.device_name_tag COLLATE utf8mb4_0900_ai_ci = b.sub_system_tag COLLATE utf8mb4_0900_ai_ci SET b.is_link = 0 - WHERE b.building_tag IS NULL"); + WHERE a.device_building_tag IS NULL"); await conn.ExecuteAsync(sb.ToString()); } catch (Exception exception)