From dad0a6a3bc16880e91426cc48e5b40b7959ebd78 Mon Sep 17 00:00:00 2001 From: dev02 Date: Fri, 8 Sep 2023 20:47:19 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=BE=8C=E7=AB=AF]=20=E4=BF=AE=E6=94=B9api?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FrontendWebApi/ApiControllers/BuildController.cs | 2 +- .../ApiControllers/EmergencyDeviceController.cs | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/FrontendWebApi/ApiControllers/BuildController.cs b/FrontendWebApi/ApiControllers/BuildController.cs index 135a379..ff5117e 100644 --- a/FrontendWebApi/ApiControllers/BuildController.cs +++ b/FrontendWebApi/ApiControllers/BuildController.cs @@ -604,7 +604,7 @@ namespace FrontendWebApi.ApiControllers } //抓出該設備所需要的顯示的即時資料(平面圖) - var sql_tips = $@"SELECT di.* FROM device_item di WHERE di.deleted = 0 AND is_show = 1 AND device_name_tag = @sub_system_tag"; + var sql_tips = $@"SELECT di.* FROM device_item di WHERE di.deleted = 0 AND is_show = 1 AND device_name_tag = @sub_system_tag and device_building_tag = '{post.building_tag}'"; var device_item_floormap = await backendRepository.GetAllAsync(sql_tips, new { sub_system_tag = post.sub_system_tag }); diff --git a/FrontendWebApi/ApiControllers/EmergencyDeviceController.cs b/FrontendWebApi/ApiControllers/EmergencyDeviceController.cs index 5571a65..0b92271 100644 --- a/FrontendWebApi/ApiControllers/EmergencyDeviceController.cs +++ b/FrontendWebApi/ApiControllers/EmergencyDeviceController.cs @@ -500,11 +500,11 @@ namespace FrontendWebApi.ApiControllers from ( SELECT * FROM device_group dg WHERE dg.device_disaster != 0) dg - left join (select * from variable v where v.system_type = 'disaster' and v.deleted = 0) vd on vd.system_value = dg.device_disaster - left join building b on b.building_tag = dg.device_building_tag - left join floor f on f.floor_guid = dg.device_floor_guid - left join (select * from variable v where v.system_type = 'device_system_category_layer2' and v.deleted = 0) v2 on v2.system_value = dg.device_system_category_layer2 - left join (select * from variable v where v.system_type = 'device_system_category_layer3' and v.deleted = 0) v3 on v3.system_value = dg.device_system_category_layer3 + join (select * from variable v where v.system_type = 'disaster' and v.deleted = 0) vd on vd.system_value = dg.device_disaster + join building b on b.building_tag = dg.device_building_tag + join floor f on f.floor_guid = dg.device_floor_guid + join (select * from variable v where v.system_type = 'device_system_category_layer2' and v.deleted = 0) v2 on v2.system_value = dg.device_system_category_layer2 + join (select * from variable v where v.system_type = 'device_system_category_layer3' and v.deleted = 0) v3 on v3.system_value = dg.device_system_category_layer3 order by vd.system_priority,b.priority,f.priority,v2.system_priority,v3.system_priority"); var dis = getDeviceGroup.GroupBy(a => a.device_disaster);