<?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.PvImmbNwpMapper">
    
    <resultMap type="PvImmbNwp" id="PvImmbNwpResult">
        <result property="pvNo"    column="pv_no"    />
        <result property="nwpType"    column="nwp_type"    />
        <result property="fileTime"    column="file_time"    />
        <result property="dataTime"    column="data_time"    />
        <result property="swRadiation"    column="sw_radiation"    />
        <result property="groundTemp"    column="ground_temp"    />
        <result property="temp2m"    column="temp_2m"    />
        <result property="hCloudCover"    column="h_cloud_cover"    />
        <result property="mCloudCover"    column="m_cloud_cover"    />
        <result property="lCloudCover"    column="l_cloud_cover"    />
        <result property="humidity2m"    column="humidity_2m"    />
        <result property="precipitition"    column="precipitition"    />
        <result property="snowfall"    column="snowfall"    />
        <result property="windSpeed"    column="wind_speed"    />
        <result property="windDir"    column="wind_dir"    />
        <result property="groundPressure"    column="ground_pressure"    />
        <result property="humidityRatio2m"    column="humidity_ratio_2m"    />
        <result property="rcsMratioVi"    column="rcs_mratio_vi"    />
        <result property="humidity500"    column="humidity_500"    />
        <result property="dewPoint850"    column="dew_point_850"    />
        <result property="dewPoint2m"    column="dew_point_2m"    />
        <result property="dewPointDeficit"    column="dew_point_deficit"    />
        <result property="dni"    column="dni"    />
        <result property="dfi"    column="dfi"    />
        <result property="weatherCondition"    column="weather_condition"    />
        <result property="dataFlag"    column="data_flag"    />
    </resultMap>

    <sql id="selectPvImmbNwpVo">
        select pv_no, nwp_type, file_time, data_time, sw_radiation, ground_temp, temp_2m, h_cloud_cover, m_cloud_cover, l_cloud_cover, humidity_2m, precipitition, snowfall, wind_speed, wind_dir, ground_pressure, humidity_ratio_2m, rcs_mratio_vi, humidity_500, dew_point_850, dew_point_2m, dew_point_deficit, dni, dfi, weather_condition, data_flag from pv_immb_nwp
    </sql>

    <select id="selectPvImmbNwpList" parameterType="PvImmbNwp" resultMap="PvImmbNwpResult">
        <include refid="selectPvImmbNwpVo"/>
        <where>
            <if test="pvNo != null ">and pv_no = #{pvNo}</if>
            <if test="nwpType != null ">and nwp_type = #{nwpType}</if>
            <if test="fileTime != null ">and file_time = #{fileTime}</if>
            <if test="swRadiation != null "> and sw_radiation = #{swRadiation}</if>
            <if test="groundTemp != null "> and ground_temp = #{groundTemp}</if>
            <if test="temp2m != null "> and temp_2m = #{temp2m}</if>
            <if test="hCloudCover != null "> and h_cloud_cover = #{hCloudCover}</if>
            <if test="mCloudCover != null "> and m_cloud_cover = #{mCloudCover}</if>
            <if test="lCloudCover != null "> and l_cloud_cover = #{lCloudCover}</if>
            <if test="humidity2m != null "> and humidity_2m = #{humidity2m}</if>
            <if test="precipitition != null "> and precipitition = #{precipitition}</if>
            <if test="snowfall != null "> and snowfall = #{snowfall}</if>
            <if test="windSpeed != null "> and wind_speed = #{windSpeed}</if>
            <if test="windDir != null "> and wind_dir = #{windDir}</if>
            <if test="groundPressure != null "> and ground_pressure = #{groundPressure}</if>
            <if test="humidityRatio2m != null "> and humidity_ratio_2m = #{humidityRatio2m}</if>
            <if test="rcsMratioVi != null "> and rcs_mratio_vi = #{rcsMratioVi}</if>
            <if test="humidity500 != null "> and humidity_500 = #{humidity500}</if>
            <if test="dewPoint850 != null "> and dew_point_850 = #{dewPoint850}</if>
            <if test="dewPoint2m != null "> and dew_point_2m = #{dewPoint2m}</if>
            <if test="dewPointDeficit != null "> and dew_point_deficit = #{dewPointDeficit}</if>
            <if test="dni != null "> and dni = #{dni}</if>
            <if test="dfi != null "> and dfi = #{dfi}</if>
            <if test="weatherCondition != null "> and weather_condition = #{weatherCondition}</if>
            <if test="dataFlag != null "> and data_flag = #{dataFlag}</if>
            <if test="params.beginDataTime != null and params.beginDataTime != '' and params.endDataTime != null and params.endDataTime != ''">
                and data_time between to_date(#{params.beginDataTime},'yyyy-MM-dd HH24:MI:SS') and
                to_date(#{params.endDataTime},'yyyy-MM-dd HH24:MI:SS')
            </if>
            <if test="dataTime != null ">and data_time = #{dataTime}</if>
        </where>
    </select>
    
    <select id="selectPvImmbNwpById" parameterType="Long" resultMap="PvImmbNwpResult">
        <include refid="selectPvImmbNwpVo"/>
        where pv_no = #{pvNo}
    </select>

</mapper>