系统兼容多种数据库,执行的sql有差异时,需增加配置

原因:

  系统集成了mysql、达梦、kingbase、influxdb等

  当执行同一条sql时,各数据库执行脚本不一致,例如

 mysql :  select id,name,'percision'(关键字)  from xxxx;

 达梦:select id,name,percision from xxxx;

 kingbase:select id,name,“percision”(关键字)  from xxxx;

 

 

增加数据库sql正则配置

# mybatis-plus配置,使用classpath*解决多模块分散mapper文件无法映射问题
mybatis-plus:
  mapper-locations: classpath*:mapper/${dbMapperType}/*.xml
  global-config: 
  #db-config格式化sql字段,解决mybatiesplus兼容多数据库下关键字报错问题,配合keepGlobalFormat=true使用,如@TableField(value = "LEVEL", keepGlobalFormat = true)
    db-config:
      #kingbase、dm配置
      column-format: "\"%s\""
      #mysql配置
      #column-format: "`%s`"

 

posted @ 2024-04-02 17:36  大日很忧伤  阅读(5)  评论(0编辑  收藏  举报