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

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.njcn.harmonic.pojo.po.RMpPassRateY">
        <id column="measurement_point_id" property="measurementPointId" />
        <result column="data_date" property="dataDate" />
        <result column="freq_pass_rate" property="freqPassRate" />
        <result column="v_dev_pass_rate" property="vDevPassRate" />
        <result column="flicker_pass_rate" property="flickerPassRate" />
    </resultMap>
    <select id="getYearPassRate" resultType="com.njcn.harmonic.pojo.vo.RStatOrgIndexVO">
        SELECT
            measurement_point_id,
            data_date,
            freq_pass_rate,
            v_dev_pass_rate,
            flicker_pass_rate
        FROM
            r_mp_pass_rate_y
        <where>
            <if test="param != null and  param.ids != null and param.ids.size > 0">
                AND 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  data_date >= #{param.startTime}
            </if>
            <if test="param!=null and param.endTime != null and param.endTime != ''">
                AND   data_date &lt;= #{param.endTime}
            </if>
        </where>
    </select>

</mapper>
