MyBatis批量插入数据(MySql)
<insert id ="insertCodeBatch" parameterType="java.util.List" >
insert into redeem_code
(bach_id, code, type, facevalue,create_user,create_time)
values
<foreach collection ="list" item="reddemCode" index= "index" separator =",">
(
#{reddemCode.batchId}, #{reddemCode.code},
#{reddemCode.type},
#{reddemCode.facevalue},
#{reddemCode.createUser}, #{reddemCode.createTime}
)
</foreach >
</insert >
网友评论