lamp:
  sqlserver: &db-sqlserver
    username: 'sa'
    password: '1234@abcd'
    # driverClassName: com.microsoft.sqlserver.jdbc.SQLServerDriver
    # url: jdbc:sqlserver://172.26.3.67:1433;DatabaseName=lamp_none
    driverClassName: com.p6spy.engine.spy.P6SpyDriver
    url: jdbc:p6spy:sqlserver://172.26.3.67:1433;DatabaseName=lamp_none
    db-type: sqlserver    
    validation-query: SELECT 'x'  
    filters: stat,wall
    init: 
      separator: GO
  database: # 字段介绍参考 DatabaseProperties
    multiTenantType: NONE

    # 是否启用数据权限
    isDataScope: true
    # 是否启用  sql性能规范插件
    isBlockAttack: false
    # 是否启用  sql性能规范插件
    isIllegalSql: false
    # 是否启用分布式事务
    isSeata: false
    # 生产环境请设置p6spy = false
    p6spy: true
    # 单页分页条数限制
    maxLimit: -1
    # 溢出总页数后是否进行处理
    overflow: true
    # 生成 countSql 优化掉 join, 现在只支持 left join
    optimizeJoin: true
    # id生成策略
    id-type: CACHE
    hutoolId:
      workerId: 0
      dataCenterId: 0
    cache-id:
      time-bits: 31
      worker-bits: 22
      seq-bits: 10
      epochStr: '2020-09-15'
      boost-power: 3
      padding-factor: 50

# mysql 通用配置
spring:
  autoconfigure:
    exclude: org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration
  datasource:
    dynamic:
      enabled: false
    druid:
      enable: true
      <<: *db-sqlserver
      initialSize: 10
      minIdle: 10
      maxActive: 200
      max-wait: 60000
      pool-prepared-statements: true
      max-pool-prepared-statement-per-connection-size: 20
      test-on-borrow: true
      test-on-return: false
      test-while-idle: true
      time-between-eviction-runs-millis: 60000  #配置间隔多久才进行一次检测，检测需要关闭的空闲连接，单位是毫秒
      min-evictable-idle-time-millis: 300000    #配置一个连接在池中最小生存的时间，单位是毫秒
      filter:
        wall:
          enabled: true
          config:
            strictSyntaxCheck: false
            commentAllow: true
            multiStatementAllow: true
            noneBaseStatementAllow: true
        slf4j:
          enabled: false   # 使用slf4j打印可执行日志时，改成true
          statement-executable-sql-log-enable: true

      # 从这里结束(druid)，中间的这段配置用于 lamp.database.multiTenantType != DATASOURCE 时
      
      # 以下的2段配置，同时适用于所有模式
      web-stat-filter:  # WebStatFilter配置，说明请参考Druid Wiki，配置_配置WebStatFilter
        enabled: true
        url-pattern: /*
        exclusions: "*.js , *.gif ,*.jpg ,*.png ,*.css ,*.ico , /druid/*"
        session-stat-max-count: 1000
        profile-enable: true
        session-stat-enable: false
      stat-view-servlet:  #展示Druid的统计信息,StatViewServlet的用途包括：1.提供监控信息展示的html页面2.提供监控信息的JSON API
        enabled: true
        url-pattern: /druid/*   #根据配置中的url-pattern来访问内置监控页面，如果是上面的配置，内置监控页面的首页是/druid/index.html例如：http://127.0.0.1:9000/druid/index.html
        reset-enable: true    #允许清空统计数据
        login-username: ''
        login-password: ''
        allow: ''

mybatis-plus:
  mapper-locations:
    - classpath*:mapper_**/**/*Mapper.xml
  #实体扫描，多个package用逗号或者分号分隔
  typeAliasesPackage: top.tangyh.lamp.*.entity;top.tangyh.basic.database.mybatis.typehandler
  typeEnumsPackage: top.tangyh.lamp.*.enumeration
  global-config:
    db-config:
      id-type: INPUT
      insert-strategy: NOT_NULL
      update-strategy: NOT_NULL
      where-strategy: NOT_EMPTY
  configuration:
    #配置返回数据库(column下划线命名&&返回java实体是驼峰命名)，自动匹配无需as（没开启这个，SQL需要写as： select user_id as userId）
    map-underscore-to-camel-case: true
    cache-enabled: false
    #配置JdbcTypeForNull, oracle数据库必须配置
    jdbc-type-for-null: 'null'
    default-enum-type-handler: top.tangyh.basic.database.mybatis.handlers.MybatisEnumTypeHandler
