application-orm.yml 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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.10:3306/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. ################### mybatis-plus配置 ###################
  40. mybatis-plus:
  41. mapper-locations: classpath*:mapping/**/*.xml
  42. type-aliases-package: com.gxzc.zen.api.sys.mapper
  43. global-config:
  44. id-type: 0 #0:数据库ID自增 1:用户输入id 2:全局唯一id(IdWorker) 3:全局唯一ID(uuid)
  45. db-column-underline: true
  46. refresh-mapper: true
  47. logic-delete-value: 0
  48. logic-not-delete-value: 1
  49. sql-injector: com.gxzc.zen.orm.sql.ZenSqlInjector # 自定义injector
  50. meta-object-handler: com.gxzc.zen.orm.CustomMetaObjectHandler
  51. configuration:
  52. map-underscore-to-camel-case: true
  53. cache-enabled: true #配置的缓存的全局开关
  54. lazyLoadingEnabled: true #延时加载的开关
  55. multipleResultSetsEnabled: true #延时加载一个属性时会加载该对象全部属性,否则按需加载属性
  56. interceptors: com.baomidou.mybatisplus.plugins.OptimisticLockerInterceptor, com.baomidou.mybatisplus.plugins.PaginationInterceptor
  57. # log-impl: org.apache.ibatis.logging.stdout.StdOutImpl #打印sql语句,调试用