Mybatis 查询结果是Map,Map中又有List集合的方法

//----------------------------------------------------------------------18-10-19编辑-------------------------------------------------------------------------------

开发过程中发现这个方法,不能返回简历的ID,即resId,想要获取需要再写一个:res.id resid ,不知道是什么原因。谁知道可以回复一下。

//---------------------------------------------------------------------------------------------------------------------------------------------------------------------- 

<!--
 项目中需要查询简历详情信息,简历中包含工作经验和教育经历,这都是集合,查询结果使用ModelMap接收,
 建立详情映射结果 
-->
<resultMap id="ResumeInfoMap" type="org.springframework.ui.ModelMap">
   <collection property="userJobExps" column="resId" select="userJobExps"></collection>
   <collection property="userEduExps" column="resId" select="userEduExps"></collection>
</resultMap>
<!-- 简历详情 -->
<select id="getResumeByID" parameterType="int" resultMap="ResumeInfoMap">
     select res.id resId,res.truename trueName,res.sex sex,res.mobile mobile,res.email email,
     res.birthday birthday,res.education edu,res.exp_year years,res.wish_job wishJob,
     res.wish_wage wishWage,res.selfintroduction selfDesc
     from tb_user_resume res
     where res.id = #{resId}
</select>
<!-- 工作经验 -->
<select id="userJobExps" parameterType="int" resultType="org.springframework.ui.ModelMap">
   select exp.begin_date beginDate,exp.end_date endDate,exp.mac_nm mchName,
     exp.major_nm major
     from tb_user_exp exp
     where exp.resume_id=#{resId} and exp.exp_type=2
     order by exp.begin_date desc
</select>
<!-- 教育经历 -->
<select id="userEduExps" parameterType="int" resultType="org.springframework.ui.ModelMap">
   select exp.begin_date beginDate,exp.end_date endDate,exp.mac_nm mchName,
     exp.major_nm major
     from tb_user_exp exp
     where exp.resume_id=#{resId} and exp.exp_type=2
     order by exp.begin_date desc
</select>

 

  • 1
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值