mybatis使用mysql数据库批量插入xml配置
程序员文章站
2022-05-29 16:46:48
...
<insert id="insertBatch" parameterType="list"> insert into trait (trait_id, trait_en, trait_cn, gene_num, marker_num, remark, source,gmt_create, gmt_update ) values <foreach collection="list" item="item" separator=","> ( #{item.traitId,jdbcType=VARCHAR}, #{item.traitEn,jdbcType=VARCHAR}, #{item.traitCn,jdbcType=VARCHAR}, #{item.geneNum,jdbcType=INTEGER}, #{item.markerNum,jdbcType=INTEGER}, #{item.remark,jdbcType=VARCHAR},#{item.source,jdbcType=VARCHAR}, now(), now() ) </foreach> </insert>
上一篇: 开始学习Vue.js