003-SpringBoot整合Pagehelper
SpringBoot整合Pagehelper
- 一、引入依赖
- 二、配置 application.yml
- 三、配置 MybatisPlusConfig
- 四、Controller
- 五、ServiceImpl
一、引入依赖
<dependency><groupId>com.github.pagehelper</groupId><artifactId>pagehelper-spring-boot-starter</artifactId><version>1.4.1</version>
</dependency>
二、配置 application.yml
# PageHelper分页插件
# springboot配置分页插件pageHelper和数据库方言的几种方式 : https://www.cnblogs.com/zhncnblogs/p/17972507
pagehelper:helperDialect: mysqlreasonable: truesupportMethodsArguments: trueparams: count=countSqlautoRuntimeDialect: true
三、配置 MybatisPlusConfig
@Configuration
@MapperScan("org.example.mapper*")
public