diff --git a/FrontendWebApi/ApiControllers/HistoryController.cs b/FrontendWebApi/ApiControllers/HistoryController.cs index 4bd6377..649b40c 100644 --- a/FrontendWebApi/ApiControllers/HistoryController.cs +++ b/FrontendWebApi/ApiControllers/HistoryController.cs @@ -163,18 +163,19 @@ namespace FrontendWebApi.ApiControllers try { var dbsub = await frontendRepository.GetAllAsync( - @$"select distinct e.full_name main_name,e.device_system_tag main_system_tag,d.full_name sub_name,d.device_name_tag sub_system_tag, e.priority, d.priority from role_auth a + @$"select distinct v1.system_key main_name, v1.system_value main_system_tag, v2.system_key sub_name, v2.system_value sub_system_tag, v1.system_priority, v2.system_priority + from role_auth a join auth_page b on a.AuthCode = b.AuthCode join userinfo c on c.role_guid = a.role_guid - join variable v2 on d.device_name_tag = v2.system_value and v2.system_type = @sub_system_type - join variable v1 on d.device_system_tag = v1.system_value and v1.system_type = @main_system_type + join variable v2 on b.ShowView = v2.id and v2.system_type = @sub_system_type + join variable v1 on v1.id = v2.system_parent_id and v1.system_type = @main_system_type where c.account = @account - order by e.priority, d.priority", new { @account = myUser.account, @sub_system_type = sub_system_type, @main_system_type = main_system_type }); + order by v1.system_priority, v2.system_priority", new { @account = myUser.account, @sub_system_type = sub_system_type, @main_system_type = main_system_type }); var dbbuilding = await frontendRepository.GetAllAsync( @$"select distinct d.building_guid,d.full_name,d.priority from role_auth a join auth_page b on a.AuthCode = b.AuthCode join userinfo c on c.role_guid = a.role_guid - join building d on d.device_building_tag = b.building_tag + join building d on d.building_tag = b.building_tag where c.account = '{myUser.account}' order by d.priority ", new { @account = myUser.account });