springboot 分页插件

 

全局配置  旧版本

创建一个配置类

加上注解

@Configuration
    @Bean
    public PaginationInterceptor paginationInterceptor(){
        PaginationInterceptor paginationInterceptor = new PaginationInterceptor();
        return paginationInterceptor;
    }

 

 

Page<Student> page = new Page<>(limit,size);
        IPage<Student> studentIPage = studentMapper.selectPage(page, wrapper);
        studentIPage.getRecords();//获取数据
        studentIPage.getCurrent();//获取当前页数
        studentIPage.getTotal();//获取总页数
        studentIPage.getSize();//获取数据量

 

posted @ 2022-06-26 16:54  Hello霖  阅读(32)  评论(0)    收藏  举报