<?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.njcn.harmonic.mapper.RMpMeasureReportDMapper">

    <resultMap id="BaseResultMap" type="com.njcn.harmonic.pojo.po.RMpMeasureReportD">
            <id property="measurementPointId" column="measurement_point_id" jdbcType="VARCHAR"/>
            <id property="dataDate" column="data_date" jdbcType="DATE"/>
            <result property="frequencyMax" column="frequency_max" jdbcType="FLOAT"/>
            <result property="frequencyMin" column="frequency_min" jdbcType="FLOAT"/>
            <result property="frequencyAvg" column="frequency_avg" jdbcType="FLOAT"/>
            <result property="frequency95" column="frequency_95" jdbcType="FLOAT"/>
            <result property="frequencyDeviationMax" column="frequency_deviation_max" jdbcType="FLOAT"/>
            <result property="frequencyDeviationMin" column="frequency_deviation_min" jdbcType="FLOAT"/>
            <result property="frequencyDeviationAvg" column="frequency_deviation_avg" jdbcType="FLOAT"/>
            <result property="frequencyDeviation95" column="frequency_deviation_95" jdbcType="FLOAT"/>
            <result property="totalActivePowerMax" column="total_active_power_max" jdbcType="FLOAT"/>
            <result property="totalActivePowerMin" column="total_active_power_min" jdbcType="FLOAT"/>
            <result property="totalActivePowerAvg" column="total_active_power_avg" jdbcType="FLOAT"/>
            <result property="totalActivePower95" column="total_active_power_95" jdbcType="FLOAT"/>
            <result property="totalReactivePowerMax" column="total_reactive_power_max" jdbcType="FLOAT"/>
            <result property="totalReactivePowerMin" column="total_reactive_power_min" jdbcType="FLOAT"/>
            <result property="totalReactivePowerAvg" column="total_reactive_power_avg" jdbcType="FLOAT"/>
            <result property="totalReactivePower95" column="total_reactive_power_95" jdbcType="FLOAT"/>
            <result property="totalApparentPowerMax" column="total_apparent_power_max" jdbcType="FLOAT"/>
            <result property="totalApparentPowerMin" column="total_apparent_power_min" jdbcType="FLOAT"/>
            <result property="totalApparentPowerAvg" column="total_apparent_power_avg" jdbcType="FLOAT"/>
            <result property="totalApparentPower95" column="total_apparent_power_95" jdbcType="FLOAT"/>
            <result property="tpPowerFactorMax" column="tp_power_factor_max" jdbcType="FLOAT"/>
            <result property="tpPowerFactorMin" column="tp_power_factor_min" jdbcType="FLOAT"/>
            <result property="tpPowerFactorAvg" column="tp_power_factor_avg" jdbcType="FLOAT"/>
            <result property="tpPowerFactor95" column="tp_power_factor_95" jdbcType="FLOAT"/>
            <result property="fundamentalPowerFactorMax" column="fundamental_power_factor_max" jdbcType="FLOAT"/>
            <result property="fundamentalPowerFactorMin" column="fundamental_power_factor_min" jdbcType="FLOAT"/>
            <result property="fundamentalPowerFactorAvg" column="fundamental_power_factor_avg" jdbcType="FLOAT"/>
            <result property="fundamentalPowerFactor95" column="fundamental_power_factor_95" jdbcType="FLOAT"/>
            <result property="positiveSequenceVoltageMax" column="positive_sequence_voltage_max" jdbcType="FLOAT"/>
            <result property="positiveSequenceVoltageMin" column="positive_sequence_voltage_min" jdbcType="FLOAT"/>
            <result property="positiveSequenceVoltageAvg" column="positive_sequence_voltage_avg" jdbcType="FLOAT"/>
            <result property="positiveSequenceVoltage95" column="positive_sequence_voltage_95" jdbcType="FLOAT"/>
            <result property="negativeSequenceVoltageMax" column="negative_sequence_voltage_max" jdbcType="FLOAT"/>
            <result property="negativeSequenceVoltageMin" column="negative_sequence_voltage_min" jdbcType="FLOAT"/>
            <result property="negativeSequenceVoltageAvg" column="negative_sequence_voltage_avg" jdbcType="FLOAT"/>
            <result property="negativeSequenceVoltage95" column="negative_sequence_voltage_95" jdbcType="FLOAT"/>
            <result property="zeroSequenceVoltageMax" column="zero_sequence_voltage_max" jdbcType="FLOAT"/>
            <result property="zeroSequenceVoltageMin" column="zero_sequence_voltage_min" jdbcType="FLOAT"/>
            <result property="zeroSequenceVoltageAvg" column="zero_sequence_voltage_avg" jdbcType="FLOAT"/>
            <result property="zeroSequenceVoltage95" column="zero_sequence_voltage_95" jdbcType="FLOAT"/>
            <result property="negativeSequenceVoltageUnbalanceMax" column="negative_sequence_voltage_unbalance_max" jdbcType="FLOAT"/>
            <result property="negativeSequenceVoltageUnbalanceMin" column="negative_sequence_voltage_unbalance_min" jdbcType="FLOAT"/>
            <result property="negativeSequenceVoltageUnbalanceAvg" column="negative_sequence_voltage_unbalance_avg" jdbcType="FLOAT"/>
            <result property="negativeSequenceVoltageUnbalance95" column="negative_sequence_voltage_unbalance_95" jdbcType="FLOAT"/>
            <result property="zeroSequenceVoltageUnbalanceMax" column="zero_sequence_voltage_unbalance_max" jdbcType="FLOAT"/>
            <result property="zeroSequenceVoltageUnbalanceMin" column="zero_sequence_voltage_unbalance_min" jdbcType="FLOAT"/>
            <result property="zeroSequenceVoltageUnbalanceAvg" column="zero_sequence_voltage_unbalance_avg" jdbcType="FLOAT"/>
            <result property="zeroSequenceVoltageUnbalance95" column="zero_sequence_voltage_unbalance_95" jdbcType="FLOAT"/>
            <result property="positiveSequenceCurrentMax" column="positive_sequence_current_max" jdbcType="FLOAT"/>
            <result property="positiveSequenceCurrentMin" column="positive_sequence_current_min" jdbcType="FLOAT"/>
            <result property="positiveSequenceCurrentAvg" column="positive_sequence_current_avg" jdbcType="FLOAT"/>
            <result property="positiveSequenceCurrent95" column="positive_sequence_current_95" jdbcType="FLOAT"/>
            <result property="negativeSequenceCurrentMax" column="negative_sequence_current_max" jdbcType="FLOAT"/>
            <result property="negativeSequenceCurrentMin" column="negative_sequence_current_min" jdbcType="FLOAT"/>
            <result property="negativeSequenceCurrentAvg" column="negative_sequence_current_avg" jdbcType="FLOAT"/>
            <result property="negativeSequenceCurrent95" column="negative_sequence_current_95" jdbcType="FLOAT"/>
            <result property="zeroSequenceCurrentMax" column="zero_sequence_current_max" jdbcType="FLOAT"/>
            <result property="zeroSequenceCurrentMin" column="zero_sequence_current_min" jdbcType="FLOAT"/>
            <result property="zeroSequenceCurrentAvg" column="zero_sequence_current_avg" jdbcType="FLOAT"/>
            <result property="zeroSequenceCurrent95" column="zero_sequence_current_95" jdbcType="FLOAT"/>
            <result property="negativeSequenceCurrentUnbalanceMax" column="negative_sequence_current_unbalance_max" jdbcType="FLOAT"/>
            <result property="negativeSequenceCurrentUnbalanceMin" column="negative_sequence_current_unbalance_min" jdbcType="FLOAT"/>
            <result property="negativeSequenceCurrentUnbalanceAvg" column="negative_sequence_current_unbalance_avg" jdbcType="FLOAT"/>
            <result property="negativeSequenceCurrentUnbalance95" column="negative_sequence_current_unbalance_95" jdbcType="FLOAT"/>
            <result property="zeroSequenceCurrentImbalanceMax" column="zero_sequence_current_imbalance_max" jdbcType="FLOAT"/>
            <result property="zeroSequenceCurrentImbalanceMin" column="zero_sequence_current_imbalance_min" jdbcType="FLOAT"/>
            <result property="zeroSequenceCurrentImbalanceAvg" column="zero_sequence_current_imbalance_avg" jdbcType="FLOAT"/>
            <result property="zeroSequenceCurrentImbalance95" column="zero_sequence_current_imbalance_95" jdbcType="FLOAT"/>
            <result property="equivalentApparentPowerMax" column="equivalent_apparent_power_max" jdbcType="FLOAT"/>
            <result property="equivalentApparentPowerMin" column="equivalent_apparent_power_min" jdbcType="FLOAT"/>
            <result property="equivalentApparentPowerAvg" column="equivalent_apparent_power_avg" jdbcType="FLOAT"/>
            <result property="equivalentApparentPower95" column="equivalent_apparent_power_95" jdbcType="FLOAT"/>
            <result property="equivalentPowerFactorMax" column="equivalent_power_factor_max" jdbcType="FLOAT"/>
            <result property="equivalentPowerFactorMin" column="equivalent_power_factor_min" jdbcType="FLOAT"/>
            <result property="equivalentPowerFactorAvg" column="equivalent_power_factor_avg" jdbcType="FLOAT"/>
            <result property="equivalentPowerFactor95" column="equivalent_power_factor_95" jdbcType="FLOAT"/>
            <result property="fundamentalWaveRateoMax" column="fundamental_wave_rateo_max" jdbcType="FLOAT"/>
            <result property="fundamentalWaveRateoMin" column="fundamental_wave_rateo_min" jdbcType="FLOAT"/>
            <result property="fundamentalWaveRateoAvg" column="fundamental_wave_rateo_avg" jdbcType="FLOAT"/>
            <result property="fundamentalWaveRateo95" column="fundamental_wave_rateo_95" jdbcType="FLOAT"/>
            <result property="fundamentalWaveApparentMax" column="fundamental_wave_apparent_max" jdbcType="FLOAT"/>
            <result property="fundamentalWaveApparentMin" column="fundamental_wave_apparent_min" jdbcType="FLOAT"/>
            <result property="fundamentalWaveApparentAvg" column="fundamental_wave_apparent_avg" jdbcType="FLOAT"/>
            <result property="fundamentalWaveApparent95" column="fundamental_wave_apparent_95" jdbcType="FLOAT"/>
            <result property="nonfundamentalWaveRateoMax" column="nonfundamental_wave_rateo_max" jdbcType="FLOAT"/>
            <result property="nonfundamentalWaveRateoMin" column="nonfundamental_wave_rateo_min" jdbcType="FLOAT"/>
            <result property="nonfundamentalWaveRateoAvg" column="nonfundamental_wave_rateo_avg" jdbcType="FLOAT"/>
            <result property="nonfundamentalWaveRateo95" column="nonfundamental_wave_rateo_95" jdbcType="FLOAT"/>
            <result property="unbalancedApparentPowerMax" column="unbalanced_apparent_power_max" jdbcType="FLOAT"/>
            <result property="unbalancedApparentPowerMin" column="unbalanced_apparent_power_min" jdbcType="FLOAT"/>
            <result property="unbalancedApparentPowerAvg" column="unbalanced_apparent_power_avg" jdbcType="FLOAT"/>
            <result property="unbalancedApparentPower95" column="unbalanced_apparent_power_95" jdbcType="FLOAT"/>
    </resultMap>

    <sql id="Base_Column_List">
        measurement_point_id,data_date,frequency_max,
        frequency_min,frequency_avg,frequency_95,
        frequency_deviation_max,frequency_deviation_min,frequency_deviation_avg,
        frequency_deviation_95,total_active_power_max,total_active_power_min,
        total_active_power_avg,total_active_power_95,total_reactive_power_max,
        total_reactive_power_min,total_reactive_power_avg,total_reactive_power_95,
        total_apparent_power_max,total_apparent_power_min,total_apparent_power_avg,
        total_apparent_power_95,tp_power_factor_max,tp_power_factor_min,
        tp_power_factor_avg,tp_power_factor_95,fundamental_power_factor_max,
        fundamental_power_factor_min,fundamental_power_factor_avg,fundamental_power_factor_95,
        positive_sequence_voltage_max,positive_sequence_voltage_min,positive_sequence_voltage_avg,
        positive_sequence_voltage_95,negative_sequence_voltage_max,negative_sequence_voltage_min,
        negative_sequence_voltage_avg,negative_sequence_voltage_95,zero_sequence_voltage_max,
        zero_sequence_voltage_min,zero_sequence_voltage_avg,zero_sequence_voltage_95,
        negative_sequence_voltage_unbalance_max,negative_sequence_voltage_unbalance_min,negative_sequence_voltage_unbalance_avg,
        negative_sequence_voltage_unbalance_95,zero_sequence_voltage_unbalance_max,zero_sequence_voltage_unbalance_min,
        zero_sequence_voltage_unbalance_avg,zero_sequence_voltage_unbalance_95,positive_sequence_current_max,
        positive_sequence_current_min,positive_sequence_current_avg,positive_sequence_current_95,
        negative_sequence_current_max,negative_sequence_current_min,negative_sequence_current_avg,
        negative_sequence_current_95,zero_sequence_current_max,zero_sequence_current_min,
        zero_sequence_current_avg,zero_sequence_current_95,negative_sequence_current_unbalance_max,
        negative_sequence_current_unbalance_min,negative_sequence_current_unbalance_avg,negative_sequence_current_unbalance_95,
        zero_sequence_current_imbalance_max,zero_sequence_current_imbalance_min,zero_sequence_current_imbalance_avg,
        zero_sequence_current_imbalance_95,equivalent_apparent_power_max,equivalent_apparent_power_min,
        equivalent_apparent_power_avg,equivalent_apparent_power_95,equivalent_power_factor_max,
        equivalent_power_factor_min,equivalent_power_factor_avg,equivalent_power_factor_95,
        fundamental_wave_rateo_max,fundamental_wave_rateo_min,fundamental_wave_rateo_avg,
        fundamental_wave_rateo_95,fundamental_wave_apparent_max,fundamental_wave_apparent_min,
        fundamental_wave_apparent_avg,fundamental_wave_apparent_95,nonfundamental_wave_rateo_max,
        nonfundamental_wave_rateo_min,nonfundamental_wave_rateo_avg,nonfundamental_wave_rateo_95,
        unbalanced_apparent_power_max,unbalanced_apparent_power_min,unbalanced_apparent_power_avg,
        unbalanced_apparent_power_95
    </sql>
    <select id="getListByCond" resultType="com.njcn.harmonic.pojo.po.RMpMeasureReportD" parameterType="java.util.Map">
        select <include refid="Base_Column_List"/>
        from r_mp_measure_report_d
        where 1 = 1
        <if test="startTime != null and startTime != ''">
            AND DATE_FORMAT(data_date, '%Y-%m-%d') >=  #{startTime, jdbcType=VARCHAR}
        </if>
        <if test="endTime != null and endTime != ''">
            AND DATE_FORMAT(data_date, '%Y-%m-%d') &lt;=  #{endTime, jdbcType=VARCHAR}
        </if>
        and measurement_point_id IN
        <foreach collection="monitorIdList" open="(" close=")" separator="," item="id">
            #{id}
        </foreach>
    </select>
</mapper>
