当前使用版本(必填,否则不予处理)

3.4.1(无法从中央仓库拉取3.4.2)

该问题是如何引起的?(确定最新版也有问题再提!!!)

PaginationInterceptor被标记为@Deprecated 无法通过直接注入进行分页 配置类注入

@Bean
    public MybatisPlusInterceptor getMybatisPlusInterceptor(){
        return new MybatisPlusInterceptor();
    }
    @Bean
    public PaginationInnerInterceptor getPaginationInnerInterceptor(){
        return new PaginationInnerInterceptor(DbType.MYSQL);
    }

测试代码

        Page<Collect> page = new Page<>(1,1);
        Page<Collect> collectPage = collectMapper.selectPage(page, null);
        System.out.println(collectPage.getRecords());

注入过时的PaginationInterceptor可以,文档也要及时更新欧。

Comment From: miemieYaho

https://mybatis.plus/guide/interceptor.html

Comment From: BingChunMoLi

感谢,感谢