1. 程式人生 > >nested exception is org.apache.ibatis.binding.BindingException: Parameter '__frch_item_0' not found

nested exception is org.apache.ibatis.binding.BindingException: Parameter '__frch_item_0' not found

今天在寫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}