今天在写mybatis删除多个条目的时候出现了这个错误,传入的参数是一个集合,Mapper中是这样的:
<delete id="deleteBySelective">
DELETE FROM user
<where>
id in
<foreach item="item" collection="list" open="(" separator="," close=")">
(#{item})
</foreach>
</where>
</delete>
出现错误
:nested exception is org.apache.ibatis.binding.BindingException: Parameter ‘__frch_item_0’ not found
解决方案是把(#{item})换成${item}