<!--因为类中sex属性类型为boolean,表中为int,类型不一致,所以使用resultType--><selectid="queryPersonById"resultMap="resultType"parameterType="int">
select * from person where id = #{id}
</select><resultMapid="resultType"type="person"><idproperty="id"column="id"/><resultproperty="age"column="age"/><resultproperty="name"column="name"/><resultproperty="sex"column="sex"jdbcType="INTEGER"javaType="boolean"/></resultMap>