From 46b34ae73734c6f62ce244e6411cd243ce00c78c Mon Sep 17 00:00:00 2001 From: dev02 Date: Tue, 15 Nov 2022 11:25:25 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=AD=B7=E5=8F=B2=E8=B3=87?= =?UTF-8?q?=E6=96=99=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FrontendWebApi/ApiControllers/HistoryController.cs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) 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 });