参考文件(github上的使用说明):https://github.com/pagehelper/Mybatis-PageHelper/blob/master/wikis/en/HowToUse.md
部分代码示例:
<?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>
<!--引入外部资源-->
<properties resource="db.properties"></properties>
<!--添加 Log4j 1 的版本注册,本项目中与mybatis中的slf4j冲突,故注释-->
<!--<settings>
<setting name="logImpl" value="LOG4J"/>
</settings>-->
<!--别名-->
<typeAliases>
<!--<typeAlias type="com.example.demo.entity.Chengji" alias="chengji"/>-->
<package name="com.example.demo.entity"/>
</typeAliases>
<plugins>
<!--PageHelper分页插件-->
<plugin interceptor="com.github.pagehelper.PageInterceptor">
<!--<property name="" value=""/>-->
</plugin>
</plugins>
<environments default="mysql">
<environment id="mysql">
<transactionManager type="JDBC"/>
<dataSource type="POOLED">
<property name="driver" value="${datasource.driver-class-name}"></property>
..............
..............
如图所示: