mapper层
dept selectByDepeIds ( @Param("deptIds") List deptIds);
xml
<select id="selectByDepeIds" resultType="dept">
SELECT * from dept
<if test="deptIds!=null and deptIds.size()> 0">
WHERE deptId in
<foreach item="item" index="index" collection="deptIds" open="(" separator="," close=" )">
#{item}
</foreach>
</if>
</select>
```
```