From e2d74c9aef2c1165fa4c94c2fe3604849246e111 Mon Sep 17 00:00:00 2001 From: dev02 Date: Thu, 17 Nov 2022 16:04:40 +0800 Subject: [PATCH] fix device list api --- FrontendWebApi/ApiControllers/DeviceManageController.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/FrontendWebApi/ApiControllers/DeviceManageController.cs b/FrontendWebApi/ApiControllers/DeviceManageController.cs index 23583ff..c4bf115 100644 --- a/FrontendWebApi/ApiControllers/DeviceManageController.cs +++ b/FrontendWebApi/ApiControllers/DeviceManageController.cs @@ -172,7 +172,7 @@ namespace FrontendWebApi.ApiControllers { ApiResult> apiResult = new ApiResult>(); - if (string.IsNullOrEmpty(fd.main_system_tag)) + if (string.IsNullOrEmpty(fd.sub_system_tag)) { apiResult.Code = "0001"; apiResult.Msg = "必須系統類別"; @@ -201,8 +201,8 @@ namespace FrontendWebApi.ApiControllers from device d 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_name_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 { @sub_system_tag = fd.sub_system_tag, @building_tag = fd.building_tag, @floor_tag = fd.floor_tag }; + where d.deleted = 0 and d.device_name_tag = @sub_system_tag and d.device_building_tag = @building_tag and d.device_floor_tag = @floor_tag"; + var dlParam = new { @sub_system_tag = fd.sub_system_tag, @building_tag = fd.building_tag, @floor_tag = f.full_name }; dl = await backendRepository.GetAllAsync(sqlString, dlParam); f.device_list = dl; }