zrj
2024-07-11 6e4c8d00a3e745fdb910c2325840e3b88f634d21
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
<?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.alerts.alarmRule.mapper.FsRAtmtnFrcstInfMapper">
 
    <select id="getAtmtnInfo" resultType="cn.gistack.alerts.alarmRule.vo.FsRAtmtnFrcstInfVO">
        SELECT
            inf.FRCST_CD as frcstCd,
            inf.STCD,
            inf.FRCST_TM as frcstTm,
            inf.PBLSH_TM as pblshTm,
            inf.CNDTN ,
            inf.FRCST_USR_NM as frcstUsrNm,
            inf.PBLSH_UNT as pblshUnt,
            inf.PBLSH_TYP as pblshTyp,
            dt.TM,
            NVL( dt.Z, 0 ) AS TZ,
            NVL( dt.Q, 0 ) AS TQ
        FROM
            FRCST_SYS.FS_R_ATMTN_FRCST_DT dt
                LEFT JOIN FRCST_SYS.FS_R_ATMTN_FRCST_INF inf  ON dt.FRCST_CD = inf.FRCST_CD
        WHERE
            dt.TM BETWEEN SYSDATE
                AND SYSDATE + 3
        <if test="stcds != null and stcds.size()>0">
            AND inf.STCD in
            <foreach collection="stcds" index="index" item="item" open="(" separator="," close=")">
                #{item}
            </foreach>
        </if>
        ORDER BY
            dt.TM DESC
    </select>
    <select id="getAtmtnInfo1" resultType="cn.gistack.alerts.alarmRule.vo.FsRAtmtnFrcstInfVO">
        SELECT
            inf.FRCST_CD,
            inf.STCD,
            inf.FRCST_TM,
            inf.PBLSH_TM,
            inf.CNDTN,
            inf.FRCST_USR_NM,
            inf.PBLSH_UNT,
            inf.PBLSH_TYP,
            dt.TM,
            NVL( dt.Z, 0 ) AS TZ,
            NVL( dt.Q, 0 ) AS TQ,
            fl.FZ,
            fl.FZTM,
            fl.FQ,
            fl.FQTM,
            fl.RUNOFF,
            fl.CTM,
            fl.RF
        FROM
            FRCST_SYS.FS_R_ATMTN_FRCST_FLOODDT dt
                LEFT JOIN FRCST_SYS.FS_R_ATMTN_FRCST_INF inf  ON dt.FRCST_CD = inf.FRCST_CD
                LEFT JOIN FRCST_SYS.FS_R_ATMTN_FRCST_FLOOD fl ON dt.FRCST_CD = fl.FRCST_CD
        WHERE
            dt.TM BETWEEN SYSDATE
                AND SYSDATE + 3
          <if test="stcds != null and stcds.size()>0">
              AND inf.STCD in
              <foreach collection="stcds" index="index" item="item" open="(" separator="," close=")">
                  #{item}
              </foreach>
          </if>
        ORDER BY
            dt.TM DESC
    </select>
 
    <resultMap id="resultMap" type="cn.gistack.alerts.alarmRule.vo.FsRAtmtnFrcstInfVO">
        <id column="FRCST_CD" property="FRCST_CD"/>
        <result column="FRCST_CD" property="FRCST_CD"/>
        <result column="STCD" property="STCD"/>
        <result column="FRCST_USR_ID" property="FRCST_USR_ID"/>
        <result column="FRCST_USR_NM" property="FRCST_USR_NM"/>
        <result column="PBLSH_UNT" property="PBLSH_UNT"/>
        <result column="PBLSH_TYP" property="PBLSH_TYP"/>
        <result column="CNDTN" property="CNDTN"/>
        <result column="FRCST_TM" property="FRCST_TM"/>
        <result column="PBLSH_TM" property="PBLSH_TM"/>
        <result column="PBLSH_ID" property="PBLSH_ID"/>
 
        <result column="FZ" property="FZ"/>
        <result column="FZTM" property="FZTM"/>
        <result column="FQ" property="FQ"/>
        <result column="FQTM" property="FQTM"/>
        <result column="RUNOFF" property="RUNOFF"/>
        <result column="CTM" property="CTM"/>
        <result column="RF" property="RF"/>
<!--        <collection property="frcstDtVOS" ofType="cn.gistack.alerts.alarmRule.vo.FsRAtmtnFrcstDtVO" >-->
<!--            <id property="FRCST_CD" column="FRCST_CD"/>-->
<!--            <result column="TM" property="TM"/>-->
<!--            <result column="TZ" property="TZ"/>-->
<!--            <result column="TQ" property="TQ"/>-->
<!--        </collection>-->
        <collection property="frcstDtVOS" ofType="cn.gistack.alerts.alarmRule.vo.FsRAtmtnFrcstDtVO" column="FRCST_CD"  select="getFsRAtmtnFrcstDtVOs"/>
    </resultMap>
 
    <select id="getFsRAtmtnFrcstDtVOs" resultType="cn.gistack.alerts.alarmRule.vo.FsRAtmtnFrcstDtVO">
        select dt.TM, NVL(dt.Z,0) AS TZ, NVL(dt.Q,0) AS TQ from FRCST_SYS.FS_R_ATMTN_FRCST_FLOODDT dt where dt.FRCST_CD = #{FRCST_CD}
    </select>
    <select id="getStationInfo" resultType="cn.gistack.alerts.alarmRule.vo.StStbprpBVO">
        SELECT
            b.STCD,
            b.STNM,
            b.RVNM,
            NVL( rb.WRZ, 0 ) AS WRZ,
            NVL( rb.GRZ, 0 ) AS GRZ,
            NVL( srb.FSLTDZ, 0 )AS FSLTDZ ,
            NVL( chb.DSFLZ, 0 ) AS SFLZ
        FROM
            RWDBSYSDBA.ST_STBPRP_B b
                LEFT JOIN RWDBSYSDBA.ST_RVFCCH_B rb ON b.STCD = rb.STCD
                LEFT JOIN RWDBSYSDBA.ST_RSVRFSR_B srb ON b.STCD = srb.STCD
                LEFT JOIN RWDBSYSDBA.ST_RSVRFCCH_B chb ON b.STCD = chb.STCD
            where 1=1
              <if test="stcds != null and stcds.size()>0">
                  AND b.STCD in
                  <foreach collection="stcds" index="index" item="item" open="(" separator="," close=")">
                      #{item}
                  </foreach>
              </if>
    </select>
    <select id="getStcdS" resultType="java.lang.String">
        SELECT
            b.STCD
        FROM
            RWDBSYSDBA.ST_STBPRP_B b where 1=1
            <if test="STCM != null and STCM != ''">
               and b.STNM LIKE '%${STCM}%' ;
            </if>
    </select>
</mapper>