| | |
| | | order by m.parent_id, m.order_num |
| | | </select> |
| | | |
| | | <select id="selectDeptMenuList" parameterType="Long" 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 |
| | | inner join sys_dept_menu rm on m.menu_id = rm.menu_id |
| | | where rm.dept_id = #{deptId} AND m.menu_from = 1 AND rm.menu_from = 1 |
| | | order by m.parent_id, m.order_num |
| | | </select> |
| | | |
| | | <select id="selectStaffDeptMenuList" parameterType="Long" 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 |
| | | inner join sys_dept_menu rm on m.menu_id = rm.menu_id |
| | | where rm.dept_id = #{deptId} AND m.menu_from = 2 AND rm.menu_from = 2 |
| | | order by m.parent_id, m.order_num |
| | | </select> |
| | | |
| | | <select id="selectMenuListByStaffUserId" parameterType="SysMenu" 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 |
| | | left join sys_user_menu rm on m.menu_id = rm.menu_id |
| | | where rm.user_id = #{params.userId} AND m.menu_from = 1 AND rm.menu = 1 |
| | | <if test="menuName != null and menuName != ''"> |
| | | AND m.menu_name like concat('%', #{menuName}, '%') |
| | | </if> |
| | | <if test="visible != null and visible != ''"> |
| | | AND m.visible = #{visible} |
| | | </if> |
| | | <if test="status != null and status != ''"> |
| | | AND m.status = #{status} |
| | | </if> |
| | | order by m.parent_id, m.order_num |
| | | </select> |
| | | |
| | | <select id="selectStaffMenuListByUserId" parameterType="SysMenu" 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 |
| | |
| | | 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} AND m.menu_from = 1 |
| | | </select> |
| | | |
| | | <select id="selectMenuPermsByStaffUserId" parameterType="Long" resultType="String"> |
| | | select distinct m.perms |
| | | from sys_menu m |
| | | INNER join sys_user_menu rm on m.menu_id = rm.menu_id |
| | | where m.status = '0' and r.status = '0' and rm.user_id = #{userId} AND m.menu_from = 1 AND rm.menu_from = 1 |
| | | </select> |
| | | |
| | | <select id="selectMenuPermsByRoleId" parameterType="Long" resultType="String"> |
| | | select distinct m.perms |
| | |
| | | |
| | | <select id="selectMenuById" parameterType="Long" resultMap="SysMenuResult"> |
| | | <include refid="selectMenuVo"/> |
| | | where menu_id = #{menuId} AND m.menu_from = 1 |
| | | where menu_id = #{menuId} AND menu_from = 1 |
| | | </select> |
| | | |
| | | <select id="hasChildByMenuId" resultType="Integer"> |
| | | select count(1) from sys_menu where parent_id = #{menuId} AND m.menu_from = 1 |
| | | select count(1) from sys_menu where parent_id = #{menuId} AND menu_from = 1 |
| | | </select> |
| | | |
| | | <select id="checkMenuNameUnique" parameterType="SysMenu" resultMap="SysMenuResult"> |
| | | <include refid="selectMenuVo"/> |
| | | where menu_name=#{menuName} and parent_id = #{parentId} limit 1 AND m.menu_from = 1 |
| | | where menu_name=#{menuName} AND menu_from = 1 and parent_id = #{parentId} limit 1 |
| | | </select> |
| | | |
| | | <update id="updateMenu" parameterType="SysMenu"> |