<?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.uml.tech.mapper.WeekMapper">


    <insert id="insertFromList">
        replace into ${tb_name} (did, alarm, averageCharge,
        averageChargeTime, averageElectricQuantity,
        averageEnergy, averageHistory, averageLinkStatus,
        averageMileage, averageRealtime, averageSpeed,
        averageTermin, averageTermout, charge,
        chargeTime, electricQuantity, energy,
        mileage, numSpeed, runDays,
        runTime, stopDays, sumSpeed,
        totalHistory, totalLinkStatus, totalMileage,
        totalRealtime, totalTermin, totalTermout, maxSpeed, cyclingTime, totalCyclingTime
        ) values
        <foreach collection="list" item="item" index="index" separator=",">
            (
            #{item.did},
            #{item.alarm},
            #{item.averageCharge},
            #{item.averageChargeTime},
            #{item.averageElectricQuantity},
            #{item.averageEnergy},
            #{item.averageHistory},
            #{item.averageLinkStatus},
            #{item.averageMileage},
            #{item.averageRealtime},
            #{item.averageSpeed},
            #{item.averageTermin},
            #{item.averageTermout},
            #{item.charge},
            #{item.chargeTime},
            #{item.electricQuantity},
            #{item.energy},
            #{item.mileage},
            #{item.numSpeed},
            #{item.runDays},
            #{item.runTime},
            #{item.stopDays},
            #{item.sumSpeed},
            #{item.totalHistory},
            #{item.totalLinkStatus},
            #{item.totalMileage},
            #{item.totalRealtime},
            #{item.totalTermin},
            #{item.totalTermout},
            #{item.maxSpeed},
            #{item.cyclingTime},
            #{item.totalCyclingTime}
            )
        </foreach>
    </insert>
    <select id="selectAll" resultType="com.uml.tech.bean.Week">
        select * from ${tb_name}
    </select>
</mapper>