<?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.RMpSurplusHarmonicDetailMMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.njcn.harmonic.pojo.po.RMpSurplusHarmonicDetailM">
        <id column="measurement_point_id" property="measurementPointId" />
        <result column="data_date" property="dataDate" />
        <result column="inuharm_over_day" property="inuharmOverDay" />
        <result column="inuharm_1_over_day" property="inuharm1OverDay" />
        <result column="inuharm_2_over_day" property="inuharm2OverDay" />
        <result column="inuharm_3_over_day" property="inuharm3OverDay" />
        <result column="inuharm_4_over_day" property="inuharm4OverDay" />
        <result column="inuharm_5_over_day" property="inuharm5OverDay" />
        <result column="inuharm_6_over_day" property="inuharm6OverDay" />
        <result column="inuharm_7_over_day" property="inuharm7OverDay" />
        <result column="inuharm_8_over_day" property="inuharm8OverDay" />
        <result column="inuharm_9_over_day" property="inuharm9OverDay" />
        <result column="inuharm_10_over_day" property="inuharm10OverDay" />
        <result column="inuharm_11_over_day" property="inuharm11OverDay" />
        <result column="inuharm_12_over_day" property="inuharm12OverDay" />
        <result column="inuharm_13_over_day" property="inuharm13OverDay" />
        <result column="inuharm_14_over_day" property="inuharm14OverDay" />
        <result column="inuharm_15_over_day" property="inuharm15OverDay" />
        <result column="inuharm_16_over_day" property="inuharm16OverDay" />
        <result column="inuharm_17_over_day" property="inuharm17OverDay" />
        <result column="inuharm_18_over_day" property="inuharm18OverDay" />
        <result column="inuharm_19_over_day" property="inuharm19OverDay" />
        <result column="inuharm_20_over_day" property="inuharm20OverDay" />
        <result column="inuharm_21_over_day" property="inuharm21OverDay" />
        <result column="inuharm_22_over_day" property="inuharm22OverDay" />
        <result column="inuharm_23_over_day" property="inuharm23OverDay" />
        <result column="inuharm_24_over_day" property="inuharm24OverDay" />
        <result column="inuharm_25_over_day" property="inuharm25OverDay" />
        <result column="inuharm_26_over_day" property="inuharm26OverDay" />
        <result column="inuharm_27_over_day" property="inuharm27OverDay" />
        <result column="inuharm_28_over_day" property="inuharm28OverDay" />
        <result column="inuharm_29_over_day" property="inuharm29OverDay" />
        <result column="inuharm_30_over_day" property="inuharm30OverDay" />
        <result column="inuharm_31_over_day" property="inuharm31OverDay" />
        <result column="inuharm_32_over_day" property="inuharm32OverDay" />
        <result column="inuharm_33_over_day" property="inuharm33OverDay" />
        <result column="inuharm_34_over_day" property="inuharm34OverDay" />
        <result column="inuharm_35_over_day" property="inuharm35OverDay" />
        <result column="inuharm_36_over_day" property="inuharm36OverDay" />
        <result column="inuharm_37_over_day" property="inuharm37OverDay" />
        <result column="inuharm_38_over_day" property="inuharm38OverDay" />
        <result column="inuharm_39_over_day" property="inuharm39OverDay" />
        <result column="inuharm_40_over_day" property="inuharm40OverDay" />
        <result column="inuharm_41_over_day" property="inuharm41OverDay" />
        <result column="inuharm_42_over_day" property="inuharm42OverDay" />
        <result column="inuharm_43_over_day" property="inuharm43OverDay" />
        <result column="inuharm_44_over_day" property="inuharm44OverDay" />
        <result column="inuharm_45_over_day" property="inuharm45OverDay" />
        <result column="inuharm_46_over_day" property="inuharm46OverDay" />
        <result column="inuharm_47_over_day" property="inuharm47OverDay" />
        <result column="inuharm_48_over_day" property="inuharm48OverDay" />
        <result column="inuharm_49_over_day" property="inuharm49OverDay" />
        <result column="inuharm_50_over_day" property="inuharm50OverDay" />
        <result column="flicker_over_day" property="flickerOverDay" />
    </resultMap>
    <select id="getRMpPartHarmonicDetail" resultType="com.njcn.harmonic.pojo.vo.RMpPartHarmonicDetailVO">
        select
            rms.measurement_point_id,
            rmphdm.data_date,
            rms.inuharm_over_day,
            rms.inuharm_1_over_day,
            rms.inuharm_2_over_day,
            rms.inuharm_3_over_day,
            rms.inuharm_4_over_day,
            rms.inuharm_5_over_day,
            rms.inuharm_6_over_day,
            rms.inuharm_7_over_day,
            rms.inuharm_8_over_day,
            rms.inuharm_9_over_day,
            rms.inuharm_10_over_day,
            rms.inuharm_11_over_day,
            rms.inuharm_12_over_day,
            rms.inuharm_13_over_day,
            rms.inuharm_14_over_day,
            rms.inuharm_15_over_day,
            rms.inuharm_16_over_day,
            rms.inuharm_17_over_day,
            rms.inuharm_18_over_day,
            rms.inuharm_19_over_day,
            rms.inuharm_20_over_day,
            rms.inuharm_21_over_day,
            rms.inuharm_22_over_day,
            rms.inuharm_23_over_day,
            rms.inuharm_24_over_day,
            rms.flicker_over_day,
            rmphdm.measurement_point_id,
            rmphdm.measurement_over_day,
            rmphdm.freq_over_day,
            rmphdm.v_dev_up_over_day,
            rmphdm.v_dev_low_over_day,
            rmphdm.v_dev_over_day,
            rmphdm.v_thd_over_day,
            rmphdm.v_over_day,
            rmphdm.i_over_day,
            rmphdm.v_2_over_day,
            rmphdm.v_3_over_day,
            rmphdm.v_4_over_day,
            rmphdm.v_5_over_day,
            rmphdm.v_6_over_day,
            rmphdm.v_7_over_day,
            rmphdm.v_8_over_day,
            rmphdm.v_9_over_day,
            rmphdm.v_10_over_day,
            rmphdm.v_11_over_day,
            rmphdm.v_12_over_day,
            rmphdm.v_13_over_day,
            rmphdm.v_14_over_day,
            rmphdm.v_15_over_day,
            rmphdm.v_16_over_day,
            rmphdm.v_17_over_day,
            rmphdm.v_18_over_day,
            rmphdm.v_19_over_day,
            rmphdm.v_20_over_day,
            rmphdm.v_21_over_day,
            rmphdm.v_22_over_day,
            rmphdm.v_23_over_day,
            rmphdm.v_24_over_day,
            rmphdm.v_25_over_day,
            rmphdm.i_2_over_day,
            rmphdm.i_3_over_day,
            rmphdm.i_4_over_day,
            rmphdm.i_5_over_day,
            rmphdm.i_6_over_day,
            rmphdm.i_7_over_day,
            rmphdm.i_8_over_day,
            rmphdm.i_9_over_day,
            rmphdm.i_10_over_day,
            rmphdm.i_11_over_day,
            rmphdm.i_12_over_day,
            rmphdm.i_13_over_day,
            rmphdm.i_14_over_day,
            rmphdm.i_15_over_day,
            rmphdm.i_16_over_day,
            rmphdm.i_17_over_day,
            rmphdm.i_18_over_day,
            rmphdm.i_19_over_day,
            rmphdm.i_20_over_day,
            rmphdm.i_21_over_day,
            rmphdm.i_22_over_day,
            rmphdm.i_23_over_day,
            rmphdm.i_24_over_day,
            rmphdm.i_25_over_day,
            rmphdm.unbalance_over_day,
            rmphdm.i_neg_over_day
        from r_mp_surplus_harmonic_detail_m rms
        right join r_mp_part_harmonic_detail_m rmphdm on rms.measurement_point_id = rmphdm.measurement_point_id
        and rms.data_date=rmphdm.data_date
        <where>
            <if test="param != null and  param.ids != null and param.ids.size > 0">
                AND rmphdm.measurement_point_id IN
                <foreach collection='param.ids' item='item' index="index" open='(' separator=',' close=')'>
                    #{item}
                </foreach>
            </if>
            <if test="param!=null and param.startTime != null and param.startTime !=''">
                AND  rmphdm.data_date >= #{param.startTime} AND rms.data_date >= #{param.startTime}
            </if>
            <if test="param!=null and param.endTime != null and param.endTime != ''">
                AND   rmphdm.data_date &lt;= #{param.endTime}  AND  rms.data_date &lt;= #{param.endTime}
            </if>
        </where>
    </select>

</mapper>
