- 分页插件的地址:https://github.com/pagehelper/Mybatis-PageHelper
- 分页插件的使用:https://github.com/pagehelper/Mybatis-PageHelper/blob/master/wikis/zh/HowToUse.md
1、pom.xml中加入依赖:
<!--pagehelper分页坐标--><dependency><groupId>com.github.pagehelper</groupId><artifactId>pagehelper</artifactId><version>5.1.10</version></dependency>
2、在MyBatis配置文件中加入,分页插件:
<!--分页插件此处,方在 typeAliases 后面--><plugins><plugin interceptor="com.github.pagehelper.PageInterceptor" /></plugins>
分页插件插入的位置(位置不对会报错,鼠标停留报错的标签上,会提示正确的位置):
这里放在
<typeAliases>标签的后面。 ```xml <?xml version=”1.0” encoding=”UTF-8” ?> <!DOCTYPE configurationPUBLIC "-//mybatis.org//DTD Config 3.0//EN""http://mybatis.org/dtd/mybatis-3-config.dtd">
```
