实现分页查询操作-SpringBoot版本

SpringBoot实现分页查询操作,pom配置一系列点击超链接,配套操作

springboot实现mybatis-plus操作 点击传送 基础mybatis-plus配置点击进入详解
1.MyBatisPlusConfig添加mybatis-plus推荐的分页插件

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

2.测试分页查询 MybatisPlusApplicationTests类

    @Test
    public void testPage(){
        Page<User> page = new Page<>(2,5);
        userMapper.selectPage(page,null);

        page.getRecords().forEach(System.out::println);
        System.out.println(page.getTotal());

    }
发布了14 篇原创文章 · 获赞 65 · 访问量 9425

猜你喜欢

转载自blog.csdn.net/weixin_44625302/article/details/105776246