配置文件
@Configuration
public class MybatisPlusConfig {
// 分页拦截器,提供逻辑分页,查第几页就是第几页
//mybaits是内存分页,将所有数据都查出来再分页
@Bean
public PaginationInterceptor paginationInterceptor() {
return new PaginationInterceptor();
}
}
代码实现
LambdaQueryWrapper<CollectEntity> queryWrapper = new LambdaQueryWrapper<>();
IPage<CollectEntity> page = collectService.page(new Page<>(current, limit), queryWrapper);
List<CollectEntity> records = page.getRecords();
标签:LambdaQueryWrapper,分页,查询,public,MP,new,第几页,page
From: https://www.cnblogs.com/brickMovingWorker/p/17220417.html