修改device_item is_show_history

This commit is contained in:
dev02 2022-12-30 16:29:42 +08:00
parent 3a3efd388d
commit b4c150a1d4
2 changed files with 4 additions and 4 deletions

View File

@ -288,7 +288,7 @@ namespace FrontendWebApi.ApiControllers
List<DeviceItem> deviceItems = new List<DeviceItem>(); List<DeviceItem> deviceItems = new List<DeviceItem>();
var main_system_value = hf.device_number.Split('_')[2]; var main_system_value = hf.device_number.Split('_')[2];
var sub_system_value = hf.device_number.Split('_')[3]; 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<DeviceItem>(sqlString, new { @main_system_value = main_system_value, @sub_system_value = sub_system_value }); deviceItems = await frontendRepository.GetAllAsync<DeviceItem>(sqlString, new { @main_system_value = main_system_value, @sub_system_value = sub_system_value });
apiResult.Data = deviceItems; apiResult.Data = deviceItems;

View File

@ -321,12 +321,12 @@ namespace Repository.BackendRepository.Implement
{ {
isBool = 1; 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) device_system_tag, device_name_tag, created_at, updated_at)
VALUES (0, '" + VALUES (0, '" +
data.device_point_name + "', 1, 0, " + data.device_point_name + "', 1, 0, " +
isControll + "," + isControll + "," +
isBool + ", 1, '" + isBool + ", 1, 1, '" +
data.device_system_tag + "', '" + data.device_system_tag + "', '" +
data.device_name_tag + "', " + data.device_name_tag + "', " +
"now(), now());"); "now(), now());");
@ -341,7 +341,7 @@ namespace Repository.BackendRepository.Implement
sb.Append($@" SET SQL_SAFE_UPDATES = 0; sb.Append($@" SET SQL_SAFE_UPDATES = 0;
UPDATE device_item d LEFT JOIN import_niagara_item m 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 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"); WHERE m.device_point_name IS NULL");
await conn.ExecuteAsync(sb.ToString()); await conn.ExecuteAsync(sb.ToString());
} }