From b4c150a1d476342ae47ed6b6342303a9ce1d0db4 Mon Sep 17 00:00:00 2001 From: dev02 Date: Fri, 30 Dec 2022 16:29:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9device=5Fitem=20is=5Fshow=5Fh?= =?UTF-8?q?istory?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FrontendWebApi/ApiControllers/HistoryController.cs | 2 +- .../Implement/NiagaraDataSynchronizeRepository.cs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/FrontendWebApi/ApiControllers/HistoryController.cs b/FrontendWebApi/ApiControllers/HistoryController.cs index dbc1bfa..cf8b7a6 100644 --- a/FrontendWebApi/ApiControllers/HistoryController.cs +++ b/FrontendWebApi/ApiControllers/HistoryController.cs @@ -288,7 +288,7 @@ namespace FrontendWebApi.ApiControllers List deviceItems = new List(); var main_system_value = hf.device_number.Split('_')[2]; var sub_system_value = hf.device_number.Split('_')[3]; - var sqlString = $@"select * from device_item where deleted = 0 and device_system_tag = @main_system_value and device_name_tag = @sub_system_value"; + var sqlString = $@"select * from device_item where deleted = 0 and device_system_tag = @main_system_value and device_name_tag = @sub_system_value and is_show_history = 1"; deviceItems = await frontendRepository.GetAllAsync(sqlString, new { @main_system_value = main_system_value, @sub_system_value = sub_system_value }); apiResult.Data = deviceItems; diff --git a/Repository/BackendRepository/Implement/NiagaraDataSynchronizeRepository.cs b/Repository/BackendRepository/Implement/NiagaraDataSynchronizeRepository.cs index dc135f5..18e2e45 100644 --- a/Repository/BackendRepository/Implement/NiagaraDataSynchronizeRepository.cs +++ b/Repository/BackendRepository/Implement/NiagaraDataSynchronizeRepository.cs @@ -321,12 +321,12 @@ namespace Repository.BackendRepository.Implement { isBool = 1; } - sb.Append($@"insert device_item(deleted, points, is_show, is_show_riserDiagram, is_controll, is_bool, is_link, + sb.Append($@"insert device_item(deleted, points, is_show, is_show_riserDiagram, is_controll, is_bool, is_link, is_show_history, device_system_tag, device_name_tag, created_at, updated_at) VALUES (0, '" + data.device_point_name + "', 1, 0, " + isControll + "," + - isBool + ", 1, '" + + isBool + ", 1, 1, '" + data.device_system_tag + "', '" + data.device_name_tag + "', " + "now(), now());"); @@ -341,7 +341,7 @@ namespace Repository.BackendRepository.Implement sb.Append($@" SET SQL_SAFE_UPDATES = 0; UPDATE device_item d LEFT JOIN import_niagara_item m ON d.device_system_tag = m.device_system_tag and d.device_name_tag = m.device_name_tag and d.points = m.device_point_name - SET d.is_link = 0 + SET d.is_link = 0, d.is_show_history = 0 WHERE m.device_point_name IS NULL"); await conn.ExecuteAsync(sb.ToString()); }