From 46e7515d44974f5e50a545f1203c81c56b1751ac Mon Sep 17 00:00:00 2001 From: dev02 Date: Fri, 18 Nov 2022 17:18:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9device=20list?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FrontendWebApi/ApiControllers/DeviceManageController.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/FrontendWebApi/ApiControllers/DeviceManageController.cs b/FrontendWebApi/ApiControllers/DeviceManageController.cs index 08b7bde..3f9b227 100644 --- a/FrontendWebApi/ApiControllers/DeviceManageController.cs +++ b/FrontendWebApi/ApiControllers/DeviceManageController.cs @@ -154,7 +154,7 @@ namespace FrontendWebApi.ApiControllers { var sqlString = $@"select f.full_name as floor_tag from sub_system_floor ssf - join floor f on ssf.floor_tag = f.full_name and f.deleted = 0 + join floor f on ssf.floor_tag = f.full_name and ssf.building_tag = f.building_tag and f.deleted = 0 where ssf.deleted = 0 and f.building_tag = @building_tag and sub_system_tag = @sub_system_tag order by f.priority"; var param = new { @building_tag = fd.building_tag, @sub_system_tag = fd.sub_system_tag }; var fl = await backendRepository.GetAllAsync(sqlString, param); @@ -198,8 +198,11 @@ namespace FrontendWebApi.ApiControllers try { - var sqlString = $@"select full_name, InitMapName as map_name, concat(floor_map_name,'.svg') as floor_map_name from floor where deleted = 0 and building_tag = @building_tag and full_name = ifnull(@floor_tag, full_name)"; - var param = new { @building_tag = fd.building_tag, @floor_tag = fd.floor_tag }; + var sqlString = $@"select f.full_name, f.InitMapName as map_name, concat(f.floor_map_name,'.svg') as floor_map_name + from sub_system_floor ssf + join floor f on ssf.floor_tag = f.full_name and ssf.building_tag = f.building_tag and f.deleted = 0 + where ssf.deleted = 0 and ssf.building_tag = @building_tag and ssf.sub_system_tag = @sub_system_tag and ssf.floor_tag = ifnull(@floor_tag, ssf.floor_tag);"; + var param = new { @building_tag = fd.building_tag, @floor_tag = fd.floor_tag, @sub_system_tag = fd.sub_system_tag }; var fl = await backendRepository.GetAllAsync(sqlString, param); foreach (var f in fl)