SpringBoot添加对Mybatis分页插件PageHelper的支持

1、修改maven配置文件pom.xml,添加对pageHelper的支持:

        <!--pagehelper-->
        <dependency>
            <groupId>com.github.pagehelper</groupId>
            <artifactId>pagehelper-spring-boot-starter</artifactId>
            <version>1.2.10</version>
        </dependency>

最新的版本号可以到这里查看:https://mvnrepository.com/artifact/com.github.pagehelper/pagehelper-spring-boot-starter

2、修改springboot配置文件application.properties,添加如下内容:

#pagehelper
pagehelper.helperDialect=mysql
pagehelper.reasonable=true
pagehelper.supportMethodsArguments=true
pagehelper.params=count=countSql

通过以上二步,就完成了在SpringBoot中对分页插件pageHelper的支持了,当前前提是要先支持Mybatis,支持方式参考我的上一篇文章:SpringBoot添加对Mybatis的支持

本文参考官方网址:https://github.com/abel533/MyBatis-Spring-Boot

原文地址:https://www.cnblogs.com/modou/p/10039891.html