Ver Fonte

用户分配多角色后,菜单需要合并。

tomatozq há 5 anos atrás
pai
commit
6a8f07bdca
1 ficheiros alterados com 7 adições e 3 exclusões
  1. 7 3
      src/main/resources/mapper/sys/Menu.xml

+ 7 - 3
src/main/resources/mapper/sys/Menu.xml

@@ -122,12 +122,16 @@
         </foreach>
     </select>
     <select id="findAllocMenu"  parameterType="string" resultMap="MenuMap">
-        select * from sys_menu m,sys_role_menu rm,sys_user_role ur
+        select * from sys_menu m
+        where m.menu_type = 2
+        and m.del_flag=0
+        and m.id_ in(
+        select rm.menu_id from
+        sys_role_menu rm,sys_user_role ur
         where ur.user_id=#{userId}
         and ur.role_id = rm.role_id
         and rm.menu_id = m.id_
-        and m.menu_type = 2
-        and m.del_flag=0
+        )
         <if test="parentId==null">
             and m.parent_id is null
         </if>