application-orm.yml 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. orm:
  2. multi-datasource-enable: false # 多数据源开关
  3. ################## Alibaba Druid 配置 ##################
  4. spring:
  5. datasource:
  6. # type: com.alibaba.druid.pool.xa.DruidXADataSource
  7. druid:
  8. stat-view-servlet:
  9. enabled: true
  10. login-username: root
  11. login-password: root
  12. reset-enable: false
  13. jta:
  14. atomikos:
  15. properties:
  16. serial-jta-transactions: false
  17. enable-logging: false
  18. ################## 数据源 配置 ##################
  19. ######## 单数据源使用sys作为默认数据源 ############
  20. datasource:
  21. sys:
  22. name: system
  23. url: jdbc:mysql://192.168.1.92:30002/archives_sys?pinGlobalTxToPhysicalConnection=true&autoReconnect=true&useUnicode=true&characterEncoding=utf-8&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC&zeroDateTimeBehavior=convertToNull
  24. driver-class-name: com.mysql.jdbc.Driver
  25. username: archives
  26. password: archives
  27. test-on-borrow: true
  28. test-on-return: false
  29. test-while-idle: true
  30. validation-query: SELECT 1
  31. async-init: false
  32. filters: log4j,wall,mergeStat
  33. keep-alive: false
  34. initial-size: 5
  35. min-idle: 5
  36. max-active: 20
  37. time-between-eviction-runs-millis: 60000
  38. min-evictable-idle-time-millis: 30000
  39. bus:
  40. name: business
  41. url: jdbc:mysql://192.168.1.92:30002/archives_mgr?pinGlobalTxToPhysicalConnection=true&autoReconnect=true&useUnicode=true&characterEncoding=utf-8&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC&zeroDateTimeBehavior=convertToNull
  42. driver-class-name: com.mysql.jdbc.Driver
  43. username: archives
  44. password: archives
  45. test-on-borrow: true
  46. test-on-return: false
  47. test-while-idle: true
  48. validation-query: SELECT 1
  49. async-init: false
  50. filters: log4j,wall,mergeStat
  51. keep-alive: false
  52. initial-size: 5
  53. min-idle: 5
  54. max-active: 20
  55. time-between-eviction-runs-millis: 60000
  56. min-evictable-idle-time-millis: 30000
  57. shared:
  58. name: shared
  59. url: jdbc:mysql://192.168.1.92:30002/archives_shared?pinGlobalTxToPhysicalConnection=true&autoReconnect=true&useUnicode=true&characterEncoding=utf-8&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC&zeroDateTimeBehavior=convertToNull
  60. driver-class-name: com.mysql.jdbc.Driver
  61. username: archives
  62. password: archives
  63. test-on-borrow: true
  64. test-on-return: false
  65. test-while-idle: true
  66. validation-query: SELECT 1
  67. async-init: false
  68. filters: log4j,wall,mergeStat
  69. keep-alive: false
  70. initial-size: 5
  71. min-idle: 5
  72. max-active: 20
  73. time-between-eviction-runs-millis: 60000
  74. min-evictable-idle-time-millis: 30000
  75. ################### mybatis-plus配置 ###################
  76. mybatis-plus:
  77. mapper-locations: classpath*:mapping/**/*.xml
  78. type-aliases-package: com.gxzc.zen.api.bus.mapper,com.gxzc.zen.api.sys.mapper,com.gxzc.zen.api.shared.mapper
  79. global-config:
  80. id-type: 0 #0:数据库ID自增 1:用户输入id 2:全局唯一id(IdWorker) 3:全局唯一ID(uuid)
  81. db-column-underline: true
  82. refresh-mapper: true
  83. logic-delete-value: 0
  84. logic-not-delete-value: 1
  85. sql-injector: com.gxzc.zen.orm.sql.ZenSqlInjector # 自定义injector
  86. meta-object-handler: com.gxzc.zen.orm.CustomMetaObjectHandler
  87. configuration:
  88. map-underscore-to-camel-case: true
  89. cache-enabled: true #配置的缓存的全局开关
  90. lazyLoadingEnabled: true #延时加载的开关
  91. multipleResultSetsEnabled: true #延时加载一个属性时会加载该对象全部属性,否则按需加载属性
  92. interceptors: com.baomidou.mybatisplus.plugins.OptimisticLockerInterceptor, com.baomidou.mybatisplus.plugins.PaginationInterceptor
  93. # log-impl: org.apache.ibatis.logging.stdout.StdOutImpl #打印sql语句,调试用