From bdf9579503f75a52048cecbc07fed7f7b844b372 Mon Sep 17 00:00:00 2001 From: dev02 Date: Fri, 22 Dec 2023 09:45:15 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=BE=8C=E7=AB=AF]=20=E4=BF=AE=E6=94=B9device?= =?UTF-8?q?=5Fdisaster=E6=B5=81=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Implement/NiagaraDataSynchronizeRepository.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Repository/BackendRepository/Implement/NiagaraDataSynchronizeRepository.cs b/Repository/BackendRepository/Implement/NiagaraDataSynchronizeRepository.cs index 23d36b6..0c2f2c8 100644 --- a/Repository/BackendRepository/Implement/NiagaraDataSynchronizeRepository.cs +++ b/Repository/BackendRepository/Implement/NiagaraDataSynchronizeRepository.cs @@ -1461,11 +1461,13 @@ namespace Repository.BackendRepository.Implement var check = (await conn.QueryAsync($"select device_guid from device_disaster where device_guid = '{device_guid}' and device_system_value = '{d.disasterValue}'")).FirstOrDefault(); if (string.IsNullOrEmpty(check)) { - sb.Append($@" - insert into device_disaster + sb.Append($@"insert into device_disaster (device_guid, device_system_value, device_building_tag, device_system_tag, device_name_tag, device_floor_tag, device_serial_tag, device_number) values ('{device_guid}', '{d.disasterValue}', '{device_number.Split('_')[0]}', '{device_system_tag}', '{device_name_tag}', '{device_number.Split('_')[2]}', '{device_number.Split('_')[4]}', '{device_number}'); "); + + await conn.ExecuteAsync(sb.ToString()); + sb.Clear(); } }