mybatis接收数组参数foreach
接口参数
public Integer selectDefectCount(@Param("trainId") String trainId,@Param("pids") String[] pids);
XML文件
<if test="pids != null">
and defect.pid in
<foreach collection="pids" item="pid" open="(" separator="," close=")">
#{pid}
</foreach>
</if>

浙公网安备 33010602011771号