mybatisplus分页查询


mybatisplus分页查询

mybatisplus实现分页查询步骤

  • 编写配置类注册分页组件

    // 分页插件
    @Bean 
    public PaginationInterceptor paginationInterceptor() { 
        return new PaginationInterceptor(); 
    }
    
  • 分页查询

    @Test 
    public void testPage(){ 
        // 参数一:当前页 
        // 参数二:页面大小 
        Page<User> page = new Page<>(2,5);
        userMapper.selectPage(page,null);
        page.getRecords().forEach(System.out::println);
    }
    


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM