1
13693261870
2024-09-06 9e931b0b752b429827195899bc6f2fe461ae46c5
se-modules/se-system/src/main/resources/mapper/system/SysMenuMapper.xml
@@ -75,14 +75,20 @@
      order by m.parent_id, m.order_num
   </select>
    <select id="selectMenuTreeByUserId" parameterType="Long" resultMap="SysMenuResult">
    <select id="selectMenuTreeByUserId" resultMap="SysMenuResult">
      select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.`query`, m.route_name, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time, m.mark
      from sys_menu m
          left join sys_role_menu rm on m.menu_id = rm.menu_id
          left join sys_user_role ur on rm.role_id = ur.role_id
          left join sys_role ro on ur.role_id = ro.role_id
          left join sys_user u on ur.user_id = u.user_id
      where u.user_id = #{userId} and m.menu_type in ('M', 'C') and m.status = 0  AND ro.status = 0
      where m.menu_type in ('M', 'C') and m.status = 0 and ro.status = 0
         <if test="userId != null and userId != ''">
            and u.user_id = #{userId}
         </if>
         <if test="mark != null and mark != ''">
            and m.mark = #{mark}
         </if>
      order by m.parent_id, m.order_num
   </select>
@@ -93,9 +99,12 @@
         left join sys_user_role ur on rm.role_id = ur.role_id
         left join sys_role ro on ur.role_id = ro.role_id
         left join sys_user u on ur.user_id = u.user_id
      where u.user_id = #{userId} and m.menu_type in ('M', 'C', 'F') and m.status = 0  AND ro.status = 0
      where m.menu_type in ('M', 'C', 'F') and m.status = 0 and ro.status = 0
         <if test="userId != null and userId != ''">
            and u.user_id = #{userId}
         </if>
         <if test="mark != null and mark != ''">
            AND m.mark = #{mark}
            and m.mark = #{mark}
         </if>
      order by m.parent_id, m.order_num
   </select>