application-orm.yml 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. orm:
  2. multi-datasource-enable: false # 多数据源开关
  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. test-on-borrow: true
  14. test-on-return: false
  15. test-while-idle: true
  16. driver-class-name: com.mysql.jdbc.Driver
  17. username: archives
  18. password: archives
  19. 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
  20. ################## 数据源 配置 ##################
  21. ######## 单数据源使用sys作为默认数据源 ############
  22. datasource:
  23. sys:
  24. name: system
  25. 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
  26. driver-class-name: com.mysql.jdbc.Driver
  27. username: archives
  28. password: archives
  29. test-on-borrow: true
  30. test-on-return: false
  31. test-while-idle: true
  32. validation-query: SELECT 1
  33. async-init: false
  34. filters: log4j,wall,mergeStat
  35. keep-alive: false
  36. initial-size: 5
  37. min-idle: 5
  38. max-active: 20
  39. time-between-eviction-runs-millis: 60000
  40. min-evictable-idle-time-millis: 30000
  41. ################### mybatis-plus配置 ###################
  42. mybatis-plus:
  43. mapper-locations: classpath*:mapping/**/*.xml
  44. type-aliases-package: com.gxzc.zen.api.sys.mapper
  45. global-config:
  46. id-type: 0 #0:数据库ID自增 1:用户输入id 2:全局唯一id(IdWorker) 3:全局唯一ID(uuid)
  47. db-column-underline: true
  48. refresh-mapper: true
  49. logic-delete-value: 0
  50. logic-not-delete-value: 1
  51. sql-injector: com.gxzc.zen.orm.sql.ZenSqlInjector # 自定义injector
  52. meta-object-handler: com.gxzc.zen.orm.CustomMetaObjectHandler
  53. configuration:
  54. map-underscore-to-camel-case: true
  55. cache-enabled: true #配置的缓存的全局开关
  56. lazyLoadingEnabled: true #延时加载的开关
  57. multipleResultSetsEnabled: true #延时加载一个属性时会加载该对象全部属性,否则按需加载属性
  58. interceptors: com.baomidou.mybatisplus.plugins.OptimisticLockerInterceptor, com.baomidou.mybatisplus.plugins.PaginationInterceptor
  59. # log-impl: org.apache.ibatis.logging.stdout.StdOutImpl #打印sql语句,调试用