Quellcode durchsuchen

mybatis/system/MenuMapper.xml

wangchl vor 6 Jahren
Ursprung
Commit
f1bb10606b
1 geänderte Dateien mit 4 neuen und 2 gelöschten Zeilen
  1. 4 2
      src/main/resources/mybatis/system/MenuMapper.xml

+ 4 - 2
src/main/resources/mybatis/system/MenuMapper.xml

@@ -31,7 +31,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 		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
-		where ur.user_id = #{userId} and m.menu_type in ('M', 'C') and m.visible = 0
+			 LEFT JOIN sys_role ro on ur.role_id = ro.role_id
+		where ur.user_id = #{userId} and m.menu_type in ('M', 'C') and m.visible = 0  AND ro.status = 0
 		order by m.order_num
 	</select>
 	
@@ -102,7 +103,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  			<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
  			update_time = sysdate()
  		</set>
- 		where menu_id = #{menuId}
+ 		where 1=1
+ 		<if test="menuId != null and menuId  != ''">and menu_id = #{menuId}</if>
 	</update>
  	
  	<insert id="insertMenu" parameterType="Menu">