[後端] 修改historyapi

This commit is contained in:
dev02 2023-05-16 14:43:47 +08:00
parent 81dc79f31c
commit d8ec06a859

View File

@ -967,7 +967,6 @@ namespace FrontendWebApi.ApiControllers
from ( from (
select select
di.*, di.*,
d.device_building_tag,
d.device_number, d.device_number,
d.full_name as device_name, d.full_name as device_name,
d.priority d.priority
@ -975,10 +974,10 @@ namespace FrontendWebApi.ApiControllers
inner join device d on di.device_name_tag = d.device_name_tag and d.deleted = 0 inner join device d on di.device_name_tag = d.device_name_tag and d.deleted = 0
where di.deleted = 0 and di.unit is not null and d.device_number IN @Device_number where di.deleted = 0 and di.unit is not null and d.device_number IN @Device_number
) temp ) temp
inner join building b on temp.device_building_tag = b.building_tag and b.deleted = 0 inner join building b on temp.device_building_tag COLLATE utf8mb4_unicode_ci = b.building_tag and b.deleted = 0
inner join variable v1 on temp.device_system_tag = v1.system_value and v1.deleted = 0 and v1.system_type = 'device_system_category_layer2' inner join variable v1 on temp.device_system_tag COLLATE utf8mb4_unicode_ci = v1.system_value and v1.deleted = 0 and v1.system_type = 'device_system_category_layer2'
inner join variable v2 on temp.device_name_tag = v2.system_value and v2.deleted = 0 and v2.system_type = 'device_system_category_layer3' inner join variable v2 on temp.device_name_tag COLLATE utf8mb4_unicode_ci = v2.system_value and v2.deleted = 0 and v2.system_type = 'device_system_category_layer3'
order by b.priority, v1.system_priority, v2.system_priority, temp.priority"; order by b.priority, v1.system_priority, v2.system_priority, temp.priority;";
var device_item_infos = await frontendRepository.GetAllAsync<DeviceItemInfo>(sqlDeviceItemInfo, new { Device_number = device_numbers }); var device_item_infos = await frontendRepository.GetAllAsync<DeviceItemInfo>(sqlDeviceItemInfo, new { Device_number = device_numbers });