SpringBoot使用mybatis-plus配置多个数据源,实现项目中从两个不同的数据库读取数据
1、添加依赖包
<properties>
<java.version>1.8</java.version>
<mybatis.version>2.1.2</mybatis.version>
<mybatis.plugin.version>3.4.3</mybatis.plugin.version>
<pagehelper.version>1.2.13</pagehelper.version>
</properties>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>${mybatis.version}