<selectid="selectM"parameterType="java.lang.String"resultType="com.leilankeji.cn.dao.User">
select * from t_user where user_name =#{username}
</select>
使用resultMap当结果集,这样与驼峰规则就没有关系了,resultMap里怎么配,就怎么对应
<resultMapid="BaseResultMap"type="com.cn.dao.User"><!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
--><idcolumn="user_name"jdbcType="VARCHAR"property="userName"/><resultcolumn="password"jdbcType="VARCHAR"property="password"/><resultcolumn="name"jdbcType="VARCHAR"property="name"/><resultcolumn="phone_number"jdbcType="CHAR"property="phoneNumber"/><resultcolumn="email"jdbcType="VARCHAR"property="email"/><resultcolumn="status"jdbcType="INTEGER"property="status"/><resultcolumn="role_id"jdbcType="INTEGER"property="roleId"/><resultcolumn="create_time"jdbcType="TIMESTAMP"property="createTime"/><resultcolumn="update_time"jdbcType="TIMESTAMP"property="updateTime"/></resultMap>
<selectid="selectM"parameterType="java.lang.String"resultMap="BaseResultMap">
select * from t_user where user_name =#{username}
</select>