Loading

mysql 批量添加

insert into za_device_attribute (device_id,`key`,`value`,type) values
        <foreach collection="lierdaluxAtts" item="LierdaluxAtt" index="index" separator="," >
            (#{LierdaluxAtt.deviceId}, #{LierdaluxAtt.key}, #{LierdaluxAtt.value},#{LierdaluxAtt.type} )
        </foreach>
        ON DUPLICATE KEY UPDATE
        device_id=values (device_id),
        `key`=values (`key`),
        `value`=values (`value`),
        type=values(type)
posted @ 2019-11-15 14:29  mikemhm  阅读(117)  评论(0编辑  收藏  举报