*配置文件(application.yml)
server:
port: 9000
spring:
datasource:
driver-class-name: com.mysql.jdbc.Driver
url: jdbc:mysql://localhost:3306/book
username: root
password: 123.com
pagehelper:
helper-dialect: mysql
reasonable: true
support-methods-arguments: true
params: count=countSql
第一步:(导入pom依赖)
<!--分页插件 PageHelper-->
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId>
<version>1.2.10</version>
</dependency>
注意的是boot的版本要降低,并且mysql依赖的也要有版本
第二部:(在service层中写代码)
001:service
PageInfo<BookDTO> selectBook(Integer pageNum , Integer pageSize);
002:serviceImpl