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

    <resultMap type="WfYcHistoryData1" id="WfYcHistoryData1Result">
        <result property="analogNo" column="analog_no"/>
        <result property="dataTime" column="data_time"/>
        <result property="ycRawVal" column="yc_raw_val"/>
        <result property="ycVal" column="yc_val"/>
        <result property="dataFlag" column="data_flag"/>
    </resultMap>

    <sql id="selectWfYcHistoryData1Vo">
        select analog_no, data_time, yc_raw_val, yc_val, data_flag from wf_yc_history_data1
    </sql>

    <select id="selectWfYcHistoryData1List" parameterType="WfYcHistoryData1" resultMap="WfYcHistoryData1Result">
        <include refid="selectWfYcHistoryData1Vo"/>
        <where>
            <if test="analogNo != null ">and analog_no = #{analogNo}</if>
            <if test="ycRawVal != null ">and yc_raw_val = #{ycRawVal}</if>
            <if test="ycVal != null ">and yc_val = #{ycVal}</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="selectWfYcHistoryData1ById" parameterType="Long" resultMap="WfYcHistoryData1Result">
        <include refid="selectWfYcHistoryData1Vo"/>
        where analog_no = #{analogNo}
    </select>

    <select id="selectWfYcHistoryData1" parameterType="WfYcHistoryData1" resultMap="WfYcHistoryData1Result">
        <include refid="selectWfYcHistoryData1Vo"/>
        where analog_no = #{analogNo} and data_time = #{dateTime}
    </select>

    <select id="selectWfYcHistoryData11" parameterType="WfYcHistoryData1" resultMap="WfYcHistoryData1Result">
        <include refid="selectWfYcHistoryData1Vo"/>
        where analog_no = #{analogNo} and data_time > #{dateTime}
    </select>

</mapper>