Mybaitsplus 条件查询+排序+分页
//创建QueryWrapper
QueryWrapper<User> queryWrapper = new QueryWrapper<User>();
//条件查询
queryWrapper.eq("apply_id", applyId);
queryWrapper.eq("del_status", 0);
//构建分页对象 【第一个参数是当前页数,第二个参数的每页条数】
Page<ApplyAuthorization> page = new Page<ApplyAuthorization>(applyAuthorizationParam.getCurrentPage(), applyAuthorizationParam.getPagesize());
//根据条件查询总条数
Integer selectCount = userMapper.selectCount(queryWrapper);
//排序
queryWrapper.orderByDesc("update_time");
// 或者:
queryWrapper.orderByAsc("update_time");
//进行分页
Page<ApplyAuthorization> applyAuthorizationPage = applyAuthorizationMapper.selectPage(page, queryWrapper);
//查询出分页后的数据
List<ApplyAuthorization> list= page.getRecords();