【批量】单表批量插入insert语句

 

xml

    <insert id="addMaterialQrTransferLog">
        insert into material_qr_transfer_log(
        qr_code,
        warehouse_code,
        transfer_time,
        user_no
        )values
        <foreach collection="materialQrTransferLogVo" item="qr" separator=",">
            (#{qr.qrCode},#{qr.warehouseCode},#{qr.transferTime},#{qr.userNo})
        </foreach>
    </insert>

 

mapper.java

 

 

 

serviceImpl.java

 

补充:insert的是一个  List<MaterialQrTransferLogVo> materialQrTransferLogVo

 

posted @ 2021-05-06 09:06  岁月尔尔  阅读(227)  评论(0编辑  收藏  举报