1.insert
<1>mysql 的批量insert写法
<insert id=\”xxx\” parameterTpe=\”java.util.List\”>
insert into table_name(id,name) values
<foreach colletion=\”Collection_name\” item=\”item\” index=\”index\” separator = \”,\”>
(
#{item.id,jdbcType=varchar},#{itme.name,jdbcType=varchar}
)
</foreach>
<2>oracle 的批量insert写法
<insert id=\”xxx\” parameterType=\”java.util.List\”>
insert into table_name(id,name)
<foreach collection=\”collection_name\” item=\”item\” index=\”index\” separator=\”UNIO ALL\”
select #{item.id,jdbcType=varchar},#{itme.name,jdbcType=varchar}
from dual
</foreach>
</insert>