guoshilong
2023-11-16 00165e5d50f47c99d9eb7c2fc784bef4d3f72aca
skjcmanager/skjcmanager-service/skjcmanager-nky/src/main/java/cn/gistack/nky/mapper/HstPredictMapper.xml
@@ -2,24 +2,45 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.gistack.nky.mapper.HstPredictMapper">
    <select id="getFutureData" resultType="cn.gistack.nky.entity.HstPredict">
        SELECT * FROM NKY_HST_PREDICT
    <select id="getFutureData" resultType="cn.gistack.nky.vo.HstPredictVO">
        SELECT NHP.*,acb."cd_nm" cdNm FROM NKY_HST_PREDICT NHP
        LEFT JOIN SJZT_MD."att_cd_base" acb ON acb."res_cd" = NHP.DAM_ID AND NHP.POINT_ID = acb."cd"
        WHERE DATE_FORMAT(create_time,'%Y-%m-%d')>= CURDATE()
        <if test="resCd != null and resCd !='' ">
            AND DAM_ID = #{resCd}
            AND NHP.DAM_ID = #{resCd}
        </if>
        <if test="type != null and type !='' and type == 1 ">
            AND type = #{type}
            AND NHP.type = #{type}
        </if>
        <if test="type != null and type !='' and type == 2">
            AND type = #{type}
            AND NHP.type = #{type}
        </if>
        <if test="type != null and type !='' and type == 3">
            AND (type = '3' or type = '4' or type = '5')
            AND (NHP.type = '3' or NHP.type = '4' or NHP.type = '5')
        </if>
        ORDER BY POINT_ID ASC
        ORDER BY NHP.POINT_ID ASC
    </select>
    <select id="getFutureDataWy" resultType="cn.gistack.nky.vo.HstPredictVO">
        SELECT NHP.*,awcb."cd_nm" cdNm FROM NKY_HST_PREDICT NHP
        LEFT JOIN SJZT_MD."att_wy_cd_base" awcb ON awcb."res_cd" = NHP.dam_id and awcb."cd" = NHP.point_id
        WHERE DATE_FORMAT(create_time,'%Y-%m-%d')>= CURDATE()
        <if test="resCd != null and resCd !='' ">
            AND NHP.DAM_ID = #{resCd}
        </if>
        <if test="type != null and type !='' and type == 1 ">
            AND NHP.type = #{type}
        </if>
        <if test="type != null and type !='' and type == 2">
            AND NHP.type = #{type}
        </if>
        <if test="type != null and type !='' and type == 3">
            AND (NHP.type = '3' or NHP.type = '4' or NHP.type = '5')
        </if>
        ORDER BY NHP.POINT_ID ASC
    </select>
    <select id="selectTodayData" resultType="cn.gistack.nky.entity.HstPredict">
        SELECT  * FROM NKY_HST_PREDICT