ibatis mybatis传入List参数
生活随笔
收集整理的這篇文章主要介紹了
ibatis mybatis传入List参数
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
--ibatis
<select id="getWzlb" parameterClass="map" resultClass="java.util.HashMap"> select ... from wz09where 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>
?
轉載于:https://www.cnblogs.com/jamsbwo/p/5326576.html
總結
以上是生活随笔為你收集整理的ibatis mybatis传入List参数的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: PHP网络编程
- 下一篇: 在Linux下使用iconv转换字符串编