diff --git a/FrontendWebApi/ApiControllers/HistoryController.cs b/FrontendWebApi/ApiControllers/HistoryController.cs index 4c240b3..81b5f50 100644 --- a/FrontendWebApi/ApiControllers/HistoryController.cs +++ b/FrontendWebApi/ApiControllers/HistoryController.cs @@ -406,14 +406,15 @@ namespace FrontendWebApi.ApiControllers var dbDevice = await backendRepository.GetAllAsync( @$"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;