修改device_item is_show_history
This commit is contained in:
parent
3a3efd388d
commit
b4c150a1d4
@ -288,7 +288,7 @@ namespace FrontendWebApi.ApiControllers
|
||||
List<DeviceItem> deviceItems = new List<DeviceItem>();
|
||||
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<DeviceItem>(sqlString, new { @main_system_value = main_system_value, @sub_system_value = sub_system_value });
|
||||
|
||||
apiResult.Data = deviceItems;
|
||||
|
@ -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());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user