<!-- 用户信息综合查询总数 --><selectid="findUserCount"parameterType="UserQueryVo"resultType="int">
select count(*) from userdb where userdb.user_sex=#{userCustom.user_sex} and userdb.user_name like '%${userCustom.user_name}%'
</select>
<!--
type 映射类型 user别名
id resultMap标识
--><resultMaptype="user"id="UserResultMap"><!-- id表示查询结果集中的唯一标识
column表示书写的列名
property表示pojo属性名
最终resultMap对column和property做一个映射关系
--><idcolumn="id_"property="id"/><!--
result表示对普通结果类型的定义
column表示书写的列名
property表示pojo属性名
最终resultMap对column和property做一个映射关系
--><resultcolumn="sex_"property="user_sex"/></resultMap>
2.2使用resultMap作为statement的输出映射类型
<!-- 使用resultMap作为输出映射结果类型
如果这个resultMap在别的mapper.xml里应该加上那个mapper.xml的namespace
--><selectid="findUserByIdResultMap"parameterType="int"resultMap="UserResultMap">
SELECT id id_,user_sex sex_ FROM USERDB WHERE id = #{id}
</select>