This error parameter ' __frch_item_0 ' not found when MyBatis used a foreach. Several solutions for Available parameters are [list]
Example
<insert id= "insertbatchpicattachment" parametertype= "java.util.List" > INSERT INTO Pic_attachment (pic_id,pic_udid,relate_id, Relate_code,relate_code_dtl,pic_name,pic_url,pic_remote_url) values <foreach collection= "list" item= "item" index= "index" separator= "," > (#{item.picid},#{item.picudid},#{item.relateid},#{item.relatecode},#{ Item.relatecodedtl},#{item.picname},#{item.picurl},#{item.picremoteurl}) </ foreach> <selectkey resulttype= "Java.lang.Integer" order= "
After "keyproperty=" Picid "> select last_insert_id (); </selectKey> </insert>
1. View the type of parametertype is not the java.util.List type, and if so, look at the collection property of foreach is not list,
Because passing a List instance or an array to Mybatis,mybatis as a parameter object is automatically wrapped in a Map, the name is used as the key. The list instance will be "list" as the key, and the array instance will be "array" as the key
2. See if the values in foreach are passed in.
3. See if the Name field in the foreach is incorrectly written
4. There is the time when I use the MyBatis, the value of MySQL inserted automatic growth value, the key inside I did not set up in the database automatic growth, and then I used the selectkey, so it will also occur
There should be other mistakes that could lead to this mistake. But I only met these kinds of. So make a summary.