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

    <resultMap type="AreaUspEfTsPeriodData" id="AreaUspEfTsPeriodDataResult">
        <result property="areaNo" column="area_no"/>
        <result property="modelNo" column="model_no"/>
        <result property="timeScale" column="time_scale"/>
        <result property="dataTime" column="data_time"/>
        <result property="windSpeed" column="wind_speed"/>
        <result property="modCoeff" column="mod_coeff"/>
        <result property="energy" column="energy"/>
        <result property="modEnergy" column="mod_energy"/>
        <result property="dataFlag" column="data_flag"/>
    </resultMap>

    <sql id="selectAreaUspEfTsPeriodDataVo">
        select area_no, model_no, time_scale, data_time, wind_speed, mod_coeff, energy, mod_energy, data_flag from area_usp_ef_ts_period_data
    </sql>

    <select id="selectAreaUspEfTsPeriodDataList" parameterType="AreaUspEfTsPeriodData"
            resultMap="AreaUspEfTsPeriodDataResult">
        <include refid="selectAreaUspEfTsPeriodDataVo"/>
        <where>
            <if test="windSpeed != null ">and wind_speed = #{windSpeed}</if>
            <if test="modCoeff != null ">and mod_coeff = #{modCoeff}</if>
            <if test="energy != null ">and energy = #{energy}</if>
            <if test="modEnergy != null ">and mod_energy = #{modEnergy}</if>
            <if test="dataFlag != null ">and data_flag = #{dataFlag}</if>
        </where>
    </select>

    <select id="selectAreaUspEfTsPeriodDataById" parameterType="Long" resultMap="AreaUspEfTsPeriodDataResult">
        <include refid="selectAreaUspEfTsPeriodDataVo"/>
        where area_no = #{areaNo}
    </select>

</mapper>