Mybatis-Pulus的Page、IPage分页使用

Mybatis-Pulus的Page、IPage分页使用,第1张

Mybatis-Pulus的Page、IPage分页使用

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

    }

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/zaji/5573817.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-12-14
下一篇2022-12-14

发表评论

登录后才能评论

评论列表(0条)

    保存