|
@@ -49,8 +49,24 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="selectMenuTreeAll" resultMap="SysMenuResult">
|
|
|
- select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.`query`, 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
|
|
|
- from sys_menu m where m.menu_type in ('M', 'C') and m.status = 0
|
|
|
+ select distinct m.menu_id,
|
|
|
+ m.parent_id,
|
|
|
+ m.menu_name,
|
|
|
+ m.path,
|
|
|
+ m.component,
|
|
|
+ m.`query`,
|
|
|
+ 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
|
|
|
+ from sys_menu m
|
|
|
+ where m.menu_type in ('M', 'C')
|
|
|
+ and m.status = 1
|
|
|
order by m.parent_id, m.order_num
|
|
|
</select>
|
|
|
|
|
@@ -105,17 +121,20 @@
|
|
|
<select id="selectMenuPermsByUserId" parameterType="Long" resultType="String">
|
|
|
select distinct m.perms
|
|
|
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 r on r.role_id = ur.role_id
|
|
|
- where m.status = '0' and r.status = '0' and ur.user_id = #{userId}
|
|
|
+ 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 r on r.role_id = ur.role_id
|
|
|
+ where m.status = '1'
|
|
|
+ and r.status = '0'
|
|
|
+ and ur.user_id = #{userId}
|
|
|
</select>
|
|
|
|
|
|
<select id="selectMenuPermsByRoleId" parameterType="Long" resultType="String">
|
|
|
select distinct m.perms
|
|
|
from sys_menu m
|
|
|
- left join sys_role_menu rm on m.menu_id = rm.menu_id
|
|
|
- where m.status = '0' and rm.role_id = #{roleId}
|
|
|
+ left join sys_role_menu rm on m.menu_id = rm.menu_id
|
|
|
+ where m.status = '1'
|
|
|
+ and rm.role_id = #{roleId}
|
|
|
</select>
|
|
|
|
|
|
<select id="selectMenuById" parameterType="Long" resultMap="SysMenuResult">
|