diff --git a/FrontendWebApi/ApiControllers/DeviceManageController.cs b/FrontendWebApi/ApiControllers/DeviceManageController.cs index 93a4c9a..95c2bf0 100644 --- a/FrontendWebApi/ApiControllers/DeviceManageController.cs +++ b/FrontendWebApi/ApiControllers/DeviceManageController.cs @@ -182,7 +182,10 @@ namespace FrontendWebApi.ApiControllers foreach (var f in fl) { List dl = new List(); - sqlString = $@"select device_guid, device_last_name, status, device_coordinate where deleted = 0 and device_system_tag = @main_system_tag and device_building_tag = @building_tag and device_floor_tag = ifnull(@floor_tag, device_floor_tag)"; + sqlString = $@"select d.device_guid, d.device_last_name, d.status, d.device_coordinate, dm.device_master_icon + 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 and dm.deleted = 0 + where deleted = 0 and device_system_tag = @main_system_tag and device_building_tag = @building_tag and device_floor_tag = ifnull(@floor_tag, 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; diff --git a/FrontendWebApi/Models/Device.cs b/FrontendWebApi/Models/Device.cs index 8e10668..17c17f4 100644 --- a/FrontendWebApi/Models/Device.cs +++ b/FrontendWebApi/Models/Device.cs @@ -47,6 +47,7 @@ namespace FrontendWebApi.Models return name[status]; } } + public string device_master_icon { get; set; } } public class DeviceBaseInfo