update 简化查询角色功能

This commit is contained in:
疯狂的狮子li
2022-03-04 10:20:06 +08:00
parent c1d01fb1e1
commit 18cffc4678
4 changed files with 34 additions and 41 deletions

View File

@ -39,46 +39,14 @@
left join sys_dept d on u.dept_id = d.dept_id
</sql>
<select id="selectPageRoleList" parameterType="SysRole" resultMap="SysRoleResult">
<select id="selectPageRoleList" resultMap="SysRoleResult">
<include refid="selectRoleVo"/>
where r.del_flag = '0'
<if test="role.roleId != null and role.roleId != 0">
AND r.role_id = #{role.roleId}
</if>
<if test="role.roleName != null and role.roleName != ''">
AND r.role_name like concat('%', #{role.roleName}, '%')
</if>
<if test="role.status != null and role.status != ''">
AND r.status = #{role.status}
</if>
<if test="role.roleKey != null and role.roleKey != ''">
AND r.role_key like concat('%', #{role.roleKey}, '%')
</if>
<if test="role.params.beginTime != null and role.params.endTime != null">
AND r.create_time between #{role.params.beginTime} and #{role.params.endTime}
</if>
order by r.role_sort
${ew.getCustomSqlSegment}
</select>
<select id="selectRoleList" parameterType="SysRole" resultMap="SysRoleResult">
<select id="selectRoleList" resultMap="SysRoleResult">
<include refid="selectRoleVo"/>
where r.del_flag = '0'
<if test="roleId != null and roleId != 0">
AND r.role_id = #{roleId}
</if>
<if test="roleName != null and roleName != ''">
AND r.role_name like concat('%', #{roleName}, '%')
</if>
<if test="status != null and status != ''">
AND r.status = #{status}
</if>
<if test="roleKey != null and roleKey != ''">
AND r.role_key like concat('%', #{roleKey}, '%')
</if>
<if test="params.beginTime != null and params.endTime != null">
AND r.create_time between #{params.beginTime} and #{params.endTime}
</if>
order by r.role_sort
${ew.getCustomSqlSegment}
</select>
<select id="selectRolePermissionByUserId" parameterType="Long" resultMap="SysRoleResult">