[Java] 纯文本查看 复制代码 int pageNum = Integer.parseInt((String) params.get("page"));
int limit = Integer.parseInt((String) params.get("limit"));
Page<UserBasicInfoEntity> page = new Page<>(pageNum, limit);
//查询用户信息
List<UserBasicInfoEntity> userBasicInfoEntityList = baseMapper.queryPage(page, params);
userBasicInfoEntityList = convertOnlineState(userBasicInfoEntityList);
//如果等于0就表明只需要非vip用户
if(null != params.get("privilegeId")){
Integer privilegeId = Integer.parseInt((String) params.get("privilegeId"));
if(privilegeId == 0){
for (int i = 0; i < userBasicInfoEntityList.size(); i++) {
UserBasicInfoEntity userBasicInfoEntity = userBasicInfoEntityList.get(i);
if( userBasicInfoEntity.getIsVip() == 1){
userBasicInfoEntityList.remove(i);
break;
}
}
}
}
page.setRecords(userBasicInfoEntityList);
// page.getPages();
return new PageUtils(page);
大佬们可以看到 在查询后我进行一个for循环筛选了vip用户 但是筛选完毕后 page里面的 totalCount totalPage currPage都还是未筛选之前的数据 这个问题怎么解决呢 光从数据库没办法判断是不是vip |