同样PageHelper也可以用
PageHelper
MybatisPlus配置文件(放置与启动器一层级别)
@EnableTransactionManagement
@Configuration
@MapperScan("com.exam.service.*.mapper*")
public class MybatisPlusConfig {
@Bean
public PaginationInterceptor paginationInterceptor() {
return new PaginationInterceptor();
}
}
添加依赖
com.baomidou
mybatis-plus-boot-starter
3.1.0
Controller层实例
@RequestMapping("testPage")
public ApiResult testPage( Integer page, Integer size){
Page testpage =new Page<>(page,size);
IPage iPage =testImpService.findJudge(testpage);
return ApiResultHandler.buildApiResult(200,"分页查询成功",iPage);
}



