Forráskód Böngészése

菜单配置调整

dzx 4 hete
szülő
commit
af567d4748
1 módosított fájl, 19 hozzáadás és 12 törlés
  1. 19 12
      src/main/resources/mapper/system/XjrMenuGroupMapper.xml

+ 19 - 12
src/main/resources/mapper/system/XjrMenuGroupMapper.xml

@@ -4,18 +4,25 @@
         "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.xjrsoft.module.system.mapper.XjrMenuGroupMapper">
     <select id="getMenuList" parameterType="com.xjrsoft.module.system.dto.XjrMenuGroupMenuListDto" resultType="com.xjrsoft.module.system.vo.XjrMenuGroupMenuListVo">
-        SELECT id, NAME,(
-            SELECT COUNT(*) FROM xjr_menu_group WHERE delete_mark = 0 AND xjr_menu_group_set_id = #{dto.xjrMenuGroupSetId}
-            AND xjr_menu_id = xjr_menu.id
+        SELECT t1.id, t1.name,(
+        SELECT COUNT(*) FROM xjr_menu_group WHERE delete_mark = 0 AND xjr_menu_group_set_id =  #{dto.xjrMenuGroupSetId}
+        AND xjr_menu_id = t1.id
         ) AS is_selected,
-        (
-            SELECT COUNT(*) FROM xjr_menu_group a1
-            INNER JOIN xjr_menu_group_set a2 ON a1.xjr_menu_group_set_id = a2.id
-            WHERE a1.delete_mark = 0 AND a2.id != #{dto.xjrMenuGroupSetId} AND a2.role_id = #{dto.roleId}
-            AND a2.delete_mark = 0
-            AND a1.xjr_menu_id = xjr_menu.id
-        ) AS is_used FROM xjr_menu WHERE system_id = 1726806691140907010
-        AND delete_mark = 0 AND enabled_mark = 1
-        AND system_type = 'system_app'
+        (SELECT COUNT(*) FROM xjr_menu_group a1
+        INNER JOIN xjr_menu_group_set a2 ON a1.xjr_menu_group_set_id = a2.id
+        WHERE a1.delete_mark = 0 AND a2.id !=  #{dto.xjrMenuGroupSetId} AND a2.role_id = #{dto.roleId}
+        AND a2.delete_mark = 0
+        AND a1.xjr_menu_id = t1.id) AS is_used FROM xjr_menu t1
+        LEFT JOIN xjr_subsystem t2 ON t1.system_id = t2.id
+        WHERE 1 = 1
+        AND t1.delete_mark = 0 AND t1.enabled_mark = 1
+        AND t1.system_type = 'system_app'
+        AND t2.code = 'student_app'
+        <if test="dto.roleId != null and dto.roleId == 3">
+            and t2.code = 'student_app'
+        </if>
+        <if test="dto.roleId != null and dto.roleId == 4">
+            and t2.code = 'parents_app'
+        </if>
     </select>
 </mapper>