|
|
|
|
@@ -21,11 +21,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
<result property="remark" column="remark" />
|
|
|
|
|
<result property="menuList" column="menu_list" />
|
|
|
|
|
<result property="siteAccess" column="site_access" />
|
|
|
|
|
<result property="roleLevel" column="role_level" />
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
<sql id="selectRoleVo">
|
|
|
|
|
select distinct r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.menu_check_strictly, r.dept_check_strictly,
|
|
|
|
|
r.status, r.del_flag, r.create_time, r.remark,r.site_access
|
|
|
|
|
r.status, r.del_flag, r.create_time, r.remark,r.site_access,r.role_level
|
|
|
|
|
from sys_role r
|
|
|
|
|
left join sys_user_role ur on ur.role_id = r.role_id
|
|
|
|
|
left join sys_user u on u.user_id = ur.user_id
|
|
|
|
|
@@ -44,7 +45,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
r.del_flag,
|
|
|
|
|
r.create_time,
|
|
|
|
|
r.remark,
|
|
|
|
|
r.site_access
|
|
|
|
|
r.site_access,
|
|
|
|
|
r.role_level,
|
|
|
|
|
GROUP_CONCAT(srm.menu_id) AS menu_list
|
|
|
|
|
FROM sys_role r
|
|
|
|
|
LEFT JOIN sys_user_role ur ON ur.role_id = r.role_id
|
|
|
|
|
@@ -93,12 +95,44 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
r.create_time,
|
|
|
|
|
r.remark,
|
|
|
|
|
r.site_access,
|
|
|
|
|
r.role_level,
|
|
|
|
|
GROUP_CONCAT(srm.menu_id) AS menu_list
|
|
|
|
|
FROM sys_role r
|
|
|
|
|
LEFT JOIN sys_user_role ur ON ur.role_id = r.role_id
|
|
|
|
|
LEFT JOIN sys_user u ON u.user_id = ur.user_id
|
|
|
|
|
LEFT JOIN sys_role_menu srm ON srm.role_id = r.role_id
|
|
|
|
|
where r.del_flag = 0
|
|
|
|
|
<if test="roleLevel != null and roleLevel != 0">
|
|
|
|
|
AND r.role_level < #{role_level}
|
|
|
|
|
</if>
|
|
|
|
|
GROUP BY r.role_id
|
|
|
|
|
order by r.role_sort
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectAllocatableRole" resultMap="SysRoleResult">
|
|
|
|
|
SELECT
|
|
|
|
|
r.role_id,
|
|
|
|
|
r.role_name,
|
|
|
|
|
r.role_key,
|
|
|
|
|
r.role_sort,
|
|
|
|
|
r.data_scope,
|
|
|
|
|
r.menu_check_strictly,
|
|
|
|
|
r.dept_check_strictly,
|
|
|
|
|
r.status,
|
|
|
|
|
r.del_flag,
|
|
|
|
|
r.create_time,
|
|
|
|
|
r.remark,
|
|
|
|
|
r.site_access,
|
|
|
|
|
r.role_level,
|
|
|
|
|
GROUP_CONCAT(srm.menu_id) AS menu_list
|
|
|
|
|
FROM sys_role r
|
|
|
|
|
LEFT JOIN sys_user_role ur ON ur.role_id = r.role_id
|
|
|
|
|
LEFT JOIN sys_user u ON u.user_id = ur.user_id
|
|
|
|
|
LEFT JOIN sys_role_menu srm ON srm.role_id = r.role_id
|
|
|
|
|
where r.del_flag = 0
|
|
|
|
|
<if test="roleLevel != null and roleLevel != 0">
|
|
|
|
|
AND r.role_level < #{role_level}
|
|
|
|
|
</if>
|
|
|
|
|
GROUP BY r.role_id
|
|
|
|
|
order by r.role_sort
|
|
|
|
|
</select>
|
|
|
|
|
@@ -157,6 +191,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
<if test="status != null and status != ''">status,</if>
|
|
|
|
|
<if test="remark != null and remark != ''">remark,</if>
|
|
|
|
|
<if test="siteAccess != null and siteAccess != ''">site_access,</if>
|
|
|
|
|
<if test="roleLevel != null and roleLevel != ''">role_level,</if>
|
|
|
|
|
<if test="createBy != null and createBy != ''">create_by,</if>
|
|
|
|
|
create_time
|
|
|
|
|
)values(
|
|
|
|
|
@@ -170,6 +205,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
<if test="status != null and status != ''">#{status},</if>
|
|
|
|
|
<if test="remark != null and remark != ''">#{remark},</if>
|
|
|
|
|
<if test="siteAccess != null and siteAccess != ''">#{siteAccess},</if>
|
|
|
|
|
<if test="roleLevel != null and roleLevel != ''">#{roleLevel},</if>
|
|
|
|
|
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
|
|
|
|
sysdate()
|
|
|
|
|
)
|
|
|
|
|
@@ -187,6 +223,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
<if test="status != null and status != ''">status = #{status},</if>
|
|
|
|
|
<if test="remark != null">remark = #{remark},</if>
|
|
|
|
|
<if test="siteAccess != null">site_access = #{siteAccess},</if>
|
|
|
|
|
<if test="roleLevel != null">role_level = #{roleLevel},</if>
|
|
|
|
|
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
|
|
|
|
update_time = sysdate()
|
|
|
|
|
</set>
|
|
|
|
|
|