guoshilong
2023-08-11 3c096d3cfd56a23e6794f30ccd150bfe19aa4ae8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?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="cn.gistack.nky.mapper.HstPredictMapper">
 
    <select id="getFutureData" resultType="cn.gistack.nky.entity.HstPredict">
        SELECT * FROM NKY_HST_PREDICT
        WHERE DATE_FORMAT(create_time,'%Y-%m-%d')>= CURDATE()
        <if test="resCd != null and resCd !='' ">
            AND DAM_ID = #{resCd}
        </if>
        <if test="type != null and type !='' and type == 1 ">
            AND type = #{type}
        </if>
        <if test="type != null and type !='' and type == 2">
            AND type = #{type}
        </if>
        <if test="type != null and type !='' and type == 3">
            AND (type = '3' or type = '4' or type = '5')
        </if>
    </select>
 
 
    <select id="selectTodayData" resultType="cn.gistack.nky.entity.HstPredict">
        SELECT  * FROM NKY_HST_PREDICT
        WHERE 1= 1
        <if test="entity.createTime != null ">
            AND   DATE_FORMAT(create_time,'%Y-%m-%d')>= DATE_FORMAT(#{entity.createTime},'%Y-%m-%d')
        </if>
        <if test="entity.damId != null and entity.damId != ''">
            AND DAM_ID = #{entity.damId}
        </if>
        <if test="entity.pointId != null and entity.pointId !=''">
            AND POINT_ID = #{entity.pointId}
        </if>
        <if test="entity.type != null and entity.type !='' ">
            AND type = #{entity.type}
        </if>
    </select>
</mapper>