<?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.device.pms.mapper.majornetwork.RStatBusbarHarmonicMapper">

    <!--查询变电站背景谐波年表-->
    <select id="getRStatBusbarHarmonic"
            resultType="com.njcn.device.pms.pojo.po.RStatBusbarHarmonicYPO">
        SELECT
        busbar_id AS busbarId,
        data_date AS dataDate,
        v_effective_max AS vEffectiveMax,
        v_effective_min AS vEffectiveMin,
        v_effective_avg AS vEffectiveAvg,
        v_effective_95 AS vEffective95,
        v_thd_max AS vThdMax,
        v_thd_min AS vThdMin,
        v_thd_avg AS vThdAvg,
        v_thd_95 AS vThd95,
        unbalance_max AS unbalanceMax,
        unbalance_min AS unbalanceMin,
        unbalance_avg AS unbalanceAvg,
        unbalance_95 AS unbalance95,
        flicker_max AS flickerMax,
        flicker_min AS flickerMin,
        flicker_avg AS flickerAvg,
        flicker_95 AS flicker95
        FROM
        r_stat_busbar_harmonic_y
        WHERE
        busbar_id IN
        <foreach collection="generatrixIds" item="item" open="(" close=")" separator=",">
            #{item}
        </foreach>
        <if test="startTime != null and startTime != ''">
            AND DATE_FORMAT( data_date,'%Y-%m-%d') &gt;= DATE_FORMAT(#{startTime},'%Y-%m-%d')
        </if>
        <if test="endTime != null and endTime != ''">
            AND DATE_FORMAT( data_date,'%Y-%m-%d') &lt;= DATE_FORMAT(#{endTime},'%Y-%m-%d')
        </if>
    </select>
</mapper>
