欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

mybatis-plus分頁(yè)無(wú)效問(wèn)題解決

 更新時(shí)間:2025年03月17日 11:04:16   作者:Cookie-a  
本文主要介紹了mybatis-plus分頁(yè)無(wú)效問(wèn)題解決,原因是配置分頁(yè)插件的版本問(wèn)題,舊版本和新版本的MyBatis-Plus需要不同的分頁(yè)配置,感興趣的可以了解一下

昨天在做一個(gè)新項(xiàng)目使用mybatis-plus分頁(yè)一直失敗,后來(lái)經(jīng)過(guò)多方排查,確定問(wèn)題并解決:

配置分頁(yè)插件的問(wèn)題

3.4.0版本分界線,不同版本的mybatis-plus需要的分頁(yè)配置不同;

思路:

先查看自己項(xiàng)目mybatis-plus分頁(yè)的依賴版本:

我的是這樣的

            <!--mybatis-plus-->
            <dependency>
                <groupId>com.baomidou</groupId>
                <artifactId>mybatis-plus-boot-starter</artifactId>
                <version>3.5.3</version>
                <exclusions>
                    <exclusion>
                        <groupId>com.baomidou</groupId>
                        <artifactId>mybatis-plus-generator</artifactId>
                    </exclusion>
                    <exclusion>
                        <artifactId>jsqlparser</artifactId>
                        <groupId>com.github.jsqlparser</groupId>
                    </exclusion>
                </exclusions>
            </dependency>

 舊版本(3.4.0之前)的分頁(yè)插件配置

@Configuration
public class MybatisPlusConfig {

    /**
     * 分頁(yè)插件
     */
    @Bean
    public PaginationInterceptor paginationInterceptor() {
        return new PaginationInterceptor();
    }
}

 新版本(3.4.0之后)的分頁(yè)插件配置

@Configuration
public class MybatisPlusConfig {

    /**
     *  mybatis-plus分頁(yè)插件
     */
    @Bean
    public MybatisPlusInterceptor mybatisPlusInterceptor() {
        MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
        interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
        return interceptor;
    }

}

把這玩意搞好,問(wèn)題解決,美汁兒之兒!?。。。。。。。?!

到此這篇關(guān)于mybatis-plus分頁(yè)無(wú)效問(wèn)題解決的文章就介紹到這了,更多相關(guān)mybatis-plus分頁(yè)無(wú)效內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

最新評(píng)論