欢迎光临
我们一直在努力

mybatisplus page分页,mybatis page 分页

同样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); }

赞(0)
【声明】:本博客不参与任何交易,也非中介,仅记录个人感兴趣的主机测评结果和优惠活动,内容均不作直接、间接、法定、约定的保证。访问本博客请务必遵守有关互联网的相关法律、规定与规则。一旦您访问本博客,即表示您已经知晓并接受了此声明通告。