原来代码
<insert id="insert" parameterType="com.util.List" useGeneratedKeys="false">
insert into sys_ceshi
(code,name)
values
<foreach item = "item" collection="List" separator=",">
(
#{item.code},
#{item.name}
)
</foreach>
</insert>
修改后代码(这代码有点意思,哈哈)
<insert id="insert" parameterType="com.util.List" useGeneratedKeys="false">
insert into sys_ceshi
(code,name)
<foreach item = "item" collection="List" separator="UNION ALL">
select
#{item.code},
#{item.name}
from dual
</foreach>
</insert>