123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118 |
- 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: archives
- password: archives
- 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
- 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: 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
- 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: 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
- 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:
- # jdbc:
- # datasource:
- # names: ds_sys,ds_rec
- # ds_sys:
- # type: com.alibaba.druid.pool.DruidDataSource
- # driver-class-name: com.mysql.jdbc.Driver
- # 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
- # username: root
- # password: root
- # maxActive: 20
- # ds_rec:
- # type: com.alibaba.druid.pool.DruidDataSource
- # driver-class-name: com.mysql.jdbc.Driver
- # url: jdbc:mysql://127.0.0.1:3306/archives_rec?useUnicode=true&characterEncoding=utf-8&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC&zeroDateTimeBehavior=convertToNull
- # username: root
- # password: root
- # maxActive: 20
- # config:
- # sharding:
- # tables:
- # sys_dept:
- # actualDataNodes: 'ds_sys
- # sys_dic:
- # sys_param:
|