(List)批量插入SQL模板

<insert id="batchInsert" parameterType="com.lifesea.model.FlowApplyFile" >
insert into flow_apply_file
<trim prefix="(" suffix=")" suffixOverrides="," >
APPLY_ID, FILE_TYPE, FILE_NAME, FILE_SIZE, FILE_PATH, FILE_HASH, `TYPE`, ADD_TIME,
ORDER_BY,
</trim>
values
<foreach collection="list" item="obj" index="index" separator="," >
(
#{obj.applyId,jdbcType=BIGINT},
#{obj.fileType,jdbcType=VARCHAR},
#{obj.fileName,jdbcType=VARCHAR},
#{obj.fileSize,jdbcType=VARCHAR},
#{obj.filePath,jdbcType=VARCHAR},
#{obj.fileHash,jdbcType=VARCHAR},
#{obj.type,jdbcType=VARCHAR},
#{obj.addTime,jdbcType=TIMESTAMP},
#{obj.orderBy,jdbcType=INTEGER})
</foreach>
</insert>

posted on 2018-06-13 13:19  走叉月月鸟飞  阅读(314)  评论(0编辑  收藏  举报

导航