解决方法:
1.写sql语句时起别名
2.在Myatis的全局配置文件中开启驼峰命名规则
<!-- 开启自动驼峰命名规则(camel case)映射 -->
<setting name="mapUnderscoreToCamelCase" value="true"/>
如果使用的是springboot则可以在配置文件中添加以下配置:
mybatis-plus.configuration.map-underscore-to-camel-case=true
3.在Mapper映射文件中使用resultMap来自定义映射规则