【批量】单表批量更新语句

 

xml

<update id="updateMaterialQrList" parameterType="java.util.List">
        <foreach collection="materialQrList" item="p" index="index" open="" close="" separator=";">
            update ${materialQrTable}
            <set>
                material_doc = #{p.materialDoc},
                material_docYear = #{p.materialDocYear},
                storage_type = #{p.storageType}
            </set>
            where
            qr_code = #{p.qrCode}
        </foreach>
    </update>

 

mapper.java

 

serviceImpl.java

 

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