1、oracle批量添加
insert into CRITERION_CODE_INSPECT (ID, CRITERION_CODE, CRITERION_NAME,
CRITERION_NAME_INSPECT, FILE_ID, FILE_NAME
)
<foreach collection="list" item="item" index="index" separator="union all">
select #{item.id,jdbcType=DECIMAL}, #{item.criterionCode,jdbcType=VARCHAR}, #{item.criterionName,jdbcType=VARCHAR},
#{item.criterionNameInspect,jdbcType=VARCHAR}, #{item.fileId,jdbcType=DECIMAL}, #{fileName,jdbcType=VARCHAR}
from dual
</foreach>

2、mysql批量添加
insert into inquiry_part
(part_id, insure_part_id, inquiry_id,third_inquiry_id,part_name,
part_code, part_quality, img_url,
create_time, last_time, abled,remark
) values
<foreach collection="list" item="item" separator=",">
(#{item.partId,jdbcType=BIGINT}, #{item.insurePartId,jdbcType=BIGINT},
#{item.inquiryId,jdbcType=BIGINT},#{item.thirdInquiryId,jdbcType=BIGINT},#{item.partName,jdbcType=VARCHAR},
#{item.partCode,jdbcType=VARCHAR}, #{item.partQuality,jdbcType=VARCHAR}, #{item.imgUrl,jdbcType=VARCHAR},
#{item.createTime,jdbcType=TIMESTAMP}, #{item.lastTime,jdbcType=TIMESTAMP}, #{item.abled,jdbcType=INTEGER},
#{item.remark,jdbcType=VARCHAR}
)
</foreach>

posted on 2021-03-04 09:08  lazyli  阅读(72)  评论(0编辑  收藏  举报