时间:2021-07-01 10:21:17 帮助过:11人阅读
<insert id="inserData" parameterType="com.test.aaa.Bac">
insert into table_name (name, adress, age)
values
<foreach collection="list" item="item" index="index" separator="union all">
(select #{item.name},
#{item.adress},
#{item.age}
from dual )
<foreach>
</insert>
<insert id="inserData" parameterType="com.test.aaa.Bac">
insert into table_name (name, adress, age)
values
<foreach collection="list" item="item" index="index" separator=",">
( #{item.name}, #{item.adress}, #{item.age} )
<foreach>
</insert>
mybatis foreach批量插入数据:Oracle与MySQL区别
标签:adr log ram union 设置 test 分割 col int