一、foreach标签
适用列表和数组
<foreach collection="传进的List名" index="index" item="id" open="(" separator="," close=")">
#{id}
</foreach>
<select id="*" parameterType="map" resultType="map">
SELECT * WHERE 条件1
<if test="传进的List名.size()>0">
AND 要查询的变量 IN
<foreach collection="传进的List名" index="index" item="id" open="(" separator=","
close=")">
#{id}
</foreach>
</if>
FROM 表名
</select>