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