通过多个id查询信息:
传入的参数的int[] ids;
<foreach collection="ids" item="id" index="index" open="(" separator="," close=")">
#{id}
</foreach>
这样写是错误的,如果传入是数组,要写array,是集合就写list;改写成如下:
<foreach collection="array" item="id" index="index" open="(" separator="," close=")">
#{id}
</foreach>