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>

 

posted @ 2021-04-01 16:30  魔杰Lee  阅读(2790)  评论(0编辑  收藏  举报