地质所 沉降监测网建设项目
zmk
2024-05-15 9e3afc6d0fa514f986d3fea40fa23124e6fb5070
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
212
213
<?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="com.javaweb.geo.mapper.HoleMapper">
    
    <resultMap type="Hole" id="HoleResult">
        <result property="ids"    column="ids"    />
        <result property="projectId"    column="project_id"    />
        <result property="code"    column="code"    />
        <result property="createTime"    column="create_time"    />
        <result property="updateTime"    column="update_time"    />
        <result property="description"    column="description"    />
        <result property="type"    column="type"    />
        <result property="elevation"    column="elevation"    />
        <result property="depth"    column="depth"    />
        <result property="longitude"    column="longitude"    />
        <result property="latitude"    column="latitude"    />
        <result property="surveyX"    column="survey_x"    />
        <result property="surveyY"    column="survey_y"    />
        <result property="surveyZ"    column="survey_z"    />
        <result property="surveyLatitude"    column="survey_latitude"    />
        <result property="surveyLongitude"    column="survey_longitude"    />
        <result property="mapLatitude"    column="map_latitude"    />
        <result property="mapLongitude"    column="map_longitude"    />
        <result property="mapTime"    column="map_time"    />
        <result property="position"    column="position"    />
        <result property="locateTime"    column="locate_time"    />
        <result property="reason"    column="reason"    />
        <result property="pic1"    column="pic1"    />
        <result property="pic2"    column="pic2"    />
        <result property="pic3"    column="pic3"    />
        <result property="status"    column="status"    />
        <result property="isDeleted"    column="is_deleted"    />
        <result property="isFlag"    column="is_flag"    />
    </resultMap>
 
    <sql id="selectHoleVo">
        select ids, project_id, code, create_time, update_time, description, type, elevation, depth, longitude, latitude, survey_x, survey_y, survey_z, survey_latitude, survey_longitude, map_latitude, map_longitude, map_time, position, locate_time, reason, pic1, pic2, pic3, status, is_deleted, is_flag from js_hole
    </sql>
 
    <select id="selectHoleList" parameterType="Hole" resultMap="HoleResult">
        <include refid="selectHoleVo"/>
        <where>  
            <if test="projectId != null  and projectId != ''"> and project_id = #{projectId}</if>
            <if test="code != null  and code != ''"> and code = #{code}</if>
            <if test="description != null  and description != ''"> and description = #{description}</if>
            <if test="type != null  and type != ''"> and type = #{type}</if>
            <if test="elevation != null  and elevation != ''"> and elevation = #{elevation}</if>
            <if test="depth != null "> and depth = #{depth}</if>
            <if test="longitude != null "> and longitude = #{longitude}</if>
            <if test="latitude != null "> and latitude = #{latitude}</if>
            <if test="surveyX != null "> and survey_x = #{surveyX}</if>
            <if test="surveyY != null "> and survey_y = #{surveyY}</if>
            <if test="surveyZ != null "> and survey_z = #{surveyZ}</if>
            <if test="surveyLatitude != null "> and survey_latitude = #{surveyLatitude}</if>
            <if test="surveyLongitude != null "> and survey_longitude = #{surveyLongitude}</if>
            <if test="mapLatitude != null  and mapLatitude != ''"> and map_latitude = #{mapLatitude}</if>
            <if test="mapLongitude != null  and mapLongitude != ''"> and map_longitude = #{mapLongitude}</if>
            <if test="mapTime != null "> and map_time = #{mapTime}</if>
            <if test="position != null  and position != ''"> and position = #{position}</if>
            <if test="locateTime != null "> and locate_time = #{locateTime}</if>
            <if test="reason != null  and reason != ''"> and reason = #{reason}</if>
            <if test="pic1 != null  and pic1 != ''"> and pic1 = #{pic1}</if>
            <if test="pic2 != null  and pic2 != ''"> and pic2 = #{pic2}</if>
            <if test="pic3 != null  and pic3 != ''"> and pic3 = #{pic3}</if>
            <if test="status != null  and status != ''"> and status = #{status}</if>
            <if test="isDeleted != null  and isDeleted != ''"> and is_deleted = #{isDeleted}</if>
            <if test="isFlag != null  and isFlag != ''"> and is_flag = #{isFlag}</if>
        </where>
    </select>
    
    <select id="selectHoleById" parameterType="String" resultMap="HoleResult">
        <include refid="selectHoleVo"/>
        where ids = #{ids}
    </select>
 
    <select id="selectHoleNumByProjectId" parameterType="String" resultType="int">
        select count(ids) from js_hole where project_id = #{projectId}
    </select>
    
    <select id="selectHoleBySerNum" resultMap="HoleResult">
    
       <include refid="selectHoleVo"/>
        where project_id = #{projectId} and code =#{code}
    </select>
 
    <select id="selectHoleNum" resultType="java.lang.Long">
        SELECT count(ids) FROM js_hole WHERE is_deleted = '0' AND project_id = any(SELECT ids FROM js_project WHERE `status` = '0' AND is_deleted = '0')
    </select>
 
    <select id="selectAllHoleNum" resultType="java.lang.Long">
        SELECT count(ids) FROM js_hole WHERE is_deleted = '0'
    </select>
 
    <select id="selectHoleListByFlag0" resultMap="HoleResult">
        <include refid="selectHoleVo"/> WHERE is_deleted = '0' and is_flag = '0'
    </select>
 
    <select id="selectHoleByProjectId" parameterType="String" resultMap="HoleResult">
        <include refid="selectHoleVo"/> WHERE project_id = #{projectId}
    </select>
 
    <insert id="insertHole" parameterType="Hole">
        insert into js_hole
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="ids != null  and ids != ''">ids,</if>
            <if test="projectId != null  and projectId != ''">project_id,</if>
            <if test="code != null  and code != ''">code,</if>
            <if test="createTime != null ">create_time,</if>
            <if test="updateTime != null ">update_time,</if>
            <if test="description != null  and description != ''">description,</if>
            <if test="type != null  and type != ''">type,</if>
            <if test="elevation != null  and elevation != ''">elevation,</if>
            <if test="depth != null ">depth,</if>
            <if test="longitude != null ">longitude,</if>
            <if test="latitude != null ">latitude,</if>
            <if test="surveyX != null ">survey_x,</if>
            <if test="surveyY != null ">survey_y,</if>
            <if test="surveyZ != null ">survey_z,</if>
            <if test="surveyLatitude != null ">survey_latitude,</if>
            <if test="surveyLongitude != null ">survey_longitude,</if>
            <if test="mapLatitude != null  and mapLatitude != ''">map_latitude,</if>
            <if test="mapLongitude != null  and mapLongitude != ''">map_longitude,</if>
            <if test="mapTime != null ">map_time,</if>
            <if test="position != null  and position != ''">position,</if>
            <if test="locateTime != null ">locate_time,</if>
            <if test="reason != null  and reason != ''">reason,</if>
            <if test="pic1 != null  and pic1 != ''">pic1,</if>
            <if test="pic2 != null  and pic2 != ''">pic2,</if>
            <if test="pic3 != null  and pic3 != ''">pic3,</if>
            <if test="status != null  and status != ''">status,</if>
            <if test="isDeleted != null  and isDeleted != ''">is_deleted,</if>
            <if test="isFlag != null  and isFlag != ''">is_flag,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="ids != null  and ids != ''">#{ids},</if>
            <if test="projectId != null  and projectId != ''">#{projectId},</if>
            <if test="code != null  and code != ''">#{code},</if>
            <if test="createTime != null ">#{createTime},</if>
            <if test="updateTime != null ">#{updateTime},</if>
            <if test="description != null  and description != ''">#{description},</if>
            <if test="type != null  and type != ''">#{type},</if>
            <if test="elevation != null  and elevation != ''">#{elevation},</if>
            <if test="depth != null ">#{depth},</if>
            <if test="longitude != null ">#{longitude},</if>
            <if test="latitude != null ">#{latitude},</if>
            <if test="surveyX != null ">#{surveyX},</if>
            <if test="surveyY != null ">#{surveyY},</if>
            <if test="surveyZ != null ">#{surveyZ},</if>
            <if test="surveyLatitude != null ">#{surveyLatitude},</if>
            <if test="surveyLongitude != null ">#{surveyLongitude},</if>
            <if test="mapLatitude != null  and mapLatitude != ''">#{mapLatitude},</if>
            <if test="mapLongitude != null  and mapLongitude != ''">#{mapLongitude},</if>
            <if test="mapTime != null ">#{mapTime},</if>
            <if test="position != null  and position != ''">#{position},</if>
            <if test="locateTime != null ">#{locateTime},</if>
            <if test="reason != null  and reason != ''">#{reason},</if>
            <if test="pic1 != null  and pic1 != ''">#{pic1},</if>
            <if test="pic2 != null  and pic2 != ''">#{pic2},</if>
            <if test="pic3 != null  and pic3 != ''">#{pic3},</if>
            <if test="status != null  and status != ''">#{status},</if>
            <if test="isDeleted != null  and isDeleted != ''">#{isDeleted},</if>
            <if test="isFlag != null  and isFlag != ''">#{isFlag},</if>
         </trim>
    </insert>
 
    <update id="updateHole" parameterType="Hole">
        update js_hole
        <trim prefix="SET" suffixOverrides=",">
            <if test="projectId != null  and projectId != ''">project_id = #{projectId},</if>
            <if test="code != null  and code != ''">code = #{code},</if>
            <if test="createTime != null ">create_time = #{createTime},</if>
            <if test="updateTime != null ">update_time = #{updateTime},</if>
            <if test="description != null  and description != ''">description = #{description},</if>
            <if test="type != null  and type != ''">type = #{type},</if>
            <if test="elevation != null  and elevation != ''">elevation = #{elevation},</if>
            <if test="depth != null ">depth = #{depth},</if>
            <if test="longitude != null ">longitude = #{longitude},</if>
            <if test="latitude != null ">latitude = #{latitude},</if>
            <if test="surveyX != null ">survey_x = #{surveyX},</if>
            <if test="surveyY != null ">survey_y = #{surveyY},</if>
            <if test="surveyZ != null ">survey_z = #{surveyZ},</if>
            <if test="surveyLatitude != null ">survey_latitude = #{surveyLatitude},</if>
            <if test="surveyLongitude != null ">survey_longitude = #{surveyLongitude},</if>
            <if test="mapLatitude != null  and mapLatitude != ''">map_latitude = #{mapLatitude},</if>
            <if test="mapLongitude != null  and mapLongitude != ''">map_longitude = #{mapLongitude},</if>
            <if test="mapTime != null ">map_time = #{mapTime},</if>
            <if test="position != null  and position != ''">position = #{position},</if>
            <if test="locateTime != null ">locate_time = #{locateTime},</if>
            <if test="reason != null  and reason != ''">reason = #{reason},</if>
            <if test="pic1 != null  and pic1 != ''">pic1 = #{pic1},</if>
            <if test="pic2 != null  and pic2 != ''">pic2 = #{pic2},</if>
            <if test="pic3 != null  and pic3 != ''">pic3 = #{pic3},</if>
            <if test="status != null  and status != ''">status = #{status},</if>
            <if test="isDeleted != null  and isDeleted != ''">is_deleted = #{isDeleted},</if>
            <if test="isFlag != null  and isFlag != ''">is_flag = #{isFlag},</if>
        </trim>
        where ids = #{ids}
    </update>
 
    <delete id="deleteHoleById" parameterType="String">
        delete from js_hole where ids = #{ids}
    </delete>
 
    <delete id="deleteHoleByIds" parameterType="String">
        delete from js_hole where ids in 
        <foreach item="ids" collection="array" open="(" separator="," close=")">
            #{ids}
        </foreach>
    </delete>
    
</mapper>