[後端] 修改api錯誤

This commit is contained in:
dev02 2023-05-16 15:18:10 +08:00
parent d8ec06a859
commit 104260b662

View File

@ -406,14 +406,15 @@ namespace FrontendWebApi.ApiControllers
var dbDevice = await backendRepository.GetAllAsync<History_PostItem>(
@$"select c.full_name building_name,b.device_number,b.full_name device_name,a.full_name item_name,a.points,a.unit
from device_item a
join device b on a.device_system_tag = b.device_system_tag
join device b on a.device_system_tag = b.device_system_tag
and a.device_building_tag COLLATE utf8mb4_unicode_ci = b.device_building_tag
and a.device_name_tag COLLATE utf8mb4_unicode_ci = b.device_name_tag
join building c on c.building_tag = b.device_building_tag
join variable v1 on v1.system_value = b.device_system_tag and v1.deleted = 0 and v1.system_type = 'device_system_category_layer2'
join variable v2 on v2.system_value = b.device_name_tag and v2.deleted = 0 and v2.system_type = 'device_system_category_layer3'
where a.deleted = 0 and b.deleted = 0 and v2.deleted = 0 and v1.deleted = 0
and a.unit is not null and b.device_number in @Device_number
order by c.priority,b.priority
"
order by c.priority,b.priority;"
, new { Device_number = postDevice.select_data.Select(a => a.device_number).ToList() }
);
apiResult.Data = dbDevice;