使用PageHepler分页
首先需要引入依赖
1 <dependency> 2 <groupId>com.github.pagehelper</groupId> 3 <artifactId>pagehelper-spring-boot-starter</artifactId> 4 <version>1.1.2</version> 5 </dependency>
然后再properties或者yml文件配置
1 pagehelper: 2 helperDialect: mysql 3 reasonable: false 4 supportMethodsArguments: true 5 params=count: countSql
PageHelper.startPage(page,size);
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId>
<version>1.1.2</version>
</dependency>