Could not set parameters for mapping: ParameterMapping{property=‘xxx’
我的项目中此次报错出现是因为我传递的参数集合为空,导致sql中使用in和拼接条件时为空,出现此异常
List<Integer> idList = idList;
userMapper.selectByIdList(idList);
// idList为空,导致sql拼接出错
xml:
select * from user
<where>
and id in
<foreach collection="idList" item="id" index="index" separator="," close=")" open="(">
#{id}
</foreach>
</where>