<resultMap id="BaseResultMap" type="hashmap" >
<result column="PROJECT_ID" property="projectId" jdbcType="VARCHAR" />
<result column="PROJECT_NAME" property="projectName" jdbcType="VARCHAR"/>
</resultMap>
通过resultMap来映射(vo/hashmap)
< select id="querSyndicatedLoanList" resultMap="BaseResultMap" parameterType ="hashmap/com.xtkj.vo">
select project_id,project_name from tb_user
< /select>
通过别名来映射(vo/hashmap)
< select id="querSyndicatedLoanList" resultType="com.xtkj.vo/hashmap" parameterType="hashmap/com.xtkj.vo">
select project_id as projectId,project_name projectName from tb_user
< /select>
数据接收的可以用pojo类和HashMap来接收
pojo来接收 1,resultMap标签来映射;2.resuptType配合别名来映射
HashMap来接收 1,resultMap标签来映射;2.resultType直接映射;3.别名来映射
mybaitis的< select >标签中resultType和resultMap(两个都是映射接收结果)可以同时用在一起,默认优先使用resultType;