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

    <resultMap type="AreaPeriodData" id="AreaPeriodDataResult">
        <result property="areaNo" column="area_no"/>
        <result property="dataTime" column="data_time"/>
        <result property="p" column="p"/>
        <result property="windSpeed" column="wind_speed"/>
        <result property="temp" column="temp"/>
        <result property="dataFlag" column="data_flag"/>
    </resultMap>

    <sql id="selectAreaPeriodDataVo">
        select area_no, data_time, p, wind_speed, temp, data_flag from area_period_data
    </sql>

    <select id="selectAreaPeriodDataList" parameterType="AreaPeriodData" resultMap="AreaPeriodDataResult">
        <include refid="selectAreaPeriodDataVo"/>
        <where>
            <if test="areaNo != null ">and area_no = #{areaNo}</if>
            <if test="dataTime != null ">and data_time = #{dataTime}</if>
            <if test="p != null ">and p = #{p}</if>
            <if test="windSpeed != null ">and wind_speed = #{windSpeed}</if>
            <if test="temp != null ">and temp = #{temp}</if>
            <if test="dataFlag != null ">and data_flag = #{dataFlag}</if>
        </where>
    </select>

    <select id="selectAreaPeriodDataById" parameterType="Long" resultMap="AreaPeriodDataResult">
        <include refid="selectAreaPeriodDataVo"/>
        where area_no = #{areaNo}
    </select>

</mapper>