1 resultType resultMap
1 当返回的字段跟bean 属性名一致的时候(能够通过反射自动转化成bean的时候),使用resultType
2 当返回的字段跟bean属性名对应不上的时候,就需要用resultMap
使用resultMap需要定义个 字段跟bean属性名的映射关系
<resultMap id="City" type="com.fangdd.zhiyezhe.dao.bean.City" >
<result property="cityId" column="city_id" jdbcType="VARCHAR"/>
<result property="cityName" column="city_name" jdbcType="VARCHAR"/>
</resultMap>