您的位置:首页 > 编程语言 > Java开发

springboot整合mybatis和pageHelper分页插件

2019-01-13 17:56 603 查看

1.导入依赖

<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper</artifactId>
<version>5.1.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.mybatis.spring.boot/mybatis-spring-boot-starter -->
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>1.3.2</version>
</dependency>

2.配置

mybatis:
##全局配置文件的位置
config-location: classpath: mybatis/mybatis-config.xml
##mapper映射文件
mapper-locations: classpath: mapper/*.xml

3.包扫描

@MapperScan

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: