From 38a0fc69964155534988185b3cee6f9b520729ea Mon Sep 17 00:00:00 2001 From: dev02 Date: Wed, 29 Nov 2023 14:28:13 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=BE=8C=E7=AB=AF]=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=B0=8F=E9=A1=9E=E5=88=A4=E6=96=B7=E9=97=9C=E8=81=AF=E6=9E=B6?= =?UTF-8?q?=E6=A7=8B,=20=E4=BF=AE=E6=94=B9=E4=BD=BF=E7=94=A8=E8=80=85?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=8D=80=E5=9F=9F=E9=81=B8=E5=96=AE=E9=8C=AF?= =?UTF-8?q?=E8=AA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Backend/Controllers/SystemCategoryController.cs | 11 +++++------ Backend/Controllers/UserInfoController.cs | 1 + 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Backend/Controllers/SystemCategoryController.cs b/Backend/Controllers/SystemCategoryController.cs index 271e3f1..b4bf6fb 100644 --- a/Backend/Controllers/SystemCategoryController.cs +++ b/Backend/Controllers/SystemCategoryController.cs @@ -443,7 +443,7 @@ namespace Backend.Controllers LEFT JOIN building b ON bm.building_tag = b.building_tag AND b.deleted = 0 LEFT JOIN variable sv ON bm.sub_system_tag = sv.system_value AND sv.deleted = 0 LEFT JOIN variable mv ON sv.system_parent_id = mv.id AND mv.deleted = 0 - WHERE sv.id = @id"; + WHERE sv.id = @id and bm.is_link > 0"; var buildMenus = await backendRepository.GetAllAsync(sbuildMenu, new { id = id }); if (buildMenus.Count > 0) @@ -455,14 +455,13 @@ namespace Backend.Controllers } //檢查是否有未刪除的系統小類樓層 - var ssubSystemFloor = $@"SELECT - CONCAT(b.full_name, ' - ', mv.full_name, ' - ', sv.full_name, ' - ', f.full_name) + var ssubSystemFloor = $@"SELECT CONCAT(b.full_name, '-', mv.system_key, '-', sv.system_key, '-', f.full_name) FROM sub_system_floor ssf LEFT JOIN building b ON ssf.building_tag = b.building_tag AND b.deleted = 0 LEFT JOIN variable sv ON sv.system_value = ssf.sub_system_tag AND sv.deleted = 0 LEFT JOIN variable mv ON sv.system_parent_id = mv.id AND mv.deleted = 0 - LEFT JOIN floor f ON ssf.floor_guid = f.floor_guid AND f.deleted = 0 - WHERE sv.id = @id AND ssf.deleted = 0"; + LEFT JOIN floor f ON ssf.floor_tag = f.full_name AND f.deleted = 0 + WHERE sv.id = @id AND ssf.deleted = 0 and is_link = 1"; var subSystemFloor = await backendRepository.GetAllAsync(sbuildMenu, new { id = id }); if (subSystemFloor.Count > 0) @@ -478,7 +477,7 @@ namespace Backend.Controllers di.full_name FROM device_item di INNER JOIN variable sv on di.device_name_tag = sv.system_value - WHERE sv.deleted = 0 AND sv.id = @id AND di.deleted = 0"; + WHERE sv.deleted = 0 AND sv.id = @id AND di.deleted = 0 and di.is_link = 1"; var deviceItems = await backendRepository.GetAllAsync(sdeviceItem, new { id = id }); if (deviceItems.Count > 0) diff --git a/Backend/Controllers/UserInfoController.cs b/Backend/Controllers/UserInfoController.cs index 47d6a6a..4d042d3 100644 --- a/Backend/Controllers/UserInfoController.cs +++ b/Backend/Controllers/UserInfoController.cs @@ -523,6 +523,7 @@ namespace Backend.Controllers var sqlString = @$" SELECT ap.AuthCode, ap.MainName, ap.SubName, ap.ShowView FROM auth_page ap WHERE ap.AuthType='{post.SelectedAuthType}' {buildingGuid} + and ap.subname is not null and ap.showview is not null AND ap.AuthCode NOT IN ( SELECT ra.AuthCode FROM role_auth ra LEFT JOIN auth_page ap ON ra.AuthCode = ap.AuthCode