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()); }