赞
踩
一、前言
一个springboot项目,使用了mybatis-plus,现在要集成PageHelper实现执行sql的分页功能。
1.pom.xml中使用这个jar包:
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper</artifactId>
<version>5.1.10</version>
</dependency>
2.bootstrap.yml中增加配置:
pagehelper:
helperDialect: mysql
reasonable: true
supportMethodsArguments: true
params: count=countSql
3.接下来需要把这个PageHelper插件注册到mybatis-plus中。
发现项目中有一个自己写的mybatis-plus配置类:
@Configuration
@ConditionalOnProperty("xx.xxx.id")
@MapperScan(basePac
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。