From 2657e41a15b4c9b62039e75e38f415ca6ae27a06 Mon Sep 17 00:00:00 2001 From: wanli Date: Thu, 27 Oct 2022 13:18:43 +0800 Subject: [PATCH] =?UTF-8?q?App:=20device=5Fkind=20=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E8=B3=87=E6=96=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- z01_WinAPP/Service/procCompare.cs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/z01_WinAPP/Service/procCompare.cs b/z01_WinAPP/Service/procCompare.cs index 3d5045e..d61efd2 100644 --- a/z01_WinAPP/Service/procCompare.cs +++ b/z01_WinAPP/Service/procCompare.cs @@ -30,7 +30,7 @@ namespace tpDomeWinAPP.Service { bool result = false; //tag - InsertNiagaraTagList(dt, building); + insertNiagaraTagList(dt, building); insertItemFromNiagara(dt, building); deviceComparison(); deviceItemComparison(); @@ -39,7 +39,7 @@ namespace tpDomeWinAPP.Service return result; } - protected void InsertNiagaraTagList(List dt, string building) + protected void insertNiagaraTagList(List dt, string building) { var ds2 = dt.GroupBy(x => new { @@ -209,6 +209,7 @@ namespace tpDomeWinAPP.Service conn.Open(); StringBuilder sb = new StringBuilder(); + StringBuilder sb2 = new StringBuilder(); sb.Append($@" SELECT m.* FROM import_niagara_tag m LEFT JOIN device d @@ -237,11 +238,19 @@ namespace tpDomeWinAPP.Service data.device_serial_tag + "', '" + data.niagara_tags + "', '" + data.device_system_tag + "', now(), now() );"); + + sb2.Append($@"INSERT device_kind (device_kind_guid, device_building_tag, device_system_tag, device_name_tag, + device_normal_flashing, device_close_flashing, device_error_flashing, device_error_independent, + created_by, created_at) + VALUES (uuid(), '" + data.device_building_tag + "', '" + data.device_system_tag + "', '" + data.device_name_tag + + "', 0, 0, 1, 0, 'B43E3CA7-96DD-4FC7-B6E6-974ACC3B0878', now());"); } if(sb.Length > 0) { conn.Execute(sb.ToString()); + conn.Execute(sb2.ToString()); sb.Clear(); + sb2.Clear(); } }