[後端] 修改api

This commit is contained in:
dev02 2023-09-08 20:47:19 +08:00
parent fb1d03c994
commit dad0a6a3bc
2 changed files with 6 additions and 6 deletions

View File

@ -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<DeviceItem>(sql_tips, new { sub_system_tag = post.sub_system_tag }); var device_item_floormap = await backendRepository.GetAllAsync<DeviceItem>(sql_tips, new { sub_system_tag = post.sub_system_tag });

View File

@ -500,11 +500,11 @@ namespace FrontendWebApi.ApiControllers
from ( from (
SELECT * SELECT *
FROM device_group dg WHERE dg.device_disaster != 0) dg 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 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 join building b on b.building_tag = dg.device_building_tag
left join floor f on f.floor_guid = dg.device_floor_guid 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 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 = '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"); order by vd.system_priority,b.priority,f.priority,v2.system_priority,v3.system_priority");
var dis = getDeviceGroup.GroupBy(a => a.device_disaster); var dis = getDeviceGroup.GroupBy(a => a.device_disaster);