描述:基于MyBatis分页插件(https://github.com/pagehelper/Mybatis-PageHelper),可以让mapper直接返回PageInfo而不用做二次转换。
pom.xml
<dependency>
<groupId>com.chrhc.mybatis</groupId>
<artifactId>PageHelperExt</artifactId>
<version>0.0.1</version>
</dependency>
mybatis-config.xml
<objectFactory type="com.chrhc.mybatis.pagehelper.ext.PageObjectFactory" />
<objectWrapperFactory type="com.chrhc.mybatis.pagehelper.ext.PageObjectWrapperFactory" />
<plugins>
<plugin interceptor="com.github.pagehelper.PageHelper">
<property name="reasonable" value="true"/>
<property name="supportMethodsArguments" value="true"/>
</plugin>
</plugins>
作者QQ:605162215
作者邮箱:605162215@qq.com