From 9446dee3592d4e9ccacacf07c3ac765b7f7dfd5e Mon Sep 17 00:00:00 2001
From: ludc
Date: 星期一, 08 一月 2024 08:53:15 +0800
Subject: [PATCH] 代码提交

---
 Source/UBCS/ubcs-service/ubcs-system/src/main/resources/mapper/MenuMapper.xml |   40 +++++++++++++++++++++++++++++++++++++---
 1 files changed, 37 insertions(+), 3 deletions(-)

diff --git a/Source/UBCS/ubcs-service/ubcs-system/src/main/resources/mapper/MenuMapper.xml b/Source/UBCS/ubcs-service/ubcs-system/src/main/resources/mapper/MenuMapper.xml
index 6877a21..df3421c 100644
--- a/Source/UBCS/ubcs-service/ubcs-system/src/main/resources/mapper/MenuMapper.xml
+++ b/Source/UBCS/ubcs-service/ubcs-system/src/main/resources/mapper/MenuMapper.xml
@@ -197,7 +197,6 @@
                         #{item}
                     </foreach>
                   ) ) )
-
             UNION ALL
 
             SELECT
@@ -218,6 +217,32 @@
                     #{item}
                 </foreach>)
         ) menu ORDER BY sort
+    </select>
+
+    <select id="getButtonByParentCode" resultMap="menuResultMap">
+        SELECT
+            id,
+            parent_id,
+            code,
+            name,
+            alias,
+            PATH,
+            SOURCE,
+            ACTION,
+            sort
+        FROM
+            PL_SYS_MENU
+        WHERE
+            "CATEGORY" = '2'
+          AND IS_DELETED = 0
+          AND PARENT_ID IN (
+            SELECT
+            ID
+            FROM
+            PL_SYS_MENU
+            WHERE
+            CODE = #{code})
+        ORDER BY SORT
     </select>
 
     <select id="grantTree" resultMap="treeNodeResultMap">
@@ -483,11 +508,20 @@
 
     <select id="selectMenuChildByBtnType" resultMap="menuResultMap">
         select pm.*
-        from pl_sys_menu ps, pl_sys_menu pm
+            from pl_sys_menu ps, pl_sys_menu pm
         where pm.is_deleted = 0
           and ps.category = 1
           and ps.CODE = #{btmType}
-          and ps.id = pm.parent_id order by pm.sort asc
+          and ps.ID = pm.PARENT_ID
+            <if test="roleIds != null and roleIds != ''">
+                and ps.ID in (
+                    SELECT menu_id FROM pl_org_role_menu WHERE role_id IN
+                    <foreach collection="roleIds" index="index" item="item" open="(" separator="," close=")">
+                        #{item}
+                    </foreach>
+                )
+            </if>
+        order by pm.sort asc
     </select>
 
 </mapper>

--
Gitblit v1.9.3