MyBatis配置下划线自动转驼峰,避免手写resultMap去映射字段
1.application.yml 里加上
# MyBatis
mybatis:
configuration:
map-underscore-to-camel-case: true
2.如果使用单独的mybatis-config.xml 文件去配置,也就是application.yml里配置了
# 加载全局的配置文件
configLocation: classpath:mybatis/mybatis-config.xml
那么去找到mybatis-config.xml 文件,在<settings>标签内加入
<setting name="mapUnderscoreToCamelCase" value="true"/>
注意,若依的项目RuoYi(SpringBoot+Bootstrap)需要第二种方式去修改
下班记得打卡

浙公网安备 33010602011771号