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

    <resultMap type="PfEvaRulsMonthData" id="PfEvaRulsMonthDataResult">
        <result property="rtuNo" column="rtu_no"/>
        <result property="type" column="type"/>
        <result property="modelNo" column="model_no"/>
        <result property="dataTime" column="data_time"/>
        <result property="unlimitedCount" column="unlimited_count"/>
        <result property="accuracyRate" column="accuracy_rate"/>
        <result property="accuracyRateDl" column="accuracy_rate_dl"/>
        <result property="passCount" column="pass_count"/>
        <result property="passRate" column="pass_rate"/>
        <result property="passRateDl" column="pass_rate_dl"/>
        <result property="upSendCount" column="up_send_count"/>
        <result property="upSendRate" column="up_send_rate"/>
        <result property="upSendDl" column="up_send_dl"/>
        <result property="nrmse" column="nrmse"/>
        <result property="nmae" column="nmae"/>
        <result property="bias" column="bias"/>
        <result property="correlationCoeff" column="correlation_coeff"/>
        <result property="maxbias" column="maxbias"/>
        <result property="dataFlag" column="data_flag"/>
    </resultMap>

    <sql id="selectPfEvaRulsMonthDataVo">
        select rtu_no, type, model_no, data_time, unlimited_count, accuracy_rate, accuracy_rate_dl, pass_count, pass_rate, pass_rate_dl, up_send_count, up_send_rate, up_send_dl, nrmse, nmae, bias, correlation_coeff, maxbias, data_flag from pf_eva_ruls_month_data
    </sql>

    <select id="selectPfEvaRulsMonthDataList" parameterType="PfEvaRulsMonthData" resultMap="PfEvaRulsMonthDataResult">
        <include refid="selectPfEvaRulsMonthDataVo"/>
        <where>
            <if test="rtuNo != null ">and rtu_no = #{rtuNo}</if>
            <if test="modelNo != null ">and model_no = #{modelNo}</if>
            <if test="type != null ">and type = #{type}</if>
            <if test="unlimitedCount != null ">and unlimited_count = #{unlimitedCount}</if>
            <if test="accuracyRate != null ">and accuracy_rate = #{accuracyRate}</if>
            <if test="accuracyRateDl != null ">and accuracy_rate_dl = #{accuracyRateDl}</if>
            <if test="passCount != null ">and pass_count = #{passCount}</if>
            <if test="passRate != null ">and pass_rate = #{passRate}</if>
            <if test="passRateDl != null ">and pass_rate_dl = #{passRateDl}</if>
            <if test="upSendCount != null ">and up_send_count = #{upSendCount}</if>
            <if test="upSendRate != null ">and up_send_rate = #{upSendRate}</if>
            <if test="upSendDl != null ">and up_send_dl = #{upSendDl}</if>
            <if test="nrmse != null ">and nrmse = #{nrmse}</if>
            <if test="nmae != null ">and nmae = #{nmae}</if>
            <if test="bias != null ">and bias = #{bias}</if>
            <if test="correlationCoeff != null ">and correlation_coeff = #{correlationCoeff}</if>
            <if test="maxbias != null ">and maxbias = #{maxbias}</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="selectPfEvaRulsMonthDataById" parameterType="Long" resultMap="PfEvaRulsMonthDataResult">
        <include refid="selectPfEvaRulsMonthDataVo"/>
        where rtu_no = #{rtuNo}
    </select>

</mapper>