mybatis 结果映射 collection oftype为string,integer等类型


<resultMap id="videoMap" type="com.yao.ivideo.model.dataobject.Obj">
  <result column="id" property="id"/>
  <collection   property="list" ofType="string">
    <result column="name"/>
  </collection>
</resultMap>
<select id="selectById"  resultMap="iMap">
  select
      id,name
  from
       t_table
  where id in
  <foreach collection="list" item="id" separator="," open="(" close=")">
    #{id}
  </foreach>
</select>

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM