pagehelper
一个分页的插件,今天使用的时候还是出了错误,所以在这边记录一下。
- 在pom.xml中加上
<!--pagehelper分页插件-->
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper</artifactId>
<version>5.1.2</version>
</dependency>
- 在mybatis.xml中加上
<plugins>
<plugin interceptor="com.github.pagehelper.PageInterceptor">
<property name="helperDialect" value="mysql"/>
<property name="reasonable" value="true"/>
</plugin>
</plugins>
- PageResult.java
import java.util.List;
public class PageResult<T> {
private Long total;//筛选后总记录数
private Integer curPage;//当前页
pri