报错“Error evaluating expression ‘userId’. Return value (pic-bj) was not iterable.“
xml中用foreach的时候报这个错,疏忽了参数类型,用了String,应该用List或者数组的。
<foreach item="index" collection="ids" index="index" separator="or">
ID = ${index}
</foreach>
sql中in关键字的后面,参数个数最多为1000个,超过就报错。
用foreach也会报错,除非in后面加子查询,那样可以。
in的效率低,在代码中尽量减少in的使用。