加了个部门的查询条件

This commit is contained in:
yuezhihang
2022-03-23 17:46:13 +08:00
parent 461caf2105
commit 4ace839e1f
2 changed files with 17 additions and 0 deletions
@@ -11,6 +11,10 @@ public class RoleUserDTO {
// 要查询的角色
private String roleId;
private String institutionName;
private String institutionId;
private long pageNumber;
private long pageSize;
@@ -129,6 +129,7 @@
</select>
<select id="selectUserByRole" resultType="java.lang.Integer">
SELECT count(ts_user.USID) from ts_user
left join ts_institution on ts_institution.id=ts_user.INSTITUTION_ID
LEFT JOIN ts_user_position on ts_user.USID = ts_user_position.user_id
WHERE ts_user_position.position_id in (
SELECT ts_position_role.position_id from ts_position_role
@@ -139,6 +140,12 @@
<if test="null != role.userName and role.userName != ''">
and ts_user.UNAME like concat(concat('%',#{role.userName}),'%')
</if>
<if test="null != role.institutionName and role.institutionName != ''">
and ts_institution.name like concat(concat('%',#{role.institutionName}),'%')
</if>
<if test="null != role.institutionId and role.institutionId != ''">
and ts_user.INSTITUTION_ID = #{role.institutionId}
</if>
</select>
@@ -155,6 +162,12 @@
<if test="null != role.userName and role.userName != ''">
and ts_user.UNAME like concat(concat('%',#{role.userName}),'%')
</if>
<if test="null != role.institutionName and role.institutionName != ''">
and ts_institution.name like concat(concat('%',#{role.institutionName}),'%')
</if>
<if test="null != role.institutionId and role.institutionId != ''">
and ts_user.INSTITUTION_ID = #{role.institutionId}
</if>
limit ${(role.pageNumber - 1) * role.pageSize},${role.pageSize}
</select>
</mapper>