<?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.tofly.xrtygis.mapper.DmaStatisticalMapper">

    <resultMap id="dmaStatisticalMap" type="com.tofly.xrtygis.entity.DmaStatistical">
        <id property="id" column="ID"/>
        <result property="dmaId" column="DMA_ID"/>
        <result property="statisticalDate" column="STATISTICAL_DATE"/>
        <result property="billingWaterVolume" column="BILLING_WATER_VOLUME"/>
        <result property="freeWaterVolume" column="FREE_WATER_VOLUME"/>
        <result property="outflowWaterVolume" column="OUTFLOW_WATER_VOLUME"/>
        <result property="lossWaterVolume" column="LOSS_WATER_VOLUME"/>
        <result property="otherWaterVolume" column="OTHER_WATER_VOLUME"/>
        <result property="remoteWater" column="REMOTE_WATER"/>
        <result property="leakageRate" column="LEAKAGE_RATE"/>
        <result property="poorProductionRate" column="POOR_PRODUCTION_RATE"/>
        <result property="waterSupply" column="WATER_SUPPLY"/>
        <result property="userWater" column="USER_WATER"/>
        <result property="leakageOverVal" column="LEAKAGE_OVER_VAL"/>
        <result property="leakageVal" column="LEAKAGE_VAL"/>
        <result property="dnLengthVal" column="DN_LENGTH_VAL"/>
        <result property="yearPressureVal" column="YEAR_PRESSURE_VAL"/>
        <result property="totalPlanPipeLength" column="TOTAL_PLAN_PIPE_LENGTH"/>
        <result property="planTotalDistanceLength" column="PLAN_TOTAL_DISTANCE_LENGTH"/>
        <result property="measureVolume" column="MEASURE_VOLUME"/>
        <result property="notMeasureVolume" column="NOT_MEASURE_VOLUME"/>
        <result property="freeMeasureVolume" column="FREE_MEASURE_VOLUME"/>
        <result property="notFreeMeasureVolume" column="NOT_FREE_MEASURE_VOLUME"/>
        <result property="obviousOutflowVolume" column="OBVIOUS_OUTFLOW_VOLUME"/>
        <result property="darkOutflowVolume" column="DARK_OUTFLOW_VOLUME"/>
        <result property="backgroundOutflowVolume" column="BACKGROUND_OUTFLOW_VOLUME"/>
        <result property="otherOutflowVolume" column="OTHER_OUTFLOW_VOLUME"/>
        <result property="userLossVolume" column="USER_LOSS_VOLUME"/>
        <result property="notUserLossVolume" column="NOT_USER_LOSS_VOLUME"/>
    </resultMap>

<!--    <insert id="insertBatchTemp">-->
<!--        begin-->
<!--        <foreach collection="tempList" item="scada" index="index" separator=";">-->
<!--            insert into TF_DMA_STATISTICAL (-->
<!--                ID,-->
<!--                DMA_ID,-->
<!--                STATISTICAL_DATE,-->
<!--                BILLING_WATER_VOLUME,-->
<!--                FREE_WATER_VOLUME,-->
<!--                OUTFLOW_WATER_VOLUME,-->
<!--                LOSS_WATER_VOLUME,-->
<!--                OTHER_WATER_VOLUME,-->
<!--                REMOTE_WATER,-->
<!--                LEAKAGE_RATE,-->
<!--                POOR_PRODUCTION_RATE,-->
<!--                WATER_SUPPLY,-->
<!--                USER_WATER,-->
<!--                LEAKAGE_OVER_VAL,-->
<!--                LEAKAGE_VAL,-->
<!--                DN_LENGTH_VAL,-->
<!--                YEAR_PRESSURE_VAL,-->
<!--                TOTAL_PLAN_PIPE_LENGTH,-->
<!--                PLAN_TOTAL_DISTANCE_LENGTH,-->
<!--                MEASURE_VOLUME,-->
<!--                NOT_MEASURE_VOLUME,-->
<!--                FREE_MEASURE_VOLUME,-->
<!--                NOT_FREE_MEASURE_VOLUME,-->
<!--                OBVIOUS_OUTFLOW_VOLUME,-->
<!--                DARK_OUTFLOW_VOLUME,-->
<!--                BACKGROUND_OUTFLOW_VOLUME,-->
<!--                OTHER_OUTFLOW_VOLUME,-->
<!--                USER_LOSS_VOLUME,-->
<!--                NOT_USER_LOSS_VOLUME-->
<!--            ) values (-->
<!--                #{scada.id},-->
<!--                #{scada.dmaId},-->
<!--                #{scada.statisticalDate},-->
<!--                #{scada.billingWaterVolume},-->
<!--                #{scada.freeWaterVolume},-->
<!--                #{scada.outflowWaterVolume},-->
<!--                #{scada.lossWaterVolume},-->
<!--                #{scada.otherWaterVolume},-->
<!--                #{scada.remoteWater},-->
<!--                #{scada.leakageRate},-->
<!--                #{scada.poorProductionRate},-->
<!--                #{scada.waterSupply},-->
<!--                #{scada.userWater},-->
<!--                #{scada.leakageOverVal},-->
<!--                #{scada.leakageVal},-->
<!--                #{scada.dnLengthVal},-->
<!--                #{scada.yearPressureVal},-->
<!--                #{scada.totalPlanPipeLength},-->
<!--                #{scada.planTotalDistanceLength},-->
<!--                #{scada.measureVolume},-->
<!--                #{scada.notMeasureVolume},-->
<!--                #{scada.freeMeasureVolume},-->
<!--                #{scada.notFreeMeasureVolume},-->
<!--                #{scada.obviousOutflowVolume},-->
<!--                #{scada.darkOutflowVolume},-->
<!--                #{scada.backgroundOutflowVolume},-->
<!--                #{scada.otherOutflowVolume},-->
<!--                #{scada.userLossVolume},-->
<!--                #{scada.notUserLossVolume}-->
<!--            )-->
<!--        </foreach>-->
<!--        ;end;-->
<!--    </insert>-->

<!--    <delete id="deleteBatchTemp">-->
<!--        delete from TF_DMA_STATISTICAL where to_char(STATISTICAL_DATE, 'yyyy-mm') = #{month}-->
<!--    </delete>-->


</mapper>
