先导包
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper</artifactId>
<version>5.2.0</version>
</dependency>
先在spring配置文件添加
<property name="plugins">
<array>
<bean class="com.github.pagehelper.PageInterceptor">
<property name="properties">
<!--使用下面的方式配置参数,一行配置一个 -->
<value>
offsetAsPageNum=true <!-- offset参数当成pageNum使用 -->
rowBoundsWithCount=true <!-- 进行count查询 -->
pageSizeZero=true <!-- pageSize=0查询全部 -->
reasonable=true <!-- 分页合理化参数 -->
autoRuntimeDialect=true <!-- 多数据源自动识别对应方言 -->