|
@@ -1,76 +1,94 @@
|
|
|
-#spring:
|
|
|
-# datasource:
|
|
|
-# type: com.alibaba.druid.pool.DruidDataSource
|
|
|
-
|
|
|
-################### mybatis-plus配置 ###################
|
|
|
-mybatis-plus:
|
|
|
- mapper-locations: classpath*:mapping/**/*.xml
|
|
|
-# type-aliases-package: com.gxzc.zen.api.bus.mapper,com.gxzc.zen.api.sys.mapper #,com.gxzc.zen.api.useage.mapper
|
|
|
- global-config:
|
|
|
- id-type: 0 #0:数据库ID自增 1:用户输入id 2:全局唯一id(IdWorker) 3:全局唯一ID(uuid)
|
|
|
- db-column-underline: true
|
|
|
- refresh-mapper: true
|
|
|
- logic-delete-value: 0
|
|
|
- logic-not-delete-value: 1
|
|
|
- sql-injector: com.baomidou.mybatisplus.mapper.LogicSqlInjector
|
|
|
- configuration:
|
|
|
- map-underscore-to-camel-case: true
|
|
|
- cache-enabled: true #配置的缓存的全局开关
|
|
|
- lazyLoadingEnabled: true #延时加载的开关
|
|
|
- multipleResultSetsEnabled: true #延时加载一个属性时会加载该对象全部属性,否则按需加载属性
|
|
|
- interceptors: com.baomidou.mybatisplus.plugins.OptimisticLockerInterceptor
|
|
|
- # log-impl: org.apache.ibatis.logging.stdout.StdOutImpl #打印sql语句,调试用
|
|
|
-
|
|
|
+orm:
|
|
|
+ multi-datasource-enable: true # 多数据源开关
|
|
|
|
|
|
################## Alibaba Druid 配置 ##################
|
|
|
spring:
|
|
|
datasource:
|
|
|
+ type: com.alibaba.druid.pool.DruidDataSource
|
|
|
druid:
|
|
|
stat-view-servlet:
|
|
|
enabled: true
|
|
|
login-username: root
|
|
|
login-password: root
|
|
|
reset-enable: false
|
|
|
+ ############ 以下是关闭多数据源时使用的默认数据源 ############
|
|
|
+ username: root
|
|
|
+ password: root
|
|
|
+ url: jdbc:mysql://127.0.0.1:3306/archives_sys?useUnicode=true&characterEncoding=utf-8&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC&zeroDateTimeBehavior=convertToNull
|
|
|
+ driver-class-name: com.mysql.jdbc.Driver
|
|
|
+ test-on-borrow: false
|
|
|
+ test-on-return: false
|
|
|
+ test-while-idle: true
|
|
|
+ validation-query: SELECT 1
|
|
|
+ async-init: false
|
|
|
+ name: system
|
|
|
+ filters: logback,log4j,wall,mergeStat
|
|
|
+ keep-alive: false
|
|
|
+ initial-size: 5
|
|
|
+ min-idle: 5
|
|
|
+ max-active: 20
|
|
|
+ time-between-eviction-runs-millis: 60000
|
|
|
+ min-evictable-idle-time-millis: 30000
|
|
|
|
|
|
+################## 数据源 配置 ##################
|
|
|
datasource:
|
|
|
sys:
|
|
|
- name: archives_sys
|
|
|
+ name: system
|
|
|
url: jdbc:mysql://192.168.1.124:3307/archives_sys?useUnicode=true&characterEncoding=utf-8&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC&zeroDateTimeBehavior=convertToNull
|
|
|
+ driver-class-name: com.mysql.jdbc.Driver
|
|
|
username: archives
|
|
|
password: archives
|
|
|
- testWhileIdle: true
|
|
|
- testOnBorrow: false
|
|
|
- testOnReturn: false
|
|
|
- validationQuery: SELECT 1
|
|
|
- asyncInit: false # 异步初始化
|
|
|
- filters: log4j,wall,mergeStat
|
|
|
- keepAlive: false
|
|
|
- driver-class-name: com.mysql.jdbc.Driver
|
|
|
- initialize: false #指定初始化数据源,是否用data.sql来初始化,默认: true
|
|
|
- initialSize: 5
|
|
|
- minIdle: 5
|
|
|
- maxActive: 20
|
|
|
- timeBetweenEvictionRunsMillis: 60000
|
|
|
- minEvictableIdleTimeMillis: 30000
|
|
|
+ test-on-borrow: false
|
|
|
+ test-on-return: false
|
|
|
+ test-while-idle: true
|
|
|
+ validation-query: SELECT 1
|
|
|
+ async-init: false
|
|
|
+ filters: logback,log4j,wall,mergeStat
|
|
|
+ keep-alive: false
|
|
|
+ initial-size: 5
|
|
|
+ min-idle: 5
|
|
|
+ max-active: 20
|
|
|
+ time-between-eviction-runs-millis: 60000
|
|
|
+ min-evictable-idle-time-millis: 30000
|
|
|
bus:
|
|
|
- name: archives_bus
|
|
|
+ name: business
|
|
|
url: jdbc:mysql://192.168.1.124:3307/archives_mgr?useUnicode=true&characterEncoding=utf-8&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC&zeroDateTimeBehavior=convertToNull
|
|
|
+ driver-class-name: com.mysql.jdbc.Driver
|
|
|
username: archives
|
|
|
password: archives
|
|
|
- testWhileIdle: true
|
|
|
- testOnBorrow: false
|
|
|
- testOnReturn: false
|
|
|
- validationQuery: SELECT 1
|
|
|
- asyncInit: false # 异步初始化
|
|
|
- filters: log4j,wall,mergeStat
|
|
|
- keepAlive: false
|
|
|
- driver-class-name: com.mysql.jdbc.Driver
|
|
|
- initialize: false #指定初始化数据源,是否用data.sql来初始化,默认: true
|
|
|
- initialSize: 5
|
|
|
- minIdle: 5
|
|
|
- maxActive: 20
|
|
|
- timeBetweenEvictionRunsMillis: 60000
|
|
|
- minEvictableIdleTimeMillis: 30000
|
|
|
+ test-on-borrow: false
|
|
|
+ test-on-return: false
|
|
|
+ test-while-idle: true
|
|
|
+ validation-query: SELECT 1
|
|
|
+ async-init: false
|
|
|
+ filters: logback,log4j,wall,mergeStat
|
|
|
+ keep-alive: false
|
|
|
+ initial-size: 5
|
|
|
+ min-idle: 5
|
|
|
+ max-active: 20
|
|
|
+ time-between-eviction-runs-millis: 60000
|
|
|
+ min-evictable-idle-time-millis: 30000
|
|
|
+
|
|
|
+################### mybatis-plus配置 ###################
|
|
|
+mybatis-plus:
|
|
|
+ mapper-locations: classpath*:mapping/**/*.xml
|
|
|
+ type-aliases-package: com.gxzc.zen.api.bus.mapper,com.gxzc.zen.api.sys.mapper
|
|
|
+ global-config:
|
|
|
+ id-type: 0 #0:数据库ID自增 1:用户输入id 2:全局唯一id(IdWorker) 3:全局唯一ID(uuid)
|
|
|
+ db-column-underline: true
|
|
|
+ refresh-mapper: true
|
|
|
+ # logic-delete-value: 0
|
|
|
+ # logic-not-delete-value: 1
|
|
|
+ sql-injector: com.baomidou.mybatisplus.mapper.LogicSqlInjector
|
|
|
+ meta-object-handler: com.gxzc.zen.orm.CustomMetaObjectHandler
|
|
|
+ configuration:
|
|
|
+ map-underscore-to-camel-case: true
|
|
|
+ cache-enabled: true #配置的缓存的全局开关
|
|
|
+ lazyLoadingEnabled: true #延时加载的开关
|
|
|
+ multipleResultSetsEnabled: true #延时加载一个属性时会加载该对象全部属性,否则按需加载属性
|
|
|
+ interceptors: com.baomidou.mybatisplus.plugins.OptimisticLockerInterceptor
|
|
|
+ # log-impl: org.apache.ibatis.logging.stdout.StdOutImpl #打印sql语句,调试用
|
|
|
+
|
|
|
|
|
|
##sharding-jdbc
|
|
|
#sharding:
|