<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.jxiop.api.mapper.HouseholdPvDeviceMapper">
	<insert id="insertAndUpdate">
		INSERT INTO household_pv_device
        (
        sequence_nbr, household_pv_id, name, brand,SN_code, model, power, serial_number,type,description,create_time,rec_date,rec_user_id,rec_user_name,is_delete) VALUES
		<foreach item="item" index="index" collection="list" separator=",">
            (
            #{item.sequenceNbr}, #{item.householdPvId}, #{item.name}, #{item.brand}, #{item.SNCode}, #{item.model},
            #{item.power}, #{item.serialNumber}, #{item.type}, #{item.description}, #{item.createTime}, #{item.recDate}, #{item.recUserId}, #{item.recUserName}, #{item.isDelete}
            )
        </foreach>
		ON DUPLICATE KEY UPDATE name = VALUES(name),brand = VALUES(brand),SN_code = VALUES(SN_code),model = VALUES(model),power = VALUES(power),serial_number = VALUES(serial_number)
        ,type = VALUES(type),description = VALUES(description),create_time = VALUES(create_time),rec_date = VALUES(rec_date),rec_user_id = VALUES(rec_user_id),rec_user_name = VALUES(rec_user_name)
	</insert>
</mapper>
 