• 添加依赖
<dependency>
          <groupId>com.github.pagehelper</groupId>
          <artifactId>pagehelper</artifactId>
          <version>5.1.2</version>
      </dependency>
  • 在mybatis配置文件mybatis.xml添加***插件
<plugins>
        <plugin interceptor="com.github.pagehelper.PageInterceptor">
            <property name="reasonable" value="false"/>//合理化
        </plugin>
    </plugins>

注意确保在spring.xml文件指明了mybatis.xml,***才起作用