select * from table where id in (1,2,3)
where條件中帶in的都可以使用foreach標(biāo)簽
<select id="getTeachers" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from famous_teacher_recommend
where category in
<foreach collection="array" index="index" item="category" open="(" separator="," close=")">
#{category}
</foreach>
ORDER BY category
</select>