resultMap
数据库字段和pojo属性不一致
<!--方式一:通过字段别名匹配pojo属性-->
<!--<select id="getRoleList" resultType="com.qiaob.pojo.Role">-->
<!--select role_id as roleID,role_name as roleName from mybatis.role-->
<!--</select>-->
<!--方式二:通过resultMap-->
<resultMap id="roleMap" type="com.qiaob.pojo.Role">
<result property="roleID" column="role_id"></result>
<result property="roleName" column="role_name"></result>
</resultMap>
<select id="getRoleList" resultMap="roleMap">
select * from mybatis.role
</select>