<?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="cn.cecep.talroad.mapper.MonElecHourMapper">

    <insert id="insertMonElecHours">
        INSERT INTO mon_elec_hour (data_id,device_id,device_site_id,time_type,data_time,active_power,reactive_power,active_power_quantity,reactive_power_quantity,
                                   total_power,current_ap,current_bp,current_cp,current_single_phase,voltage_ap,voltage_bp,voltage_cp,create_time,
                                   device_site_name)
        VALUES
        <foreach collection="collection" item="item" separator=",">
            (
                #{item.dataId,jdbcType=VARCHAR}, #{item.deviceId,jdbcType=VARCHAR}, #{item.deviceSiteId,jdbcType=VARCHAR},
                #{item.timeType,jdbcType=CHAR}, #{item.dataTime,jdbcType=TIMESTAMP}, #{item.activePower,jdbcType=VARCHAR},
                #{item.reactivePower,jdbcType=VARCHAR}, #{item.activePowerQuantity,jdbcType=VARCHAR},
                #{item.reactivePowerQuantity,jdbcType=VARCHAR}, #{item.totalPower,jdbcType=VARCHAR},
                #{item.currentAp,jdbcType=VARCHAR}, #{item.currentBp,jdbcType=VARCHAR}, #{item.currentCp,jdbcType=VARCHAR},
                #{item.currentSinglePhase,jdbcType=VARCHAR}, #{item.voltageAp,jdbcType=VARCHAR},
                #{item.voltageBp,jdbcType=VARCHAR}, #{item.voltageCp,jdbcType=VARCHAR}, #{item.createTime,jdbcType=TIMESTAMP},
                #{item.deviceSiteName,jdbcType=VARCHAR}
            )
        </foreach>
    </insert>
</mapper>
