|
@@ -25,11 +25,27 @@
|
|
<result property="updateTime" column="update_time" />
|
|
<result property="updateTime" column="update_time" />
|
|
<result property="updateBy" column="update_by" />
|
|
<result property="updateBy" column="update_by" />
|
|
<result property="remark" column="remark" />
|
|
<result property="remark" column="remark" />
|
|
|
|
+ <result property="type" column="type" />
|
|
</resultMap>
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectMenuVo">
|
|
<sql id="selectMenuVo">
|
|
- select menu_id, menu_name, parent_id, order_num, path, component, `query`, is_frame, is_cache, menu_type, visible, status, ifnull(perms,'') as perms, icon, create_time
|
|
|
|
- from sys_menu
|
|
|
|
|
|
+ select menu_id,
|
|
|
|
+ menu_name,
|
|
|
|
+ parent_id,
|
|
|
|
+ order_num,
|
|
|
|
+ path,
|
|
|
|
+ component,
|
|
|
|
+ `query`,
|
|
|
|
+ is_frame,
|
|
|
|
+ is_cache,
|
|
|
|
+ menu_type,
|
|
|
|
+ visible,
|
|
|
|
+ status,
|
|
|
|
+ ifnull(perms, '') as perms,
|
|
|
|
+ icon,
|
|
|
|
+ type,
|
|
|
|
+ create_time
|
|
|
|
+ from sys_menu
|
|
</sql>
|
|
</sql>
|
|
|
|
|
|
<select id="selectMenuList" parameterType="SysMenu" resultMap="SysMenuResult">
|
|
<select id="selectMenuList" parameterType="SysMenu" resultMap="SysMenuResult">
|
|
@@ -49,51 +65,88 @@
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<select id="selectMenuTreeAll" resultMap="SysMenuResult">
|
|
<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
|
|
|
|
- order by m.parent_id, m.order_num
|
|
|
|
- </select>
|
|
|
|
|
|
+ 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,
|
|
|
|
+ m.type
|
|
|
|
+ from sys_menu m
|
|
|
|
+ where m.menu_type in ('M', 'C')
|
|
|
|
+ and m.status = 0
|
|
|
|
+ order by m.parent_id, m.order_num
|
|
|
|
+ </select>
|
|
|
|
|
|
<select id="selectMenuListByUserId" parameterType="SysMenu" resultMap="SysMenuResult">
|
|
<select id="selectMenuListByUserId" 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_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
|
|
|
|
- where ur.user_id = #{params.userId}
|
|
|
|
- <if test="menuName != null and menuName != ''">
|
|
|
|
|
|
+ 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.type, m.create_time
|
|
|
|
+ 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
|
|
|
|
+ where ur.user_id = #{params.userId}
|
|
|
|
+ <if test="menuName != null and menuName != ''">
|
|
AND m.menu_name like concat('%', #{menuName}, '%')
|
|
AND m.menu_name like concat('%', #{menuName}, '%')
|
|
- </if>
|
|
|
|
- <if test="visible != null and visible != ''">
|
|
|
|
|
|
+ </if>
|
|
|
|
+ <if test="visible != null and visible != ''">
|
|
AND m.visible = #{visible}
|
|
AND m.visible = #{visible}
|
|
- </if>
|
|
|
|
- <if test="status != null and status != ''">
|
|
|
|
|
|
+ </if>
|
|
|
|
+ <if test="status != null and status != ''">
|
|
AND m.status = #{status}
|
|
AND m.status = #{status}
|
|
- </if>
|
|
|
|
- order by m.parent_id, m.order_num
|
|
|
|
- </select>
|
|
|
|
|
|
+ </if>
|
|
|
|
+ order by m.parent_id, m.order_num
|
|
|
|
+ </select>
|
|
|
|
|
|
<select id="selectMenuTreeByUserId" parameterType="Long" resultMap="SysMenuResult">
|
|
<select id="selectMenuTreeByUserId" 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
|
|
|
|
|
|
+ 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,
|
|
|
|
+ m.type
|
|
from sys_menu m
|
|
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
|
|
|
|
|
|
+ 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
|
|
order by m.parent_id, m.order_num
|
|
order by m.parent_id, m.order_num
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<select id="selectMenuListByRoleId" resultType="Long">
|
|
<select id="selectMenuListByRoleId" resultType="Long">
|
|
- select m.menu_id
|
|
|
|
- from sys_menu m
|
|
|
|
- left join sys_role_menu rm on m.menu_id = rm.menu_id
|
|
|
|
|
|
+ select m.menu_id
|
|
|
|
+ from sys_menu m
|
|
|
|
+ left join sys_role_menu rm on m.menu_id = rm.menu_id
|
|
where rm.role_id = #{roleId}
|
|
where rm.role_id = #{roleId}
|
|
- <if test="menuCheckStrictly">
|
|
|
|
- and m.menu_id not in (select m.parent_id from sys_menu m inner join sys_role_menu rm on m.menu_id = rm.menu_id and rm.role_id = #{roleId})
|
|
|
|
- </if>
|
|
|
|
- order by m.parent_id, m.order_num
|
|
|
|
- </select>
|
|
|
|
|
|
+ <if test="menuCheckStrictly">
|
|
|
|
+ and m.menu_id not in (select m.parent_id from sys_menu m inner join sys_role_menu rm on m.menu_id =
|
|
|
|
+ rm.menu_id and rm.role_id = #{roleId})
|
|
|
|
+ </if>
|
|
|
|
+ order by m.parent_id, m.order_num
|
|
|
|
+ </select>
|
|
|
|
|
|
<select id="selectMenuPerms" resultType="String">
|
|
<select id="selectMenuPerms" resultType="String">
|
|
select distinct m.perms
|
|
select distinct m.perms
|
|
@@ -149,6 +202,7 @@
|
|
<if test="perms !=null">perms = #{perms},</if>
|
|
<if test="perms !=null">perms = #{perms},</if>
|
|
<if test="icon !=null and icon != ''">icon = #{icon},</if>
|
|
<if test="icon !=null and icon != ''">icon = #{icon},</if>
|
|
<if test="remark != null and remark != ''">remark = #{remark},</if>
|
|
<if test="remark != null and remark != ''">remark = #{remark},</if>
|
|
|
|
+ <if test="type != null and type != ''">type = #{type},</if>
|
|
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
|
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
|
update_time = sysdate()
|
|
update_time = sysdate()
|
|
</set>
|
|
</set>
|
|
@@ -172,6 +226,7 @@
|
|
<if test="perms !=null and perms != ''">perms,</if>
|
|
<if test="perms !=null and perms != ''">perms,</if>
|
|
<if test="icon != null and icon != ''">icon,</if>
|
|
<if test="icon != null and icon != ''">icon,</if>
|
|
<if test="remark != null and remark != ''">remark,</if>
|
|
<if test="remark != null and remark != ''">remark,</if>
|
|
|
|
+ <if test="type != null and type != ''">type,</if>
|
|
<if test="createBy != null and createBy != ''">create_by,</if>
|
|
<if test="createBy != null and createBy != ''">create_by,</if>
|
|
create_time
|
|
create_time
|
|
)values(
|
|
)values(
|
|
@@ -190,6 +245,7 @@
|
|
<if test="perms !=null and perms != ''">#{perms},</if>
|
|
<if test="perms !=null and perms != ''">#{perms},</if>
|
|
<if test="icon != null and icon != ''">#{icon},</if>
|
|
<if test="icon != null and icon != ''">#{icon},</if>
|
|
<if test="remark != null and remark != ''">#{remark},</if>
|
|
<if test="remark != null and remark != ''">#{remark},</if>
|
|
|
|
+ <if test="type != null and type != ''">#{type},</if>
|
|
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
|
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
|
sysdate()
|
|
sysdate()
|
|
)
|
|
)
|