分页数量不正确
This commit is contained in:
parent
f7e739ea7d
commit
5dc4b1e482
|
@ -285,6 +285,6 @@ public class SysUserController {
|
|||
index.put("auditTeamName", sysAuditTeamDTOList.stream().findFirst().isPresent() ? sysAuditTeamDTOList.stream().findFirst().get().getName() : "");
|
||||
return index;
|
||||
}).collect(Collectors.toList());
|
||||
return new Result<PageData<Map>>().ok(new PageData<>(temp, sysUserService.getUserByRoleListCount(roleId)));
|
||||
return new Result<PageData<Map>>().ok(new PageData<>(temp, sysUserService.getUserByRoleListCount(roleId, filterAuditTeam)));
|
||||
}
|
||||
}
|
|
@ -59,5 +59,5 @@ public interface SysUserDao extends BaseDao<SysUserEntity> {
|
|||
|
||||
List<Map> getUserByRoleList(@Param("roleIds") List<Long> roleIds, @Param("pageNum") int pageNum, @Param("pageSize") int pageSize, @Param("filter") boolean filter);
|
||||
|
||||
Long getUserByRoleListCount(@Param("roleIds") List<Long> roleIds);
|
||||
Long getUserByRoleListCount(@Param("roleIds") List<Long> roleIds, @Param("filter") boolean filter);
|
||||
}
|
|
@ -74,5 +74,5 @@ public interface SysUserService extends BaseService<SysUserEntity> {
|
|||
*/
|
||||
List<Map> getUserByRoleList(List<Long> roleIds, int pageNum, int pageSize, boolean filter);
|
||||
|
||||
Long getUserByRoleListCount(List<Long> roleIds);
|
||||
Long getUserByRoleListCount(List<Long> roleIds, boolean filter);
|
||||
}
|
||||
|
|
|
@ -568,7 +568,7 @@ public class SysUserServiceImpl extends BaseServiceImpl<SysUserDao, SysUserEntit
|
|||
}
|
||||
|
||||
@Override
|
||||
public Long getUserByRoleListCount(List<Long> roleIds) {
|
||||
return baseDao.getUserByRoleListCount(roleIds);
|
||||
public Long getUserByRoleListCount(List<Long> roleIds, boolean filter) {
|
||||
return baseDao.getUserByRoleListCount(roleIds, filter);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -261,8 +261,32 @@
|
|||
LIMIT ${pageNum}, ${pageSize}
|
||||
</select>
|
||||
<select id="getUserByRoleListCount" resultType="java.lang.Long">
|
||||
<!-- SELECT-->
|
||||
<!-- COUNT(DISTINCT sys_user.id )-->
|
||||
<!-- FROM-->
|
||||
<!-- sys_role_user-->
|
||||
<!-- LEFT JOIN sys_user ON sys_user.id = sys_role_user.user_id-->
|
||||
<!-- LEFT JOIN sys_dept ON sys_dept.id = sys_user.dept_id-->
|
||||
<!-- WHERE-->
|
||||
<!-- 1 = 1-->
|
||||
<!-- AND sys_role_user.del_flag = 0-->
|
||||
<!-- AND sys_user.id IS NOT NULL-->
|
||||
<!-- <if test="null != roleIds">-->
|
||||
<!-- AND sys_role_user.role_id IN-->
|
||||
<!-- <foreach item="roleId" collection="roleIds" open="(" separator="," close=")">-->
|
||||
<!-- #{roleId}-->
|
||||
<!-- </foreach>-->
|
||||
<!-- </if>-->
|
||||
|
||||
SELECT
|
||||
COUNT(DISTINCT sys_user.id )
|
||||
COUNT(temp.id)
|
||||
FROM
|
||||
(
|
||||
SELECT DISTINCT
|
||||
sys_user.id,
|
||||
sys_user.username,
|
||||
sys_user.real_name,
|
||||
sys_dept.`name`
|
||||
FROM
|
||||
sys_role_user
|
||||
LEFT JOIN sys_user ON sys_user.id = sys_role_user.user_id
|
||||
|
@ -270,13 +294,28 @@
|
|||
WHERE
|
||||
1 = 1
|
||||
AND sys_role_user.del_flag = 0
|
||||
AND sys_user.id IS NOT NULL
|
||||
<if test="null != roleIds">
|
||||
AND sys_role_user.role_id IN
|
||||
<foreach item="roleId" collection="roleIds" open="(" separator="," close=")">
|
||||
#{roleId}
|
||||
</foreach>
|
||||
</if>
|
||||
AND sys_user.id IS NOT NULL
|
||||
) temp
|
||||
WHERE
|
||||
1 = 1
|
||||
<if test="filter">
|
||||
AND NOT EXISTS (
|
||||
SELECT
|
||||
1
|
||||
FROM
|
||||
sys_audit_team
|
||||
WHERE
|
||||
JSON_CONTAINS(
|
||||
sys_audit_team.member,
|
||||
JSON_OBJECT( "id", temp.id ))
|
||||
)
|
||||
</if>
|
||||
</select>
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue