以下示范如何正确使用pagehelper分页
开发环境
springboot 2.0 + mysql 8.0
一 正确引入pagehelper依赖
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId>
<version>1.4.3</version>
</dependency>
二 在yml或properties中配置pagehelper
page helper:
helperDialect: mysql
supportMethodsArguments: true
params: count=countSql
三 配置 mybatis-config.xml (最不能缺少的一步)
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE configuration
PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>