地质所 沉降监测网建设项目
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
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
<?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.platform.mapper.HoleRecordMapper">
    
    <resultMap type="HoleRecord" id="HoleRecordResult">
        <result property="id"    column="id"    />
        <result property="recordNo"    column="record_no"    />
        <result property="projectId"    column="project_id"    />
        <result property="drillId"    column="drill_id"    />
        <result property="recordType"    column="record_type"    />
        <result property="startDepth"    column="start_depth"    />
        <result property="endDepth"    column="end_depth"    />
        <result property="drillMethod"    column="drill_method"    />
        <result property="protectMethod"    column="protect_method"    />
        <result property="drillAperture"    column="drill_aperture"    />
        <result property="soilQuality"    column="soil_quality"    />
        <result property="samplingMethod"    column="sampling_method"    />
        <result property="rockType"    column="rock_type"    />
        <result property="rockName"    column="rock_name"    />
        <result property="color"    column="color"    />
        <result property="particleShape"    column="particle_shape"    />
        <result property="particleArrange"    column="particle_arrange"    />
        <result property="particleGrade"    column="particle_grade"    />
        <result property="humidity"    column="humidity"    />
        <result property="density"    column="density"    />
        <result property="uniformity"    column="uniformity"    />
        <result property="state"    column="state"    />
        <result property="inclusions"    column="inclusions"    />
        <result property="generalSmallParticle"    column="general_small_particle"    />
        <result property="generalBigParticle"    column="general_big_particle"    />
        <result property="largerSmallParticle"    column="larger_small_particle"    />
        <result property="largerBigParticle"    column="larger_big_particle"    />
        <result property="biggestParticle"    column="biggest_particle"    />
        <result property="mainIngredient"    column="main_ingredient"    />
        <result property="secondIngredient"    column="second_ingredient"    />
        <result property="hardDegree"    column="hard_degree"    />
        <result property="completeDegree"    column="complete_degree"    />
        <result property="digProperty"    column="dig_property"    />
        <result property="drillLength"    column="drill_length"    />
        <result property="advanceStartDepth"    column="advance_start_depth"    />
        <result property="firstStartDepth"    column="first_start_depth"    />
        <result property="secondStartDepth"    column="second_start_depth"    />
        <result property="thirdStartDepth"    column="third_start_depth"    />
        <result property="advanceEndDepth"    column="advance_end_depth"    />
        <result property="firstEndDepth"    column="first_end_depth"    />
        <result property="secondEndDepth"    column="second_end_depth"    />
        <result property="thirdEndDepth"    column="third_end_depth"    />
        <result property="advanceHammerNumber"    column="advance_hammer_number"    />
        <result property="firstHammerNumber"    column="first_hammer_number"    />
        <result property="secondHammerNumber"    column="second_hammer_number"    />
        <result property="thirdHammerNumber"    column="third_hammer_number"    />
    </resultMap>
 
    <sql id="selectHoleRecordVo">
        select id, record_no, project_id, drill_id, record_type, start_depth, end_depth, drill_method, protect_method, drill_aperture, soil_quality, sampling_method, rock_type, rock_name, color, particle_shape, particle_arrange, particle_grade, humidity, density, uniformity, state, inclusions, general_small_particle, general_big_particle, larger_small_particle, larger_big_particle, biggest_particle, main_ingredient, second_ingredient, hard_degree, complete_degree, dig_property, drill_length, advance_start_depth, first_start_depth, second_start_depth, third_start_depth, advance_end_depth, first_end_depth, second_end_depth, third_end_depth, advance_hammer_number, first_hammer_number, second_hammer_number, third_hammer_number from js_hole_record
    </sql>
 
    <select id="selectHoleRecordList" parameterType="HoleRecord" resultMap="HoleRecordResult">
        <include refid="selectHoleRecordVo"/>
        <where>  
            <if test="recordNo != null  and recordNo != ''"> and record_no = #{recordNo}</if>
            <if test="projectId != null  and projectId != ''"> and project_id = #{projectId}</if>
            <if test="drillId != null  and drillId != ''"> and drill_id = #{drillId}</if>
            <if test="recordType != null  and recordType != ''"> and record_type = #{recordType}</if>
            <if test="startDepth != null "> and start_depth = #{startDepth}</if>
            <if test="endDepth != null "> and end_depth = #{endDepth}</if>
            <if test="drillMethod != null  and drillMethod != ''"> and drill_method = #{drillMethod}</if>
            <if test="protectMethod != null  and protectMethod != ''"> and protect_method = #{protectMethod}</if>
            <if test="drillAperture != null "> and drill_aperture = #{drillAperture}</if>
            <if test="soilQuality != null  and soilQuality != ''"> and soil_quality = #{soilQuality}</if>
            <if test="samplingMethod != null  and samplingMethod != ''"> and sampling_method = #{samplingMethod}</if>
            <if test="rockType != null  and rockType != ''"> and rock_type = #{rockType}</if>
            <if test="rockName != null  and rockName != ''"> and rock_name like concat('%', #{rockName}, '%')</if>
            <if test="color != null  and color != ''"> and color = #{color}</if>
            <if test="particleShape != null  and particleShape != ''"> and particle_shape = #{particleShape}</if>
            <if test="particleArrange != null  and particleArrange != ''"> and particle_arrange = #{particleArrange}</if>
            <if test="particleGrade != null  and particleGrade != ''"> and particle_grade = #{particleGrade}</if>
            <if test="humidity != null  and humidity != ''"> and humidity = #{humidity}</if>
            <if test="density != null  and density != ''"> and density = #{density}</if>
            <if test="uniformity != null  and uniformity != ''"> and uniformity = #{uniformity}</if>
            <if test="state != null  and state != ''"> and state = #{state}</if>
            <if test="inclusions != null  and inclusions != ''"> and inclusions = #{inclusions}</if>
            <if test="generalSmallParticle != null  and generalSmallParticle != ''"> and general_small_particle = #{generalSmallParticle}</if>
            <if test="generalBigParticle != null  and generalBigParticle != ''"> and general_big_particle = #{generalBigParticle}</if>
            <if test="largerSmallParticle != null  and largerSmallParticle != ''"> and larger_small_particle = #{largerSmallParticle}</if>
            <if test="largerBigParticle != null  and largerBigParticle != ''"> and larger_big_particle = #{largerBigParticle}</if>
            <if test="biggestParticle != null  and biggestParticle != ''"> and biggest_particle = #{biggestParticle}</if>
            <if test="mainIngredient != null  and mainIngredient != ''"> and main_ingredient = #{mainIngredient}</if>
            <if test="secondIngredient != null  and secondIngredient != ''"> and second_ingredient = #{secondIngredient}</if>
            <if test="hardDegree != null  and hardDegree != ''"> and hard_degree = #{hardDegree}</if>
            <if test="completeDegree != null  and completeDegree != ''"> and complete_degree = #{completeDegree}</if>
            <if test="digProperty != null  and digProperty != ''"> and dig_property = #{digProperty}</if>
            <if test="drillLength != null "> and drill_length = #{drillLength}</if>
            <if test="advanceStartDepth != null "> and advance_start_depth = #{advanceStartDepth}</if>
            <if test="firstStartDepth != null "> and first_start_depth = #{firstStartDepth}</if>
            <if test="secondStartDepth != null "> and second_start_depth = #{secondStartDepth}</if>
            <if test="thirdStartDepth != null "> and third_start_depth = #{thirdStartDepth}</if>
            <if test="advanceEndDepth != null "> and advance_end_depth = #{advanceEndDepth}</if>
            <if test="firstEndDepth != null "> and first_end_depth = #{firstEndDepth}</if>
            <if test="secondEndDepth != null "> and second_end_depth = #{secondEndDepth}</if>
            <if test="thirdEndDepth != null "> and third_end_depth = #{thirdEndDepth}</if>
            <if test="advanceHammerNumber != null "> and advance_hammer_number = #{advanceHammerNumber}</if>
            <if test="firstHammerNumber != null "> and first_hammer_number = #{firstHammerNumber}</if>
            <if test="secondHammerNumber != null "> and second_hammer_number = #{secondHammerNumber}</if>
            <if test="thirdHammerNumber != null "> and third_hammer_number = #{thirdHammerNumber}</if>
        </where>
    </select>
    
    <select id="selectHoleRecordById" parameterType="String" resultMap="HoleRecordResult">
        <include refid="selectHoleRecordVo"/>
        where id = #{id}
    </select>
        
    <insert id="insertHoleRecord" parameterType="HoleRecord">
        insert into js_hole_record
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null  and id != ''">id,</if>
            <if test="recordNo != null  and recordNo != ''">record_no,</if>
            <if test="projectId != null  and projectId != ''">project_id,</if>
            <if test="drillId != null  and drillId != ''">drill_id,</if>
            <if test="recordType != null  and recordType != ''">record_type,</if>
            <if test="startDepth != null ">start_depth,</if>
            <if test="endDepth != null ">end_depth,</if>
            <if test="drillMethod != null  and drillMethod != ''">drill_method,</if>
            <if test="protectMethod != null  and protectMethod != ''">protect_method,</if>
            <if test="drillAperture != null ">drill_aperture,</if>
            <if test="soilQuality != null  and soilQuality != ''">soil_quality,</if>
            <if test="samplingMethod != null  and samplingMethod != ''">sampling_method,</if>
            <if test="rockType != null  and rockType != ''">rock_type,</if>
            <if test="rockName != null  and rockName != ''">rock_name,</if>
            <if test="color != null  and color != ''">color,</if>
            <if test="particleShape != null  and particleShape != ''">particle_shape,</if>
            <if test="particleArrange != null  and particleArrange != ''">particle_arrange,</if>
            <if test="particleGrade != null  and particleGrade != ''">particle_grade,</if>
            <if test="humidity != null  and humidity != ''">humidity,</if>
            <if test="density != null  and density != ''">density,</if>
            <if test="uniformity != null  and uniformity != ''">uniformity,</if>
            <if test="state != null  and state != ''">state,</if>
            <if test="inclusions != null  and inclusions != ''">inclusions,</if>
            <if test="generalSmallParticle != null  and generalSmallParticle != ''">general_small_particle,</if>
            <if test="generalBigParticle != null  and generalBigParticle != ''">general_big_particle,</if>
            <if test="largerSmallParticle != null  and largerSmallParticle != ''">larger_small_particle,</if>
            <if test="largerBigParticle != null  and largerBigParticle != ''">larger_big_particle,</if>
            <if test="biggestParticle != null  and biggestParticle != ''">biggest_particle,</if>
            <if test="mainIngredient != null  and mainIngredient != ''">main_ingredient,</if>
            <if test="secondIngredient != null  and secondIngredient != ''">second_ingredient,</if>
            <if test="hardDegree != null  and hardDegree != ''">hard_degree,</if>
            <if test="completeDegree != null  and completeDegree != ''">complete_degree,</if>
            <if test="digProperty != null  and digProperty != ''">dig_property,</if>
            <if test="drillLength != null ">drill_length,</if>
            <if test="advanceStartDepth != null ">advance_start_depth,</if>
            <if test="firstStartDepth != null ">first_start_depth,</if>
            <if test="secondStartDepth != null ">second_start_depth,</if>
            <if test="thirdStartDepth != null ">third_start_depth,</if>
            <if test="advanceEndDepth != null ">advance_end_depth,</if>
            <if test="firstEndDepth != null ">first_end_depth,</if>
            <if test="secondEndDepth != null ">second_end_depth,</if>
            <if test="thirdEndDepth != null ">third_end_depth,</if>
            <if test="advanceHammerNumber != null ">advance_hammer_number,</if>
            <if test="firstHammerNumber != null ">first_hammer_number,</if>
            <if test="secondHammerNumber != null ">second_hammer_number,</if>
            <if test="thirdHammerNumber != null ">third_hammer_number,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="id != null  and id != ''">#{id},</if>
            <if test="recordNo != null  and recordNo != ''">#{recordNo},</if>
            <if test="projectId != null  and projectId != ''">#{projectId},</if>
            <if test="drillId != null  and drillId != ''">#{drillId},</if>
            <if test="recordType != null  and recordType != ''">#{recordType},</if>
            <if test="startDepth != null ">#{startDepth},</if>
            <if test="endDepth != null ">#{endDepth},</if>
            <if test="drillMethod != null  and drillMethod != ''">#{drillMethod},</if>
            <if test="protectMethod != null  and protectMethod != ''">#{protectMethod},</if>
            <if test="drillAperture != null ">#{drillAperture},</if>
            <if test="soilQuality != null  and soilQuality != ''">#{soilQuality},</if>
            <if test="samplingMethod != null  and samplingMethod != ''">#{samplingMethod},</if>
            <if test="rockType != null  and rockType != ''">#{rockType},</if>
            <if test="rockName != null  and rockName != ''">#{rockName},</if>
            <if test="color != null  and color != ''">#{color},</if>
            <if test="particleShape != null  and particleShape != ''">#{particleShape},</if>
            <if test="particleArrange != null  and particleArrange != ''">#{particleArrange},</if>
            <if test="particleGrade != null  and particleGrade != ''">#{particleGrade},</if>
            <if test="humidity != null  and humidity != ''">#{humidity},</if>
            <if test="density != null  and density != ''">#{density},</if>
            <if test="uniformity != null  and uniformity != ''">#{uniformity},</if>
            <if test="state != null  and state != ''">#{state},</if>
            <if test="inclusions != null  and inclusions != ''">#{inclusions},</if>
            <if test="generalSmallParticle != null  and generalSmallParticle != ''">#{generalSmallParticle},</if>
            <if test="generalBigParticle != null  and generalBigParticle != ''">#{generalBigParticle},</if>
            <if test="largerSmallParticle != null  and largerSmallParticle != ''">#{largerSmallParticle},</if>
            <if test="largerBigParticle != null  and largerBigParticle != ''">#{largerBigParticle},</if>
            <if test="biggestParticle != null  and biggestParticle != ''">#{biggestParticle},</if>
            <if test="mainIngredient != null  and mainIngredient != ''">#{mainIngredient},</if>
            <if test="secondIngredient != null  and secondIngredient != ''">#{secondIngredient},</if>
            <if test="hardDegree != null  and hardDegree != ''">#{hardDegree},</if>
            <if test="completeDegree != null  and completeDegree != ''">#{completeDegree},</if>
            <if test="digProperty != null  and digProperty != ''">#{digProperty},</if>
            <if test="drillLength != null ">#{drillLength},</if>
            <if test="advanceStartDepth != null ">#{advanceStartDepth},</if>
            <if test="firstStartDepth != null ">#{firstStartDepth},</if>
            <if test="secondStartDepth != null ">#{secondStartDepth},</if>
            <if test="thirdStartDepth != null ">#{thirdStartDepth},</if>
            <if test="advanceEndDepth != null ">#{advanceEndDepth},</if>
            <if test="firstEndDepth != null ">#{firstEndDepth},</if>
            <if test="secondEndDepth != null ">#{secondEndDepth},</if>
            <if test="thirdEndDepth != null ">#{thirdEndDepth},</if>
            <if test="advanceHammerNumber != null ">#{advanceHammerNumber},</if>
            <if test="firstHammerNumber != null ">#{firstHammerNumber},</if>
            <if test="secondHammerNumber != null ">#{secondHammerNumber},</if>
            <if test="thirdHammerNumber != null ">#{thirdHammerNumber},</if>
         </trim>
    </insert>
 
    <update id="updateHoleRecord" parameterType="HoleRecord">
        update js_hole_record
        <trim prefix="SET" suffixOverrides=",">
            <if test="recordNo != null  and recordNo != ''">record_no = #{recordNo},</if>
            <if test="projectId != null  and projectId != ''">project_id = #{projectId},</if>
            <if test="drillId != null  and drillId != ''">drill_id = #{drillId},</if>
            <if test="recordType != null  and recordType != ''">record_type = #{recordType},</if>
            <if test="startDepth != null ">start_depth = #{startDepth},</if>
            <if test="endDepth != null ">end_depth = #{endDepth},</if>
            <if test="drillMethod != null  and drillMethod != ''">drill_method = #{drillMethod},</if>
            <if test="protectMethod != null  and protectMethod != ''">protect_method = #{protectMethod},</if>
            <if test="drillAperture != null ">drill_aperture = #{drillAperture},</if>
            <if test="soilQuality != null  and soilQuality != ''">soil_quality = #{soilQuality},</if>
            <if test="samplingMethod != null  and samplingMethod != ''">sampling_method = #{samplingMethod},</if>
            <if test="rockType != null  and rockType != ''">rock_type = #{rockType},</if>
            <if test="rockName != null  and rockName != ''">rock_name = #{rockName},</if>
            <if test="color != null  and color != ''">color = #{color},</if>
            <if test="particleShape != null  and particleShape != ''">particle_shape = #{particleShape},</if>
            <if test="particleArrange != null  and particleArrange != ''">particle_arrange = #{particleArrange},</if>
            <if test="particleGrade != null  and particleGrade != ''">particle_grade = #{particleGrade},</if>
            <if test="humidity != null  and humidity != ''">humidity = #{humidity},</if>
            <if test="density != null  and density != ''">density = #{density},</if>
            <if test="uniformity != null  and uniformity != ''">uniformity = #{uniformity},</if>
            <if test="state != null  and state != ''">state = #{state},</if>
            <if test="inclusions != null  and inclusions != ''">inclusions = #{inclusions},</if>
            <if test="generalSmallParticle != null  and generalSmallParticle != ''">general_small_particle = #{generalSmallParticle},</if>
            <if test="generalBigParticle != null  and generalBigParticle != ''">general_big_particle = #{generalBigParticle},</if>
            <if test="largerSmallParticle != null  and largerSmallParticle != ''">larger_small_particle = #{largerSmallParticle},</if>
            <if test="largerBigParticle != null  and largerBigParticle != ''">larger_big_particle = #{largerBigParticle},</if>
            <if test="biggestParticle != null  and biggestParticle != ''">biggest_particle = #{biggestParticle},</if>
            <if test="mainIngredient != null  and mainIngredient != ''">main_ingredient = #{mainIngredient},</if>
            <if test="secondIngredient != null  and secondIngredient != ''">second_ingredient = #{secondIngredient},</if>
            <if test="hardDegree != null  and hardDegree != ''">hard_degree = #{hardDegree},</if>
            <if test="completeDegree != null  and completeDegree != ''">complete_degree = #{completeDegree},</if>
            <if test="digProperty != null  and digProperty != ''">dig_property = #{digProperty},</if>
            <if test="drillLength != null ">drill_length = #{drillLength},</if>
            <if test="advanceStartDepth != null ">advance_start_depth = #{advanceStartDepth},</if>
            <if test="firstStartDepth != null ">first_start_depth = #{firstStartDepth},</if>
            <if test="secondStartDepth != null ">second_start_depth = #{secondStartDepth},</if>
            <if test="thirdStartDepth != null ">third_start_depth = #{thirdStartDepth},</if>
            <if test="advanceEndDepth != null ">advance_end_depth = #{advanceEndDepth},</if>
            <if test="firstEndDepth != null ">first_end_depth = #{firstEndDepth},</if>
            <if test="secondEndDepth != null ">second_end_depth = #{secondEndDepth},</if>
            <if test="thirdEndDepth != null ">third_end_depth = #{thirdEndDepth},</if>
            <if test="advanceHammerNumber != null ">advance_hammer_number = #{advanceHammerNumber},</if>
            <if test="firstHammerNumber != null ">first_hammer_number = #{firstHammerNumber},</if>
            <if test="secondHammerNumber != null ">second_hammer_number = #{secondHammerNumber},</if>
            <if test="thirdHammerNumber != null ">third_hammer_number = #{thirdHammerNumber},</if>
        </trim>
        where id = #{id}
    </update>
 
    <delete id="deleteHoleRecordById" parameterType="String">
        delete from js_hole_record where id = #{id}
    </delete>
 
    <delete id="deleteHoleRecordByIds" parameterType="String">
        delete from js_hole_record where id in 
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
    
</mapper>