shuishen
2021-09-07 d012d12ca32309ce3867511efc3b33a5790e9753
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
<?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="org.springblade.modules.water.mapper.WaterMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="stbprpBResultMap" type="org.springblade.modules.water.entity.water">
        <result column="id" property="id"/>
        <result column="parent_id" property="parentId"/>
        <result column="location" property="location"/>
        <result column="origin" property="origin"/>
        <result column="lng" property="lng"/>
        <result column="lat" property="lat"/>
        <result column="water" property="water"/>
        <result column="xh" property="xh"/>
    </resultMap>
 
    <!-- 模糊查询-->
    <select id="queryList" resultMap="stbprpBResultMap">
        select * from  coordinates where 1=1
        <if test="pid !=null and pid!=''">
            and parent_id=#{pid}
        </if>
 
        <if test="loc !=null and loc!=''">
            and location like '%${loc}%'
        </if>
        order by origin asc
    </select>
 
    <select id="selectInfo" resultType="int">
      SELECT COUNT(*) as number FROM coordinates WHERE parent_id=#{pid} and xh=#{num}
    </select>
 
    <delete id="deleteInfo">
     delete  from coordinates  WHERE parent_id=#{pid} and xh=#{num}
    </delete>
 
 
    <select id="selectInfoh" resultType="java.util.Map">
      SELECT * FROM sys_watersection WHERE stcd=#{stcd}
    </select>
 
    <!--查询河道实时水位-->
    <select id="selectZ" resultType="java.util.HashMap">
        SELECT top 1 Z FROM  dbo.river where stcd=#{stcd} ORDER BY TM DESC
    </select>
 
    <!--查询河道警戒水位-->
    <select id="selectJ" resultType="java.util.HashMap">
        SELECT ISNULL(WRZ,0) as WRZ,ISNULL(OBHTZ,0) as OBHTZ,ISNULL(HLZ,0) as HLZ FROM dbo.rvfcc where STCD=#{code}
    </select>
</mapper>