<?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.majornetwork.RMpPartHarmonicDetailDMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.njcn.harmonic.pojo.po.RMpPartHarmonicDetailD">
        <id column="measurement_point_id" property="measurementPointId" />
        <result column="data_date" property="dataDate" />
        <result column="is_harmonic" property="isHarmonic" />
        <result column="is_freq" property="isFreq" />
        <result column="freq_times" property="freqTimes" />
        <result column="is_v_dev_up" property="isVDevUp" />
        <result column="is_v_dev_low" property="isVDevLow" />
        <result column="is_v_dev" property="isVDev" />
        <result column="is_v_thd" property="isVThd" />
        <result column="v_dev_times" property="vDevTimes" />
        <result column="is_v" property="isV" />
        <result column="v_times" property="vTimes" />
        <result column="is_i" property="isI" />
        <result column="i_times" property="iTimes" />
        <result column="is_v_2" property="isV2" />
        <result column="is_v_3" property="isV3" />
        <result column="is_v_4" property="isV4" />
        <result column="is_v_5" property="isV5" />
        <result column="is_v_6" property="isV6" />
        <result column="is_v_7" property="isV7" />
        <result column="is_v_8" property="isV8" />
        <result column="is_v_9" property="isV9" />
        <result column="is_v_10" property="isV10" />
        <result column="is_v_11" property="isV11" />
        <result column="is_v_12" property="isV12" />
        <result column="is_v_13" property="isV13" />
        <result column="is_v_14" property="isV14" />
        <result column="is_v_15" property="isV15" />
        <result column="is_v_16" property="isV16" />
        <result column="is_v_17" property="isV17" />
        <result column="is_v_18" property="isV18" />
        <result column="is_v_19" property="isV19" />
        <result column="is_v_20" property="isV20" />
        <result column="is_v_21" property="isV21" />
        <result column="is_v_22" property="isV22" />
        <result column="is_v_23" property="isV23" />
        <result column="is_v_24" property="isV24" />
        <result column="is_v_25" property="isV25" />
        <result column="is_v_26" property="isV26" />
        <result column="is_v_27" property="isV27" />
        <result column="is_v_28" property="isV28" />
        <result column="is_v_29" property="isV29" />
        <result column="is_v_30" property="isV30" />
        <result column="is_v_31" property="isV31" />
        <result column="is_v_32" property="isV32" />
        <result column="is_v_33" property="isV33" />
        <result column="is_v_34" property="isV34" />
        <result column="is_v_35" property="isV35" />
        <result column="is_v_36" property="isV36" />
        <result column="is_v_37" property="isV37" />
        <result column="is_v_38" property="isV38" />
        <result column="is_v_39" property="isV39" />
        <result column="is_v_40" property="isV40" />
        <result column="is_v_41" property="isV41" />
        <result column="is_v_42" property="isV42" />
        <result column="is_v_43" property="isV43" />
        <result column="is_v_44" property="isV44" />
        <result column="is_v_45" property="isV45" />
        <result column="is_v_46" property="isV46" />
        <result column="is_v_47" property="isV47" />
        <result column="is_v_48" property="isV48" />
        <result column="is_v_49" property="isV49" />
        <result column="is_v_50" property="isV50" />
        <result column="is_i_2" property="isI2" />
        <result column="is_i_3" property="isI3" />
        <result column="is_i_4" property="isI4" />
        <result column="is_i_5" property="isI5" />
        <result column="is_i_6" property="isI6" />
        <result column="is_i_7" property="isI7" />
        <result column="is_i_8" property="isI8" />
        <result column="is_i_9" property="isI9" />
        <result column="is_i_10" property="isI10" />
        <result column="is_i_11" property="isI11" />
        <result column="is_i_12" property="isI12" />
        <result column="is_i_13" property="isI13" />
        <result column="is_i_14" property="isI14" />
        <result column="is_i_15" property="isI15" />
        <result column="is_i_16" property="isI16" />
        <result column="is_i_17" property="isI17" />
        <result column="is_i_18" property="isI18" />
        <result column="is_i_19" property="isI19" />
        <result column="is_i_20" property="isI20" />
        <result column="is_i_21" property="isI21" />
        <result column="is_i_22" property="isI22" />
        <result column="is_i_23" property="isI23" />
        <result column="is_i_24" property="isI24" />
        <result column="is_i_25" property="isI25" />
        <result column="is_i_26" property="isI26" />
        <result column="is_i_27" property="isI27" />
        <result column="is_i_28" property="isI28" />
        <result column="is_i_29" property="isI29" />
        <result column="is_i_30" property="isI30" />
        <result column="is_i_31" property="isI31" />
        <result column="is_i_32" property="isI32" />
        <result column="is_i_33" property="isI33" />
        <result column="is_i_34" property="isI34" />
        <result column="is_i_35" property="isI35" />
        <result column="is_i_36" property="isI36" />
        <result column="is_i_37" property="isI37" />
        <result column="is_i_38" property="isI38" />
        <result column="is_i_39" property="isI39" />
        <result column="is_i_40" property="isI40" />
        <result column="is_i_41" property="isI41" />
        <result column="is_i_42" property="isI42" />
        <result column="is_i_43" property="isI43" />
        <result column="is_i_44" property="isI44" />
        <result column="is_i_45" property="isI45" />
        <result column="is_i_46" property="isI46" />
        <result column="is_i_47" property="isI47" />
        <result column="is_i_48" property="isI48" />
        <result column="is_i_49" property="isI49" />
        <result column="is_i_50" property="isI50" />
        <result column="is_unbalance" property="isUnbalance" />
        <result column="is_i_neg" property="isINeg" />
        <result column="unbalance_times" property="unbalanceTimes" />
        <result column="i_neg_times" property="iNegTimes" />
    </resultMap>
    <select id="getRMpPartHarmonicDetailIcon"
            resultType="com.njcn.harmonic.pojo.vo.RMpPartHarmonicDetailIconVO">
        SELECT
            rmphd.data_date,
            rmphd.freq_times,
            rmphd.v_dev_times,
            rmphd.v_times,
            rmphd.i_times,
            rmphd.unbalance_times,
            rmphd.i_neg_times,
            rmshd.flicker_times,
            rmshd.inuharm_times
        FROM
            r_mp_part_harmonic_detail_d rmphd
        LEFT JOIN r_mp_surplus_harmonic_detail_d rmshd ON rmshd.measurement_point_id = rmphd.measurement_point_id
            AND rmshd.data_date = rmphd.data_date
        <where>
            <if test="param != null and  param.id">
                AND  rmphd.measurement_point_id = #{param.id}
            </if>
            <if test="param!=null and param.startTime != null and param.startTime !=''">
                AND  rmphd.data_date >= #{param.startTime} AND rmshd.data_date >= #{param.startTime}
            </if>
            <if test="param!=null and param.endTime != null and param.endTime != ''">
                AND  rmphd.data_date &lt;= #{param.endTime}  AND  rmshd.data_date &lt;= #{param.endTime}
            </if>
        </where>

    </select>

</mapper>
