diff --git a/FrontendWebApi/ApiControllers/BuildController.cs b/FrontendWebApi/ApiControllers/BuildController.cs index 00a8c2f..15b59d9 100644 --- a/FrontendWebApi/ApiControllers/BuildController.cs +++ b/FrontendWebApi/ApiControllers/BuildController.cs @@ -281,14 +281,14 @@ namespace FrontendWebApi.ApiControllers } try { - var sub_system = await backendRepository.GetOneAsync(@$"select ss.full_name subfull_name,me.* from building_menu me - left join sub_system ss on ss.sub_system_tag = me.sub_system_tag - where me.building_tag = '{get.building_tag}' and me.main_system_tag = '{get.main_system_tag}' and me.sub_system_tag = '{get.sub_system_tag}' order by ss.priority"); + var sub_system = await backendRepository.GetOneAsync(@$"select v.system_key subfull_name,me.* from building_menu me + left join variable v on v.system_value = me.sub_system_tag and v.system_type = 'device_system_category_layer3' and v.deleted = 0 + where me.building_tag = '{get.building_tag}' and me.main_system_tag = '{get.main_system_tag}' and me.sub_system_tag = '{get.sub_system_tag}' order by v.system_priority"); List Floors = new List(); var floorsql = await backendRepository.GetAllAsync($@" - select * from (select * from sub_system_floor ssf where ssf.deleted = 0 and ssf.status = 0 and ssf.building_tag = '{get.building_tag}' and ssf.main_system_guid = '{get.main_system_tag}' and ssf.sub_system_tag = '{get.sub_system_tag}') a - left join floor on floor.floor_guid = a.floor_guid order by floor.priority"); + select * from (select * from sub_system_floor ssf where ssf.deleted = 0 and ssf.status = 0 and ssf.building_tag = '{get.building_tag}' and ssf.main_system_tag = '{get.main_system_tag}' and ssf.sub_system_tag = '{get.sub_system_tag}') a + left join floor on floor.full_name = a.floor_tag order by floor.priority"); Sub_system sub_System = new Sub_system() { sub_system_guid = sub_system.sub_system_tag,