application-orm.yml 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. orm:
  2. multi-datasource-enable: true # 多数据源开关
  3. ################## Alibaba Druid 配置 ##################
  4. spring:
  5. datasource:
  6. type: com.alibaba.druid.pool.DruidDataSource
  7. druid:
  8. stat-view-servlet:
  9. enabled: true
  10. login-username: root
  11. login-password: root
  12. reset-enable: false
  13. ############ 以下是关闭多数据源时使用的默认数据源 ############
  14. username: archives
  15. password: archives
  16. 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
  17. driver-class-name: com.mysql.jdbc.Driver
  18. test-on-borrow: false
  19. test-on-return: false
  20. test-while-idle: true
  21. validation-query: SELECT 1
  22. async-init: false
  23. name: system
  24. filters: logback,log4j,wall,mergeStat
  25. keep-alive: false
  26. initial-size: 5
  27. min-idle: 5
  28. max-active: 20
  29. time-between-eviction-runs-millis: 60000
  30. min-evictable-idle-time-millis: 30000
  31. ################## 数据源 配置 ##################
  32. datasource:
  33. sys:
  34. name: system
  35. 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
  36. driver-class-name: com.mysql.jdbc.Driver
  37. username: archives
  38. password: archives
  39. test-on-borrow: false
  40. test-on-return: false
  41. test-while-idle: true
  42. validation-query: SELECT 1
  43. async-init: false
  44. filters: logback,log4j,wall,mergeStat
  45. keep-alive: false
  46. initial-size: 5
  47. min-idle: 5
  48. max-active: 20
  49. time-between-eviction-runs-millis: 60000
  50. min-evictable-idle-time-millis: 30000
  51. bus:
  52. name: business
  53. 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
  54. driver-class-name: com.mysql.jdbc.Driver
  55. username: archives
  56. password: archives
  57. test-on-borrow: false
  58. test-on-return: false
  59. test-while-idle: true
  60. validation-query: SELECT 1
  61. async-init: false
  62. filters: logback,log4j,wall,mergeStat
  63. keep-alive: false
  64. initial-size: 5
  65. min-idle: 5
  66. max-active: 20
  67. time-between-eviction-runs-millis: 60000
  68. min-evictable-idle-time-millis: 30000
  69. ################### mybatis-plus配置 ###################
  70. mybatis-plus:
  71. mapper-locations: classpath*:mapping/**/*.xml
  72. type-aliases-package: com.gxzc.zen.api.bus.mapper,com.gxzc.zen.api.sys.mapper
  73. global-config:
  74. id-type: 0 #0:数据库ID自增 1:用户输入id 2:全局唯一id(IdWorker) 3:全局唯一ID(uuid)
  75. db-column-underline: true
  76. refresh-mapper: true
  77. # logic-delete-value: 0
  78. # logic-not-delete-value: 1
  79. sql-injector: com.baomidou.mybatisplus.mapper.LogicSqlInjector
  80. meta-object-handler: com.gxzc.zen.orm.CustomMetaObjectHandler
  81. configuration:
  82. map-underscore-to-camel-case: true
  83. cache-enabled: true #配置的缓存的全局开关
  84. lazyLoadingEnabled: true #延时加载的开关
  85. multipleResultSetsEnabled: true #延时加载一个属性时会加载该对象全部属性,否则按需加载属性
  86. interceptors: com.baomidou.mybatisplus.plugins.OptimisticLockerInterceptor
  87. # log-impl: org.apache.ibatis.logging.stdout.StdOutImpl #打印sql语句,调试用
  88. ##sharding-jdbc
  89. #sharding:
  90. # jdbc:
  91. # datasource:
  92. # names: ds_sys,ds_rec
  93. # ds_sys:
  94. # type: com.alibaba.druid.pool.DruidDataSource
  95. # driver-class-name: com.mysql.jdbc.Driver
  96. # 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
  97. # username: root
  98. # password: root
  99. # maxActive: 20
  100. # ds_rec:
  101. # type: com.alibaba.druid.pool.DruidDataSource
  102. # driver-class-name: com.mysql.jdbc.Driver
  103. # 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
  104. # username: root
  105. # password: root
  106. # maxActive: 20
  107. # config:
  108. # sharding:
  109. # tables:
  110. # sys_dept:
  111. # actualDataNodes: 'ds_sys
  112. # sys_dic:
  113. # sys_param: