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

    <resultMap type="AreaUspTsPeriodData" id="AreaUspTsPeriodDataResult">
        <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="power" column="power"/>
        <result property="modPower" column="mod_power"/>
        <result property="dataFlag" column="data_flag"/>
    </resultMap>

    <sql id="selectAreaUspTsPeriodDataVo">
        select area_no, model_no, time_scale, data_time, wind_speed, mod_coeff, power, mod_power, data_flag from area_usp_ts_period_data
    </sql>

    <select id="selectAreaUspTsPeriodDataList" parameterType="AreaUspTsPeriodData"
            resultMap="AreaUspTsPeriodDataResult">
        <include refid="selectAreaUspTsPeriodDataVo"/>
        <where>
            <if test="windSpeed != null ">and wind_speed = #{windSpeed}</if>
            <if test="modCoeff != null ">and mod_coeff = #{modCoeff}</if>
            <if test="power != null ">and power = #{power}</if>
            <if test="modPower != null ">and mod_power = #{modPower}</if>
            <if test="dataFlag != null ">and data_flag = #{dataFlag}</if>
        </where>
    </select>

    <select id="selectAreaUspTsPeriodDataById" parameterType="Long" resultMap="AreaUspTsPeriodDataResult">
        <include refid="selectAreaUspTsPeriodDataVo"/>
        where area_no = #{areaNo}
    </select>

</mapper>