From d5055b7870d0406f9b00d429cb47d2bfb79b902c Mon Sep 17 00:00:00 2001
From: chenlu <1320612696@qq.com>
Date: 星期三, 10 十二月 2025 11:37:09 +0800
Subject: [PATCH] 补片流程卡添加打印次数

---
 north-glass-erp/src/main/resources/mapper/userInfo/PermissionBasicMapper.xml |   42 ++++++++++++++++++------------------------
 1 files changed, 18 insertions(+), 24 deletions(-)

diff --git a/north-glass-erp/src/main/resources/mapper/userInfo/PermissionBasicMapper.xml b/north-glass-erp/src/main/resources/mapper/userInfo/PermissionBasicMapper.xml
index 0e5ecf5..b307625 100644
--- a/north-glass-erp/src/main/resources/mapper/userInfo/PermissionBasicMapper.xml
+++ b/north-glass-erp/src/main/resources/mapper/userInfo/PermissionBasicMapper.xml
@@ -4,38 +4,28 @@
         "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.example.erp.mapper.userInfo.PermissionBasicMapper">
     <select id="getPermission">
-        select a.*,
-               CASE
-                   WHEN b.id IS NULL THEN 0
-                   ELSE 1
-                END as 'checked'
+        select a.id,
+               a.menu,
+
+               a.page,
+               a.permission,
+               a.state,
+        IF(b.id IS NULL, 0, 1) as 'checked'
         from permission_basic as a
         left join permission_role as b
-        on a.id = b.permission_id
-        left join user_role as c
-        on b.role_id = c.role_id
-        left join user as d
-        on c.user_id = d.id
-        and d.id = #{userId}
-        where
-            a.id!=1
-            and a.state=1
+        on b.permission_id = a.id
+        and b.role_id = #{roleId}
+
+        where a.id!=1 and a.state=1
         <if test="id != null and id != ''">
             and a.page = (select page from permission_basic where id = #{id})
         </if>
-
         group by a.id
     </select>
     
     <select id="selectOneLevel">
         select a.id,
-               <if test="lang=='zh'">
-                   b.itemName as menu
-               </if>
-                <if test="lang=='en'">
                     a.menu
-                </if>
-
         from permission_basic as a
         left join sys_menu_item as b
         on a.menu = b.menu
@@ -46,12 +36,16 @@
 
     <select id="selectTowLevel">
         select
-            id as value,
+            page as value,
             page as label
         from permission_basic
-        where id!=1 and state=1
-        group by  menu
+        where
+          state=1
+          and menu = (select menu from permission_basic where id = #{id})
+        group by page
 
     </select>
 
+
+
 </mapper>
\ No newline at end of file

--
Gitblit v1.8.0