--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>
时间: 2024-11-06 21:24:45