zoukankan      html  css  js  c++  java
  • mybatis 批量新增和修改

    <insert id="addAttrValueBatch">
        <if test="materialCustomerAttrPOS != null and materialCustomerAttrPOS.size>0">
            insert into
            material_customer_attr(core_id,attr_code,attr_value,create_time,create_user,update_time,update_user)
            values
            <foreach collection="materialCustomerAttrPOS" item="it" separator=",">
                (#{it.coreId},#{it.attrCode},#{it.attrValue},now(),#{userId},now(),#{userId})
            </foreach>
        </if>
    </insert>
    
    <update id="updateBatch">
        <foreach collection="coreAttrlist" item="bean" index="index" open="" close="" separator=";">
            UPDATE material_core_attr
            <set>
                name = #{bean.name},
                attach_file_ids = #{bean.attachFileIds},
                release_time = #{bean.releaseTime},
                update_time = now(),
                update_user = #{userId}
            </set>
            <where>
                id = #{bean.id}
            </where>
        </foreach>
    </update>
  • 相关阅读:
    Linux中的中断处理
    Yocto使用小技巧
    udev学习笔记汇总
    USB gadget学习笔记
    Linux常用命令
    Linux下软件安装方法
    278. First Bad Version
    MySQL的索引
    7. Reverse Integer
    排序算法
  • 原文地址:https://www.cnblogs.com/BobXie85/p/15555215.html
Copyright © 2011-2022 走看看