mybatis中配置批量insert mysql,oracle 有時候需要傳入一個list(或集合),通過mybatis進行批量Insert的,語法如下: Mysql: 1 insert into TableName(F_ID,F_value) values 2 <foreach collection="list" item="lt" separator=","> 3 (#{lt.id},#{lt.value}) 4 </foreach> Oracle: 1 insert into TableName(F_ID,F_value) 2 <foreach collection="list" item="lt" separator="union all"> 3 select #{lt.id},#{lt.value} from dual 4 </foreach>