解決Parameter xxxList not found Available parameters are [Collection,list]

執行批量插入的時候報:Parameter ‘xxxList’ not found. Available parameters are [Collection,list]
使用的是mybatis,傳進去的是list集合,期望批量插入,結果報語法問題,仔細檢查一下,發現,SQL中未使用foreach導致
應該在mapper.xml中加

<foreach collection="list" item="item" index="index"
			separator=",">
			#{item.id},
			#{item.name}
			</foreach>
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章