diff --git a/FrontendWebApi/ApiControllers/DeviceManageController.cs b/FrontendWebApi/ApiControllers/DeviceManageController.cs index 5a586fd..30c2e7e 100644 --- a/FrontendWebApi/ApiControllers/DeviceManageController.cs +++ b/FrontendWebApi/ApiControllers/DeviceManageController.cs @@ -96,7 +96,7 @@ namespace FrontendWebApi.ApiControllers try { - var sqlString = $@"select building_tag, full_name from building where deleted = 0"; + var sqlString = $@"select building_tag, full_name from building where deleted = 0 order by priority"; var bl = await backendRepository.GetAllAsync(sqlString); apiResult.Code = "0000"; @@ -132,7 +132,7 @@ namespace FrontendWebApi.ApiControllers try { - var sqlString = $@"select full_name as floor_tag from floor where deleted = 0 and building_tag = @building_tag"; + var sqlString = $@"select full_name as floor_tag from floor where deleted = 0 and building_tag = @building_tag order by priority"; var param = new { @building_tag = fd.building_tag }; var fl = await backendRepository.GetAllAsync(sqlString, param); @@ -182,10 +182,11 @@ namespace FrontendWebApi.ApiControllers foreach (var f in fl) { List dl = new List(); - sqlString = $@"select d.device_guid, d.full_name, d.status, d.device_coordinate, dm.device_master_icon,d.device_number + sqlString = $@"select d.device_guid, d.full_name, d.device_coordinate, dk.device_image, d.device_number, dk.device_normal_flashing, dk.device_close_flashing, dk.device_error_flashing from device d - left join device_master dm on d.device_building_tag = dm.device_building_tag and d.device_name_tag = dm.device_name_tag - where d.deleted = 0 and d.device_system_tag = @main_system_tag and d.device_building_tag = @building_tag and d.device_floor_tag = ifnull(@floor_tag, d.device_floor_tag)"; + left join device_kind dk on d.device_building_tag = dk.device_building_tag and d.device_system_tag = dk.device_system_tag + and d.device_name_tag = dk.device_name_tag + where d.deleted = 0 and d.device_system_tag = @sub_system_tag and d.device_building_tag = @building_tag and d.device_floor_tag = ifnull(@floor_tag, d.device_floor_tag)"; var dlParam = new { @main_system_tag = fd.main_system_tag, @building_tag = fd.building_tag, @floor_tag = fd.floor_tag }; dl = await backendRepository.GetAllAsync(sqlString, dlParam); f.device_list = dl; @@ -551,7 +552,6 @@ namespace FrontendWebApi.ApiControllers return Ok(apiResult); } return Ok(apiResult); - } } } diff --git a/FrontendWebApi/Models/Device.cs b/FrontendWebApi/Models/Device.cs index 71cf0a7..0a10c4b 100644 --- a/FrontendWebApi/Models/Device.cs +++ b/FrontendWebApi/Models/Device.cs @@ -48,7 +48,10 @@ namespace FrontendWebApi.Models return name[status]; } } - public string device_master_icon { get; set; } + public string device_image { get; set; } + public string device_normal_flashing { get; set; } + public string device_close_flashing { get; set; } + public string device_error_flashing { get; set; } } public class DeviceBaseInfo