<?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.yeejoin.amos.boot.module.hygf.api.tdenginemapper.TdHYGFInverterMonthGenerateMapper">

    <select id="selectMonthTrend" resultType="map">

        SELECT
         day_time as dayTime,
         generate,
         fullhour
        from
        house_pv_data.td_hygf_inverter_month_generate
        <where>
            year_month = #{time}
            <if test="snCode != null and snCode !=''">
                and sn_code = #{snCode}
            </if>
            <if test="thirdStationId != null and thirdStationId !=''">
                and third_station_id = #{thirdStationId}
            </if>
        </where>

    </select>

    <select id="selectMonthTotal" resultType="map">

        SELECT
        generate,
        fullhour,
        income
        from
        house_pv_data.td_hygf_inverter_month_generate
        <where>
            day_time = #{time}
            <if test="snCode != null and snCode !=''">
                and sn_code = #{snCode}
            </if>
            <if test="thirdStationId != null and thirdStationId !=''">
                and third_station_id = #{thirdStationId}
            </if>
        </where>
    </select>
</mapper>