nnnjjj123
2021-01-06 3b67e70f41bac39d1d74d2039a2fb286a32a8d41
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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
<?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.jingdan.mapper.JingdanMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="jingdanResultMap" type="org.springblade.modules.jingdan.vo.JingdanVO">
        <id column="id" property="id"/>
        <result column="galarmPeople" property="galarmPeople"/>
        <result column="phoneNumber" property="phoneNumber"/>
        <result column="place" property="place"/>
        <result column="content" property="content"/>
        <result column="galarmTime" property="galarmTime"/>
        <result column="waringType" property="waringType"/>
        <result column="deviceNumber" property="deviceNumber"/>
        <result column="type" property="type"/>
        <result column="handleP" property="handleP"/>
        <result column="handleTime" property="handleTime"/>
        <result column="handName" property="handName"/>
        <result column="level" property="level"/>
        <result column="coordinate" property="coordinate"/>
        <result column="jd" property="jd"/>
        <result column="wd" property="wd"/>
        <result column="addvcd" property="addvcd"/>
        <result column="rName" property="rName"/>
        <result column="handletype" property="handletype"/>
    </resultMap>
 
 
    <select id="selectJingdanPage" resultMap="jingdanResultMap">
        select * from sys_jingdan where is_deleted = 0
    </select>
 
    <select id="selectList" resultMap="jingdanResultMap">
        SELECT j.id,j.galarmPeople,j.phoneNumber,j.place,j.content,j.galarmTime,j.waringType,j.deviceNumber,j.type,
        j.handleP,j.handleTime,j.handName,j.level,ST_ASTEXT(j.coordinate) as coordinate,j.jd,j.wd,j.addvcd,j.rName,
        d.addvnm FROM sys_jingdan j LEFT JOIN sys_district d on d.addvcds=j.addvcd where 1=1
        <if test="waringType!=null and waringType!=''">
            and j.waringType=#{waringType}
        </if>
        <if test="beginTime!=null and beginTime!=''">
            and j.galarmTime &gt;=#{beginTime}
        </if>
        <if test="endTime!=null and endTime!=''">
            and j.galarmTime &lt;=#{endTime}
        </if>
        <if test="addvcd!=null and addvcd!=''">
            and j.addvcd=#{addvcd}
        </if>
        <if test="type!=null and type!=''">
            and j.type=#{type}
        </if>
    </select>
 
    <select id="selectdInfo" resultMap="jingdanResultMap">
        SELECT j.id,j.galarmPeople,j.phoneNumber,j.place,j.content,j.galarmTime,j.waringType,j.deviceNumber,j.type,
        j.handleP,j.handleTime,j.handName,j.level,ST_ASTEXT(j.coordinate) as coordinate,j.jd,j.wd,j.addvcd,j.rName,j.handletype,
        d.addvnm FROM sys_jingdan j LEFT JOIN sys_district d on d.addvcds=j.addvcd where 1=1
        <if test="deviceNumber!=null and deviceNumber!=''">
            and j.deviceNumber=#{deviceNumber}
        </if>
        <if test="id!=null and id!=''">
            and j.id=#{id}
        </if>
    </select>
 
    <!--APP警单列表-->
    <select id="selectLists" resultMap="jingdanResultMap">
        SELECT j.id,j.galarmPeople,j.phoneNumber,j.place,j.content,j.galarmTime,j.waringType,j.deviceNumber,j.type,
        j.handleP,j.handleTime,j.handName,j.level,ST_ASTEXT(j.coordinate) as coordinate,j.jd,j.wd,j.addvcd,j.rName,j.handletype,
        d.addvnm FROM sys_jingdan j LEFT JOIN sys_district d on d.addvcds=j.addvcd where 1=1
        <if test="handleP!=null and handleP!=''">
            and j.handleP=#{handleP}
        </if>
        <if test="type!=null and type!=''">
            and j.type &gt;=#{type}
        </if>
    </select>
 
  <!--  <insert id="insert">
        insert into sys_jingdan(galarmPeople,phoneNumber,place,content,galarmTime,waringType,deviceNumber,type,
        handleP,handleTime,handName,level,coordinate,jd,wd,addvcd)
        values (#{galarmPeople},#{phoneNumber},#{place},#{content},#{galarmTime}
        ,#{waringType},#{deviceNumber},#{type},#{handleP},#{handleTime},
        #{handName},#{level},POINT(#{jd},#{wd}),#{jd},#{wd},#{addvcd})
    </insert>-->
 
 
    <sql id="key">
        <trim suffixOverrides=",">
            <if test="galarmPeople!=null and galarmPeople!=''">
                galarmPeople,
            </if>
            <if test="phoneNumber!=null and phoneNumber!=''">
                phoneNumber,
            </if>
            <if test="place!=null and place!=''">
                place,
            </if>
            <if test="content!=null and content!=''">
                content,
            </if>
            <if test="galarmTime!=null and galarmTime!=''">
                galarmTime,
            </if>
            <if test="waringType!=null and waringType!=''">
                waringType,
            </if>
            <if test="deviceNumber!=null and deviceNumber!=''">
                deviceNumber,
            </if>
            <if test="type!=null and type!=''">
                type,
            </if>
            <if test="handleP!=null and handleP!=''">
                handleP,
            </if>
            <if test="handleTime!=null and handleTime!=''">
                handleTime,
            </if>
            <if test="handName!=null and handName!=''">
                handName,
            </if>
            <if test="level!=null and level!=''">
                level,
            </if>
            <if test="coordinate=null and coordinate=''">
                coordinate,
            </if>
            <if test="jd!=null and jd!=''">
                jd,
            </if>
            <if test="wd!=null and wd!=''">
                wd,
            </if>
            <if test="addvcd!=null and addvcd!=''">
                addvcd,
            </if>
            <if test="rName!=null and rName!=''">
                rName,
            </if>
        </trim>
    </sql>
    <sql id="value">
        <trim suffixOverrides=",">
            <if test="galarmPeople!=null and galarmPeople!=''">
                #{galarmPeople},
            </if>
            <if test="phoneNumber!=null and phoneNumber!=''">
                #{phoneNumber},
            </if>
            <if test="place!=null and place!=''">
                #{place},
            </if>
            <if test="content!=null and content!=''">
                #{content},
            </if>
            <if test="galarmTime!=null and galarmTime!=''">
                #{galarmTime},
            </if>
            <if test="waringType!=null and waringType!=''">
                #{waringType},
            </if>
            <if test="deviceNumber!=null and deviceNumber!=''">
                #{deviceNumber},
            </if>
            <if test="type!=null and type!=''">
                #{type},
            </if>
            <if test="handleP!=null and handleP!=''">
                #{handleP},
            </if>
            <if test="handleTime!=null and handleTime!=''">
                #{handleTime},
            </if>
            <if test="handName!=null and handName!=''">
                #{handName},
            </if>
            <if test="level!=null and level!=''">
                #{level},
            </if>
            <if test="jd!=null and wd!=null">
                POINT(#{jd},#{wd}),
            </if>
            <if test="jd!=null and jd!=''">
                #{jd},
            </if>
            <if test="wd!=null and wd!=''">
                #{wd},
            </if>
            <if test="addvcd!=null and addvcd!=''">
                #{addvcd},
            </if>
            <if test="rName!=null and rName!=''">
                #{rName},
            </if>
        </trim>
    </sql>
    <insert id="insert">
        insert into sys_jingdan(<include refid="key"/>) values(<include refid="value"/>)
    </insert>
 
    <delete id="deletejd">
        delete * from sys_jingdan where  id=#{id}
    </delete>
 
 
    <update id="updateInfo" >
   UPDATE  sys_jingdan SET handleP=#{handleP},handName=#{handName},handletype=#{handletype},type=#{type} WHERE id=#{id}
</update>
 
</mapper>