数据库配置信息
server:
port: 8080
spring:
datasource:
master:
driver-class-name: com.mysql.jdbc.Driver
url: jdbc:mysql://127.0.0.1:3306/test?useUnicode=true&characterEncoding=utf-8&useSSL=false
username: root
password: 123456
slaver:
driver-class-name: com.mysql.jdbc.Driver
url: jdbc:mysql://127.0.0.1:3306/dev?useUnicode=true&characterEncoding=utf-8&useSSL=false
username: root
password: 123456
mybatis:
#mapper-locations: classpath*:/mapper/**/*.xml
type-handlers-package: com.jx.smart.admin.config
configuration:
map-underscore-to-camel-case: true
主从数据库配置,主数据库一定要使用@Primary注解
@Configuration
@MapperScan(basePackages = "com.somta.springboot.dao.master", sqlSessionTemplateRef = "masterSqlSessionTemplate")
public class MasterD