码迷,mamicode.com
首页 > 其他好文 > 详细

ibatis mybatis传入List参数

时间:2016-03-27 20:59:18      阅读:178      评论:0      收藏:0      [点我收藏+]

标签:

--ibatis
<select id="getWzlb"  parameterClass="map" resultClass="java.util.HashMap">  
        select ... from wz09
        where 1=1
    <isNotEmpty prepend="AND" property="ids"> <!-- ids是map的一个key -->
        id in  
            <iterate property="ids" open="(" conjunction="," close=")">  
                #ids[]#  
            </iterate>             
    </isNotEmpty>
</select>  

--mybatis
select id, city_id, owner_id  
  from item 
 where id in  
<foreach item="item" index="index" collection="list"  open="(" separator="," close=")">  
     #{item}  
</foreach>  
select r.id, r.info_id, r.item_id,    
  from rent_content r  
 where r.id NOT IN (SELECT rent_content_id FROM rent_calendar WHERE rent_content_id = r.id AND begin_time <#{endDate}  AND end_time > #{startDate})  
   and r.car_item_id in  
  <foreach item="item" index="index" collection="list"  open="(" separator="," close=")">  
       #{item}  
  </foreach> 

 

ibatis mybatis传入List参数

标签:

原文地址:http://www.cnblogs.com/jamsbwo/p/5326576.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!