# MyBatis教程 - 13 SpringBoot整合MyBatis
参考 SpringBoot教程 (opens new window) 中的 SpringBoot整合MyBatis (opens new window) 。
下面介绍一下如何基于 SpringBoot整合MyBatis (opens new window) 继续整合 PageHelper 分页。
# 13.1 集成PageHelper
# 1 引入依赖
在项目或模块的 pom.xml 中引入 PageHelper 的依赖:
<!-- 集成pagehelper -->
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId>
<version>2.1.0</version>
</dependency>
<!-- 引入hutool工具包,这里是为了引入一些工具类,方便测试,这个可以不引入! -->
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
<version>5.8.31</version>
</dependency>
1
2
3
4
5
6
7
8
9
10
11
12
13
2
3
4
5
6
7
8
9
10
11
12
13
添加完成,右键 -> Maven -> Reload project
。
# 2 添加PageHelper配置
在 application.yaml
或 application.properties
中添加 PagerHelper 的配置,如下:
内容未完......