1、分页查询
Page<SysRole> iPage =
this.lambdaQuery()
.like(Objects.nonNull(sysRoleListDTO.getRoleName()), SysRole::getRoleName, sysRoleListDTO.getRoleName())
.between(Objects.nonNull(sysRoleListDTO.getEndTime()) && Objects.nonNull(sysRoleListDTO.getEndTime())
, BaseEntity::getCreateTime, sysRoleListDTO.getStartTime(), sysRoleListDTO.getEndTime())
.orderByDesc(BaseEntity::getCreateTime)
.eq(BaseEntity::getDomainId, sysRoleListDTO.getDomainId())
.page(new Page<>(page, limit));
int total = 0;
if (Objects.nonNull(iPage)) {
total = Math.toIntExact(iPage.getTotal());
//添加角色用户数
fillPeopleNum(iPage);
}
return ResponseResult.success(iPage, total);