<if test="pd.ids != null">
where a.DEPARTMENTAL_ID in
<foreach collection="pd.ids" index="index" item="item" open="(" separator="," close=")" >
#{pd.ids[${index}]}
</foreach>
where a.DEPARTMENTAL_ID in
<foreach collection="pd.ids" index="index" item="item" open="(" separator="," close=")" >
#{pd.ids[${index}]}
</foreach>
</if>
如果是对list的取值,则采用以上所示方法
即 使用index属性来获取