<?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.ruoyi.predict.mapper.PvPowerStationMapper">
    
    <resultMap type="PvPowerStation" id="PvPowerStationResult">
        <result property="pvStationNo"    column="pv_station_no"    />
        <result property="ratingPower"    column="rating_power"    />
        <result property="confirmPower"    column="confirm_power"    />
        <result property="inverterCnt"    column="inverter_cnt"    />
        <result property="junctionBoxCnt"    column="junction_box_cnt"    />
        <result property="pvCellCnt"    column="pv_cell_cnt"    />
        <result property="longtitude"    column="longtitude"    />
        <result property="latitude"    column="latitude"    />
        <result property="elevation"    column="elevation"    />
        <result property="poaSlopeAngle"    column="poa_slope_angle"    />
        <result property="poaAzimuthAngle"    column="poa_azimuth_angle"    />
        <result property="reflectionRatio"    column="reflection_ratio"    />
        <result property="tempCoeff"    column="temp_coeff"    />
        <result property="apYcNo"    column="ap_yc_no"    />
        <result property="ghiYcNo"    column="ghi_yc_no"    />
        <result property="dniYcNo"    column="dni_yc_no"    />
        <result property="dfiYcNo"    column="dfi_yc_no"    />
        <result property="poaiYcNo"    column="poai_yc_no"    />
        <result property="temperatureYcNo"    column="temperature_yc_no"    />
        <result property="panelTempYcNo"    column="panel_temp_yc_no"    />
        <result property="humidityYcNo"    column="humidity_yc_no"    />
        <result property="pressureYcNo"    column="pressure_yc_no"    />
        <result property="wspeedYcNo"    column="wspeed_yc_no"    />
        <result property="wdirYcNo"    column="wdir_yc_no"    />
        <result property="positiveError"    column="positive_error"    />
        <result property="negativeError"    column="negative_error"    />
        <result property="nwpLfA"    column="nwp_lf_a"    />
        <result property="pcurveSampleCnt"    column="pcurve_sample_cnt"    />
        <result property="pcurveLfA"    column="pcurve_lf_a"    />
        <result property="pcurveInputFlag"    column="pcurve_input_flag"    />
        <result property="pcurveHlCnt"    column="pcurve_hl_cnt"    />
        <result property="uspSampleCnt"    column="usp_sample_cnt"    />
        <result property="corrSampleCnt"    column="corr_sample_cnt"    />
        <result property="gamma"    column="gamma"    />
        <result property="cost"    column="cost"    />
        <result property="nu"    column="nu"    />
        <result property="spaceDim"    column="space_dim"    />
        <result property="uspCorrectionFlag"    column="usp_correction_flag"    />
        <result property="totalPower"    column="total_power"    />
        <result property="pccPower"    column="pcc_power"    />
        <result property="ghi"    column="ghi"    />
        <result property="dni"    column="dni"    />
        <result property="dfi"    column="dfi"    />
        <result property="poai"    column="poai"    />
        <result property="temperature"    column="temperature"    />
        <result property="panelTemperature"    column="panel_temperature"    />
        <result property="humidity"    column="humidity"    />
        <result property="pressure"    column="pressure"    />
        <result property="windSpeed"    column="wind_speed"    />
        <result property="windDir"    column="wind_dir"    />
        <result property="inverterRunCnt"    column="inverter_run_cnt"    />
        <result property="inerterStopCnt"    column="inerter_stop_cnt"    />
        <result property="invertFaultCnt"    column="invert_fault_cnt"    />
        <result property="totalEnergy"    column="total_energy"    />
        <result property="lastTotalEnergy"    column="last_total_energy"    />
        <result property="todayEnergy"    column="today_energy"    />
        <result property="rtuNo"    column="rtu_no"    />
        <result property="name"    column="name"    />
        <result property="ref"    column="ref"    />
        <result property="pcurveStatTime"    column="pcurve_stat_time"    />
        <result property="nwpCalcTime"    column="nwp_calc_time"    />
        <result property="daPredictionTime"    column="da_prediction_time"    />
        <result property="daDayStatTime"    column="da_day_stat_time"    />
        <result property="daMonthStatTime"    column="da_month_stat_time"    />
        <result property="uspPredictionTime"    column="usp_prediction_time"    />
        <result property="uspDayStatTime"    column="usp_day_stat_time"    />
        <result property="uspMonthStatTime"    column="usp_month_stat_time"    />
        <result property="companyNo"    column="company_no"    />
        <result property="site"    column="site"    />
    </resultMap>

    <sql id="selectPvPowerStationVo">
        select pv_station_no, rating_power, confirm_power, inverter_cnt, junction_box_cnt, pv_cell_cnt, longtitude, latitude, elevation, poa_slope_angle, poa_azimuth_angle, reflection_ratio, temp_coeff, ap_yc_no, ghi_yc_no, dni_yc_no, dfi_yc_no, poai_yc_no, temperature_yc_no, panel_temp_yc_no, humidity_yc_no, pressure_yc_no, wspeed_yc_no, wdir_yc_no, positive_error, negative_error, nwp_lf_a, pcurve_sample_cnt, pcurve_lf_a, pcurve_input_flag, pcurve_hl_cnt, usp_sample_cnt, corr_sample_cnt, gamma, cost, nu, space_dim, usp_correction_flag, total_power, pcc_power, ghi, dni, dfi, poai, temperature, panel_temperature, humidity, pressure, wind_speed, wind_dir, inverter_run_cnt, inerter_stop_cnt, invert_fault_cnt, total_energy, last_total_energy, today_energy, rtu_no, name, ref, pcurve_stat_time, nwp_calc_time, da_prediction_time, da_day_stat_time, da_month_stat_time, usp_prediction_time, usp_day_stat_time, usp_month_stat_time, company_no, site from pv_power_station
    </sql>

    <select id="selectPvPowerStationList" parameterType="PvPowerStation" resultMap="PvPowerStationResult">
        select
        pps.*,
        a.name as "areaName",
        a.area_no as "areaNo",
        emi.item_name as "rtuTypeName",
        emi.item_val as "itemVal"
        from
        pv_power_station pps
        left join area_config ac on ac.rtu_no = pps.pv_station_no
        left join area a on a.area_no = ac.area_no
        left join rtu r on r.rtu_no = pps.pv_station_no
        left join enum_menu_item emi on emi.item_val = r.rtu_type and emi.menu_no = 115
        <where>
            <if test="pvStationNo != null ">and pps.pv_station_no = #{pvStationNo}</if>
            <if test="ratingPower != null "> and pps.rating_power = #{ratingPower}</if>
            <if test="confirmPower != null "> and pps.confirm_power = #{confirmPower}</if>
            <if test="inverterCnt != null "> and pps.inverter_cnt = #{inverterCnt}</if>
            <if test="junctionBoxCnt != null "> and pps.junction_box_cnt = #{junctionBoxCnt}</if>
            <if test="pvCellCnt != null "> and pps.pv_cell_cnt = #{pvCellCnt}</if>
            <if test="longtitude != null "> and pps.longtitude = #{longtitude}</if>
            <if test="latitude != null "> and pps.latitude = #{latitude}</if>
            <if test="elevation != null "> and pps.elevation = #{elevation}</if>
            <if test="poaSlopeAngle != null "> and pps.poa_slope_angle = #{poaSlopeAngle}</if>
            <if test="poaAzimuthAngle != null "> and pps.poa_azimuth_angle = #{poaAzimuthAngle}</if>
            <if test="reflectionRatio != null "> and pps.reflection_ratio = #{reflectionRatio}</if>
            <if test="tempCoeff != null "> and pps.temp_coeff = #{tempCoeff}</if>
            <if test="apYcNo != null "> and pps.ap_yc_no = #{apYcNo}</if>
            <if test="ghiYcNo != null "> and pps.ghi_yc_no = #{ghiYcNo}</if>
            <if test="dniYcNo != null "> and pps.dni_yc_no = #{dniYcNo}</if>
            <if test="dfiYcNo != null "> and pps.dfi_yc_no = #{dfiYcNo}</if>
            <if test="poaiYcNo != null "> and pps.poai_yc_no = #{poaiYcNo}</if>
            <if test="temperatureYcNo != null "> and pps.temperature_yc_no = #{temperatureYcNo}</if>
            <if test="panelTempYcNo != null "> and pps.panel_temp_yc_no = #{panelTempYcNo}</if>
            <if test="humidityYcNo != null "> and pps.humidity_yc_no = #{humidityYcNo}</if>
            <if test="pressureYcNo != null "> and pps.pressure_yc_no = #{pressureYcNo}</if>
            <if test="wspeedYcNo != null "> and pps.wspeed_yc_no = #{wspeedYcNo}</if>
            <if test="wdirYcNo != null "> and pps.wdir_yc_no = #{wdirYcNo}</if>
            <if test="positiveError != null "> and pps.positive_error = #{positiveError}</if>
            <if test="negativeError != null "> and pps.negative_error = #{negativeError}</if>
            <if test="nwpLfA != null "> and pps.nwp_lf_a = #{nwpLfA}</if>
            <if test="pcurveSampleCnt != null "> and pps.pcurve_sample_cnt = #{pcurveSampleCnt}</if>
            <if test="pcurveLfA != null "> and pps.pcurve_lf_a = #{pcurveLfA}</if>
            <if test="pcurveInputFlag != null "> and pps.pcurve_input_flag = #{pcurveInputFlag}</if>
            <if test="pcurveHlCnt != null "> and pps.pcurve_hl_cnt = #{pcurveHlCnt}</if>
            <if test="uspSampleCnt != null "> and pps.usp_sample_cnt = #{uspSampleCnt}</if>
            <if test="corrSampleCnt != null "> and pps.corr_sample_cnt = #{corrSampleCnt}</if>
            <if test="gamma != null "> and pps.gamma = #{gamma}</if>
            <if test="cost != null "> and pps.cost = #{cost}</if>
            <if test="nu != null "> and pps.nu = #{nu}</if>
            <if test="spaceDim != null "> and pps.space_dim = #{spaceDim}</if>
            <if test="uspCorrectionFlag != null "> and pps.usp_correction_flag = #{uspCorrectionFlag}</if>
            <if test="totalPower != null "> and pps.total_power = #{totalPower}</if>
            <if test="pccPower != null "> and pps.pcc_power = #{pccPower}</if>
            <if test="ghi != null "> and pps.ghi = #{ghi}</if>
            <if test="dni != null "> and pps.dni = #{dni}</if>
            <if test="dfi != null "> and pps.dfi = #{dfi}</if>
            <if test="poai != null "> and pps.poai = #{poai}</if>
            <if test="temperature != null "> and pps.temperature = #{temperature}</if>
            <if test="panelTemperature != null "> and pps.panel_temperature = #{panelTemperature}</if>
            <if test="humidity != null "> and pps.humidity = #{humidity}</if>
            <if test="pressure != null "> and pps.pressure = #{pressure}</if>
            <if test="windSpeed != null "> and pps.wind_speed = #{windSpeed}</if>
            <if test="windDir != null "> and pps.wind_dir = #{windDir}</if>
            <if test="inverterRunCnt != null "> and pps.inverter_run_cnt = #{inverterRunCnt}</if>
            <if test="inerterStopCnt != null "> and pps.inerter_stop_cnt = #{inerterStopCnt}</if>
            <if test="invertFaultCnt != null "> and pps.invert_fault_cnt = #{invertFaultCnt}</if>
            <if test="totalEnergy != null "> and pps.total_energy = #{totalEnergy}</if>
            <if test="lastTotalEnergy != null "> and pps.last_total_energy = #{lastTotalEnergy}</if>
            <if test="todayEnergy != null "> and pps.today_energy = #{todayEnergy}</if>
            <if test="rtuNo != null "> and pps.rtu_no = #{rtuNo}</if>
            <if test="name != null  and name != ''"> and name like pps.concat(concat('%', #{name}), '%')</if>
            <if test="ref != null  and ref != ''"> and pps.ref = #{ref}</if>
            <if test="pcurveStatTime != null "> and pps.pcurve_stat_time = #{pcurveStatTime}</if>
            <if test="nwpCalcTime != null "> and pps.nwp_calc_time = #{nwpCalcTime}</if>
            <if test="daPredictionTime != null "> and pps.da_prediction_time = #{daPredictionTime}</if>
            <if test="daDayStatTime != null "> and pps.da_day_stat_time = #{daDayStatTime}</if>
            <if test="daMonthStatTime != null "> and pps.da_month_stat_time = #{daMonthStatTime}</if>
            <if test="uspPredictionTime != null "> and pps.usp_prediction_time = #{uspPredictionTime}</if>
            <if test="uspDayStatTime != null "> and pps.usp_day_stat_time = #{uspDayStatTime}</if>
            <if test="uspMonthStatTime != null "> and pps.usp_month_stat_time = #{uspMonthStatTime}</if>
            <if test="companyNo != null  and companyNo != ''"> and pps.company_no = #{companyNo}</if>
            <if test="site != null  and site != ''"> and pps.site = #{site}</if>
            <if test="areaNo != null ">and a.area_no = #{areaNo}</if>
        </where>
        order by pps.pv_station_no asc
    </select>
    
    <select id="selectPvPowerStationById" parameterType="Long" resultMap="PvPowerStationResult">
        <include refid="selectPvPowerStationVo"/>
        where pv_station_no = #{pvStationNo}
    </select>

    <select id="checkPvStationNameUnique" parameterType="String" resultType="int">
		select count(1) from pv_power_station where name = #{pvStationName} and rownum <![CDATA[ <= ]]> 1
    </select>

    <select id="selectNewData" resultType="Long">
        SELECT * FROM ( SELECT pv_station_no FROM pv_power_station ORDER BY pv_station_no DESC ) WHERE ROWNUM = 1
    </select>

    <select id="selectPvPowerStationByStationCode" parameterType="String" resultMap="PvPowerStationResult">
        <include refid="selectPvPowerStationVo"/>
        where ref = #{stationCode}
    </select>

    <insert id="insertPvPowerStation" parameterType="PvPowerStation">
        insert into pv_power_station
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="pvStationNo != null">pv_station_no,</if>
            <if test="ratingPower != null">rating_power,</if>
            <if test="confirmPower != null">confirm_power,</if>
            <if test="inverterCnt != null">inverter_cnt,</if>
            <if test="junctionBoxCnt != null">junction_box_cnt,</if>
            <if test="pvCellCnt != null">pv_cell_cnt,</if>
            <if test="longtitude != null">longtitude,</if>
            <if test="latitude != null">latitude,</if>
            <if test="elevation != null">elevation,</if>
            <if test="poaSlopeAngle != null">poa_slope_angle,</if>
            <if test="poaAzimuthAngle != null">poa_azimuth_angle,</if>
            <if test="reflectionRatio != null">reflection_ratio,</if>
            <if test="tempCoeff != null">temp_coeff,</if>
            <if test="apYcNo != null">ap_yc_no,</if>
            <if test="ghiYcNo != null">ghi_yc_no,</if>
            <if test="dniYcNo != null">dni_yc_no,</if>
            <if test="dfiYcNo != null">dfi_yc_no,</if>
            <if test="poaiYcNo != null">poai_yc_no,</if>
            <if test="temperatureYcNo != null">temperature_yc_no,</if>
            <if test="panelTempYcNo != null">panel_temp_yc_no,</if>
            <if test="humidityYcNo != null">humidity_yc_no,</if>
            <if test="pressureYcNo != null">pressure_yc_no,</if>
            <if test="wspeedYcNo != null">wspeed_yc_no,</if>
            <if test="wdirYcNo != null">wdir_yc_no,</if>
            <if test="positiveError != null">positive_error,</if>
            <if test="negativeError != null">negative_error,</if>
            <if test="nwpLfA != null">nwp_lf_a,</if>
            <if test="pcurveSampleCnt != null">pcurve_sample_cnt,</if>
            <if test="pcurveLfA != null">pcurve_lf_a,</if>
            <if test="pcurveInputFlag != null">pcurve_input_flag,</if>
            <if test="pcurveHlCnt != null">pcurve_hl_cnt,</if>
            <if test="uspSampleCnt != null">usp_sample_cnt,</if>
            <if test="corrSampleCnt != null">corr_sample_cnt,</if>
            <if test="gamma != null">gamma,</if>
            <if test="cost != null">cost,</if>
            <if test="nu != null">nu,</if>
            <if test="spaceDim != null">space_dim,</if>
            <if test="uspCorrectionFlag != null">usp_correction_flag,</if>
            <if test="totalPower != null">total_power,</if>
            <if test="pccPower != null">pcc_power,</if>
            <if test="ghi != null">ghi,</if>
            <if test="dni != null">dni,</if>
            <if test="dfi != null">dfi,</if>
            <if test="poai != null">poai,</if>
            <if test="temperature != null">temperature,</if>
            <if test="panelTemperature != null">panel_temperature,</if>
            <if test="humidity != null">humidity,</if>
            <if test="pressure != null">pressure,</if>
            <if test="windSpeed != null">wind_speed,</if>
            <if test="windDir != null">wind_dir,</if>
            <if test="inverterRunCnt != null">inverter_run_cnt,</if>
            <if test="inerterStopCnt != null">inerter_stop_cnt,</if>
            <if test="invertFaultCnt != null">invert_fault_cnt,</if>
            <if test="totalEnergy != null">total_energy,</if>
            <if test="lastTotalEnergy != null">last_total_energy,</if>
            <if test="todayEnergy != null">today_energy,</if>
            <if test="rtuNo != null">rtu_no,</if>
            <if test="name != null">name,</if>
            <if test="ref != null">ref,</if>
            <if test="pcurveStatTime != null">pcurve_stat_time,</if>
            <if test="nwpCalcTime != null">nwp_calc_time,</if>
            <if test="daPredictionTime != null">da_prediction_time,</if>
            <if test="daDayStatTime != null">da_day_stat_time,</if>
            <if test="daMonthStatTime != null">da_month_stat_time,</if>
            <if test="uspPredictionTime != null">usp_prediction_time,</if>
            <if test="uspDayStatTime != null">usp_day_stat_time,</if>
            <if test="uspMonthStatTime != null">usp_month_stat_time,</if>
            <if test="companyNo != null">company_no,</if>
            <if test="site != null">site,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="pvStationNo != null">#{pvStationNo},</if>
            <if test="ratingPower != null">#{ratingPower},</if>
            <if test="confirmPower != null">#{confirmPower},</if>
            <if test="inverterCnt != null">#{inverterCnt},</if>
            <if test="junctionBoxCnt != null">#{junctionBoxCnt},</if>
            <if test="pvCellCnt != null">#{pvCellCnt},</if>
            <if test="longtitude != null">#{longtitude},</if>
            <if test="latitude != null">#{latitude},</if>
            <if test="elevation != null">#{elevation},</if>
            <if test="poaSlopeAngle != null">#{poaSlopeAngle},</if>
            <if test="poaAzimuthAngle != null">#{poaAzimuthAngle},</if>
            <if test="reflectionRatio != null">#{reflectionRatio},</if>
            <if test="tempCoeff != null">#{tempCoeff},</if>
            <if test="apYcNo != null">#{apYcNo},</if>
            <if test="ghiYcNo != null">#{ghiYcNo},</if>
            <if test="dniYcNo != null">#{dniYcNo},</if>
            <if test="dfiYcNo != null">#{dfiYcNo},</if>
            <if test="poaiYcNo != null">#{poaiYcNo},</if>
            <if test="temperatureYcNo != null">#{temperatureYcNo},</if>
            <if test="panelTempYcNo != null">#{panelTempYcNo},</if>
            <if test="humidityYcNo != null">#{humidityYcNo},</if>
            <if test="pressureYcNo != null">#{pressureYcNo},</if>
            <if test="wspeedYcNo != null">#{wspeedYcNo},</if>
            <if test="wdirYcNo != null">#{wdirYcNo},</if>
            <if test="positiveError != null">#{positiveError},</if>
            <if test="negativeError != null">#{negativeError},</if>
            <if test="nwpLfA != null">#{nwpLfA},</if>
            <if test="pcurveSampleCnt != null">#{pcurveSampleCnt},</if>
            <if test="pcurveLfA != null">#{pcurveLfA},</if>
            <if test="pcurveInputFlag != null">#{pcurveInputFlag},</if>
            <if test="pcurveHlCnt != null">#{pcurveHlCnt},</if>
            <if test="uspSampleCnt != null">#{uspSampleCnt},</if>
            <if test="corrSampleCnt != null">#{corrSampleCnt},</if>
            <if test="gamma != null">#{gamma},</if>
            <if test="cost != null">#{cost},</if>
            <if test="nu != null">#{nu},</if>
            <if test="spaceDim != null">#{spaceDim},</if>
            <if test="uspCorrectionFlag != null">#{uspCorrectionFlag},</if>
            <if test="totalPower != null">#{totalPower},</if>
            <if test="pccPower != null">#{pccPower},</if>
            <if test="ghi != null">#{ghi},</if>
            <if test="dni != null">#{dni},</if>
            <if test="dfi != null">#{dfi},</if>
            <if test="poai != null">#{poai},</if>
            <if test="temperature != null">#{temperature},</if>
            <if test="panelTemperature != null">#{panelTemperature},</if>
            <if test="humidity != null">#{humidity},</if>
            <if test="pressure != null">#{pressure},</if>
            <if test="windSpeed != null">#{windSpeed},</if>
            <if test="windDir != null">#{windDir},</if>
            <if test="inverterRunCnt != null">#{inverterRunCnt},</if>
            <if test="inerterStopCnt != null">#{inerterStopCnt},</if>
            <if test="invertFaultCnt != null">#{invertFaultCnt},</if>
            <if test="totalEnergy != null">#{totalEnergy},</if>
            <if test="lastTotalEnergy != null">#{lastTotalEnergy},</if>
            <if test="todayEnergy != null">#{todayEnergy},</if>
            <if test="rtuNo != null">#{rtuNo},</if>
            <if test="name != null">#{name},</if>
            <if test="ref != null">#{ref},</if>
            <if test="pcurveStatTime != null">#{pcurveStatTime},</if>
            <if test="nwpCalcTime != null">#{nwpCalcTime},</if>
            <if test="daPredictionTime != null">#{daPredictionTime},</if>
            <if test="daDayStatTime != null">#{daDayStatTime},</if>
            <if test="daMonthStatTime != null">#{daMonthStatTime},</if>
            <if test="uspPredictionTime != null">#{uspPredictionTime},</if>
            <if test="uspDayStatTime != null">#{uspDayStatTime},</if>
            <if test="uspMonthStatTime != null">#{uspMonthStatTime},</if>
            <if test="companyNo != null">#{companyNo},</if>
            <if test="site != null">#{site},</if>
         </trim>
    </insert>

    <update id="updatePvPowerStation" parameterType="PvPowerStation">
        update pv_power_station
        <trim prefix="SET" suffixOverrides=",">
            <if test="ratingPower != null">rating_power = #{ratingPower},</if>
            <if test="confirmPower != null">confirm_power = #{confirmPower},</if>
            <if test="inverterCnt != null">inverter_cnt = #{inverterCnt},</if>
            <if test="junctionBoxCnt != null">junction_box_cnt = #{junctionBoxCnt},</if>
            <if test="pvCellCnt != null">pv_cell_cnt = #{pvCellCnt},</if>
            <if test="longtitude != null">longtitude = #{longtitude},</if>
            <if test="latitude != null">latitude = #{latitude},</if>
            <if test="elevation != null">elevation = #{elevation},</if>
            <if test="poaSlopeAngle != null">poa_slope_angle = #{poaSlopeAngle},</if>
            <if test="poaAzimuthAngle != null">poa_azimuth_angle = #{poaAzimuthAngle},</if>
            <if test="reflectionRatio != null">reflection_ratio = #{reflectionRatio},</if>
            <if test="tempCoeff != null">temp_coeff = #{tempCoeff},</if>
            <if test="apYcNo != null">ap_yc_no = #{apYcNo},</if>
            <if test="ghiYcNo != null">ghi_yc_no = #{ghiYcNo},</if>
            <if test="dniYcNo != null">dni_yc_no = #{dniYcNo},</if>
            <if test="dfiYcNo != null">dfi_yc_no = #{dfiYcNo},</if>
            <if test="poaiYcNo != null">poai_yc_no = #{poaiYcNo},</if>
            <if test="temperatureYcNo != null">temperature_yc_no = #{temperatureYcNo},</if>
            <if test="panelTempYcNo != null">panel_temp_yc_no = #{panelTempYcNo},</if>
            <if test="humidityYcNo != null">humidity_yc_no = #{humidityYcNo},</if>
            <if test="pressureYcNo != null">pressure_yc_no = #{pressureYcNo},</if>
            <if test="wspeedYcNo != null">wspeed_yc_no = #{wspeedYcNo},</if>
            <if test="wdirYcNo != null">wdir_yc_no = #{wdirYcNo},</if>
            <if test="positiveError != null">positive_error = #{positiveError},</if>
            <if test="negativeError != null">negative_error = #{negativeError},</if>
            <if test="nwpLfA != null">nwp_lf_a = #{nwpLfA},</if>
            <if test="pcurveSampleCnt != null">pcurve_sample_cnt = #{pcurveSampleCnt},</if>
            <if test="pcurveLfA != null">pcurve_lf_a = #{pcurveLfA},</if>
            <if test="pcurveInputFlag != null">pcurve_input_flag = #{pcurveInputFlag},</if>
            <if test="pcurveHlCnt != null">pcurve_hl_cnt = #{pcurveHlCnt},</if>
            <if test="uspSampleCnt != null">usp_sample_cnt = #{uspSampleCnt},</if>
            <if test="corrSampleCnt != null">corr_sample_cnt = #{corrSampleCnt},</if>
            <if test="gamma != null">gamma = #{gamma},</if>
            <if test="cost != null">cost = #{cost},</if>
            <if test="nu != null">nu = #{nu},</if>
            <if test="spaceDim != null">space_dim = #{spaceDim},</if>
            <if test="uspCorrectionFlag != null">usp_correction_flag = #{uspCorrectionFlag},</if>
            <if test="totalPower != null">total_power = #{totalPower},</if>
            <if test="pccPower != null">pcc_power = #{pccPower},</if>
            <if test="ghi != null">ghi = #{ghi},</if>
            <if test="dni != null">dni = #{dni},</if>
            <if test="dfi != null">dfi = #{dfi},</if>
            <if test="poai != null">poai = #{poai},</if>
            <if test="temperature != null">temperature = #{temperature},</if>
            <if test="panelTemperature != null">panel_temperature = #{panelTemperature},</if>
            <if test="humidity != null">humidity = #{humidity},</if>
            <if test="pressure != null">pressure = #{pressure},</if>
            <if test="windSpeed != null">wind_speed = #{windSpeed},</if>
            <if test="windDir != null">wind_dir = #{windDir},</if>
            <if test="inverterRunCnt != null">inverter_run_cnt = #{inverterRunCnt},</if>
            <if test="inerterStopCnt != null">inerter_stop_cnt = #{inerterStopCnt},</if>
            <if test="invertFaultCnt != null">invert_fault_cnt = #{invertFaultCnt},</if>
            <if test="totalEnergy != null">total_energy = #{totalEnergy},</if>
            <if test="lastTotalEnergy != null">last_total_energy = #{lastTotalEnergy},</if>
            <if test="todayEnergy != null">today_energy = #{todayEnergy},</if>
            <if test="rtuNo != null">rtu_no = #{rtuNo},</if>
            <if test="name != null">name = #{name},</if>
            <if test="ref != null">ref = #{ref},</if>
            <if test="pcurveStatTime != null">pcurve_stat_time = #{pcurveStatTime},</if>
            <if test="nwpCalcTime != null">nwp_calc_time = #{nwpCalcTime},</if>
            <if test="daPredictionTime != null">da_prediction_time = #{daPredictionTime},</if>
            <if test="daDayStatTime != null">da_day_stat_time = #{daDayStatTime},</if>
            <if test="daMonthStatTime != null">da_month_stat_time = #{daMonthStatTime},</if>
            <if test="uspPredictionTime != null">usp_prediction_time = #{uspPredictionTime},</if>
            <if test="uspDayStatTime != null">usp_day_stat_time = #{uspDayStatTime},</if>
            <if test="uspMonthStatTime != null">usp_month_stat_time = #{uspMonthStatTime},</if>
            <if test="companyNo != null">company_no = #{companyNo},</if>
            <if test="site != null">site = #{site},</if>
        </trim>
        where pv_station_no = #{pvStationNo}
    </update>

    <delete id="deletePvPowerStationById" parameterType="Long">
        delete from pv_power_station where pv_station_no = #{pvStationNo}
    </delete>

    <delete id="deletePvPowerStationByIds" parameterType="String">
        delete from pv_power_station where pv_station_no in 
        <foreach item="pvStationNo" collection="array" open="(" separator="," close=")">
            #{pvStationNo}
        </foreach>
    </delete>
</mapper>