现象:有下划线的字段赋值失败。
1、application.yml开启驼峰映射
mybatis:
configuration:
map-underscore-to-camel-case: true #版本不同,对应的配置项可能不同
2、自定义SQLSessionFactory
try {
bean.getObject().getConfiguration().setMapUnderscoreToCamelCase(true);
return bean.getObject();
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException(e);
}