第一种、sql语句起命名
select * from people where id = #{id}
改为
select LastName,id,sex where id =#{id}
第二种、在mybatis全局配置文件中开启驼峰命名
<configuration>
<settings>
<setting name="mapUnderscoreToCamelCase" value="true" />
</settings>
</configuration>
第三种、使用高级映射resulpMap
优点是可以重复利用,使用效率高
来源:oschina
链接:https://my.oschina.net/u/4115727/blog/4255561