地质所 沉降监测网建设项目
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
<?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.SampleInfoMapper">
    
    <resultMap type="SampleInfo" id="SampleInfoResult">
        <result property="id"    column="id"    />
        <result property="projNo"    column="proj_no"    />
        <result property="holeNo"    column="hole_no"    />
        <result property="sampleNo"    column="sample_no"    />
        <result property="sampleStartDepth"    column="sample_start_depth"    />
        <result property="sampleEndDepth"    column="sample_end_depth"    />
        <result property="soilSampleState"    column="soil_sample_state"    />
        <result property="qualityLevel"    column="quality_level"    />
        <result property="samplingTool"    column="sampling_tool"    />
        <result property="samplingTime"    column="sampling_time"    />
        <result property="samplingProportion"    column="sampling_proportion"    />
        <result property="lithologicalName"    column="lithological_name"    />
        <result property="testType"    column="test_type"    />
        <result property="fillerPercent"    column="filler_percent"    />
        <result property="coreShape"    column="core_shape"    />
        <result property="lengthRangeSmall"    column="length_range_small"    />
        <result property="lengthRangeBig"    column="length_range_big"    />
        <result property="longitude"    column="longitude"    />
        <result property="latitude"    column="latitude"    />
        <result property="locationTime"    column="location_time"    />
        <result property="createTime"    column="create_time"    />
        <result property="updateTime"    column="update_time"    />
        <result property="remarks"    column="remarks"    />
        <result property="descriptor"    column="descriptor"    />
        <result property="driller"    column="driller"    />
        <result property="sampleImg"    column="sample_img"    />
        <result property="sampleVideo"    column="sample_video"    />
        <result property="delFlag"    column="del_flag"    />
        <result property="lithologicaltype"    column="lithologicalType"    />
        <result property="ishistory"    column="isHistory"    />
        <result property="recordNo"    column="record_no"    />
        <result property="recordType"    column="record_type"    />
    </resultMap>
 
    <sql id="selectSampleInfoVo">
        select id, proj_no, hole_no, sample_no, sample_start_depth, sample_end_depth, soil_sample_state, quality_level, sampling_tool, sampling_time, sampling_proportion, lithological_name, test_type, filler_percent, core_shape, length_range_small, length_range_big, longitude, latitude, location_time, create_time, update_time, remarks, descriptor, driller, sample_img, sample_video, del_flag, lithologicalType, isHistory, record_no, record_type from js_sample_info
    </sql>
 
    <select id="selectSampleInfoList" parameterType="SampleInfo" resultMap="SampleInfoResult">
        <include refid="selectSampleInfoVo"/>
        <where>  
            <if test="projNo != null  and projNo != ''"> and proj_no = #{projNo}</if>
            <if test="holeNo != null  and holeNo != ''"> and hole_no = #{holeNo}</if>
            <if test="sampleNo != null  and sampleNo != ''"> and sample_no = #{sampleNo}</if>
            <if test="sampleStartDepth != null "> and sample_start_depth = #{sampleStartDepth}</if>
            <if test="sampleEndDepth != null "> and sample_end_depth = #{sampleEndDepth}</if>
            <if test="soilSampleState != null  and soilSampleState != ''"> and soil_sample_state = #{soilSampleState}</if>
            <if test="qualityLevel != null  and qualityLevel != ''"> and quality_level = #{qualityLevel}</if>
            <if test="samplingTool != null  and samplingTool != ''"> and sampling_tool = #{samplingTool}</if>
            <if test="samplingTime != null "> and sampling_time = #{samplingTime}</if>
            <if test="samplingProportion != null  and samplingProportion != ''"> and sampling_proportion = #{samplingProportion}</if>
            <if test="lithologicalName != null  and lithologicalName != ''"> and lithological_name like concat('%', #{lithologicalName}, '%')</if>
            <if test="testType != null  and testType != ''"> and test_type = #{testType}</if>
            <if test="fillerPercent != null "> and filler_percent = #{fillerPercent}</if>
            <if test="coreShape != null  and coreShape != ''"> and core_shape = #{coreShape}</if>
            <if test="lengthRangeSmall != null  and lengthRangeSmall != ''"> and length_range_small = #{lengthRangeSmall}</if>
            <if test="lengthRangeBig != null  and lengthRangeBig != ''"> and length_range_big = #{lengthRangeBig}</if>
            <if test="longitude != null "> and longitude = #{longitude}</if>
            <if test="latitude != null "> and latitude = #{latitude}</if>
            <if test="locationTime != null "> and location_time = #{locationTime}</if>
            <if test="remarks != null  and remarks != ''"> and remarks = #{remarks}</if>
            <if test="descriptor != null  and descriptor != ''"> and descriptor = #{descriptor}</if>
            <if test="driller != null  and driller != ''"> and driller = #{driller}</if>
            <if test="sampleImg != null  and sampleImg != ''"> and sample_img = #{sampleImg}</if>
            <if test="sampleVideo != null  and sampleVideo != ''"> and sample_video = #{sampleVideo}</if>
            <if test="lithologicaltype != null  and lithologicaltype != ''"> and lithologicalType = #{lithologicaltype}</if>
            <if test="ishistory != null  and ishistory != ''"> and isHistory = #{ishistory}</if>
            <if test="recordNo != null  and recordNo != ''"> and record_no = #{recordNo}</if>
            <if test="recordType != null  and recordType != ''"> and record_type = #{recordType}</if>
        </where>
    </select>
    
    <select id="selectSampleInfoById" parameterType="String" resultMap="SampleInfoResult">
        <include refid="selectSampleInfoVo"/>
        where id = #{id}
    </select>
        
    <insert id="insertSampleInfo" parameterType="SampleInfo">
        insert into js_sample_info
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null  and id != ''">id,</if>
            <if test="projNo != null  and projNo != ''">proj_no,</if>
            <if test="holeNo != null  and holeNo != ''">hole_no,</if>
            <if test="sampleNo != null  and sampleNo != ''">sample_no,</if>
            <if test="sampleStartDepth != null ">sample_start_depth,</if>
            <if test="sampleEndDepth != null ">sample_end_depth,</if>
            <if test="soilSampleState != null  and soilSampleState != ''">soil_sample_state,</if>
            <if test="qualityLevel != null  and qualityLevel != ''">quality_level,</if>
            <if test="samplingTool != null  and samplingTool != ''">sampling_tool,</if>
            <if test="samplingTime != null ">sampling_time,</if>
            <if test="samplingProportion != null  and samplingProportion != ''">sampling_proportion,</if>
            <if test="lithologicalName != null  and lithologicalName != ''">lithological_name,</if>
            <if test="testType != null  and testType != ''">test_type,</if>
            <if test="fillerPercent != null ">filler_percent,</if>
            <if test="coreShape != null  and coreShape != ''">core_shape,</if>
            <if test="lengthRangeSmall != null  and lengthRangeSmall != ''">length_range_small,</if>
            <if test="lengthRangeBig != null  and lengthRangeBig != ''">length_range_big,</if>
            <if test="longitude != null ">longitude,</if>
            <if test="latitude != null ">latitude,</if>
            <if test="locationTime != null ">location_time,</if>
            <if test="createTime != null ">create_time,</if>
            <if test="updateTime != null ">update_time,</if>
            <if test="remarks != null  and remarks != ''">remarks,</if>
            <if test="descriptor != null  and descriptor != ''">descriptor,</if>
            <if test="driller != null  and driller != ''">driller,</if>
            <if test="sampleImg != null  and sampleImg != ''">sample_img,</if>
            <if test="sampleVideo != null  and sampleVideo != ''">sample_video,</if>
            <if test="delFlag != null  and delFlag != ''">del_flag,</if>
            <if test="lithologicaltype != null  and lithologicaltype != ''">lithologicalType,</if>
            <if test="ishistory != null  and ishistory != ''">isHistory,</if>
            <if test="recordNo != null  and recordNo != ''">record_no,</if>
            <if test="recordType != null  and recordType != ''">record_type,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="id != null  and id != ''">#{id},</if>
            <if test="projNo != null  and projNo != ''">#{projNo},</if>
            <if test="holeNo != null  and holeNo != ''">#{holeNo},</if>
            <if test="sampleNo != null  and sampleNo != ''">#{sampleNo},</if>
            <if test="sampleStartDepth != null ">#{sampleStartDepth},</if>
            <if test="sampleEndDepth != null ">#{sampleEndDepth},</if>
            <if test="soilSampleState != null  and soilSampleState != ''">#{soilSampleState},</if>
            <if test="qualityLevel != null  and qualityLevel != ''">#{qualityLevel},</if>
            <if test="samplingTool != null  and samplingTool != ''">#{samplingTool},</if>
            <if test="samplingTime != null ">#{samplingTime},</if>
            <if test="samplingProportion != null  and samplingProportion != ''">#{samplingProportion},</if>
            <if test="lithologicalName != null  and lithologicalName != ''">#{lithologicalName},</if>
            <if test="testType != null  and testType != ''">#{testType},</if>
            <if test="fillerPercent != null ">#{fillerPercent},</if>
            <if test="coreShape != null  and coreShape != ''">#{coreShape},</if>
            <if test="lengthRangeSmall != null  and lengthRangeSmall != ''">#{lengthRangeSmall},</if>
            <if test="lengthRangeBig != null  and lengthRangeBig != ''">#{lengthRangeBig},</if>
            <if test="longitude != null ">#{longitude},</if>
            <if test="latitude != null ">#{latitude},</if>
            <if test="locationTime != null ">#{locationTime},</if>
            <if test="createTime != null ">#{createTime},</if>
            <if test="updateTime != null ">#{updateTime},</if>
            <if test="remarks != null  and remarks != ''">#{remarks},</if>
            <if test="descriptor != null  and descriptor != ''">#{descriptor},</if>
            <if test="driller != null  and driller != ''">#{driller},</if>
            <if test="sampleImg != null  and sampleImg != ''">#{sampleImg},</if>
            <if test="sampleVideo != null  and sampleVideo != ''">#{sampleVideo},</if>
            <if test="delFlag != null  and delFlag != ''">#{delFlag},</if>
            <if test="lithologicaltype != null  and lithologicaltype != ''">#{lithologicaltype},</if>
            <if test="ishistory != null  and ishistory != ''">#{ishistory},</if>
            <if test="recordNo != null  and recordNo != ''">#{recordNo},</if>
            <if test="recordType != null  and recordType != ''">#{recordType},</if>
         </trim>
    </insert>
 
    <update id="updateSampleInfo" parameterType="SampleInfo">
        update js_sample_info
        <trim prefix="SET" suffixOverrides=",">
            <if test="projNo != null  and projNo != ''">proj_no = #{projNo},</if>
            <if test="holeNo != null  and holeNo != ''">hole_no = #{holeNo},</if>
            <if test="sampleNo != null  and sampleNo != ''">sample_no = #{sampleNo},</if>
            <if test="sampleStartDepth != null ">sample_start_depth = #{sampleStartDepth},</if>
            <if test="sampleEndDepth != null ">sample_end_depth = #{sampleEndDepth},</if>
            <if test="soilSampleState != null  and soilSampleState != ''">soil_sample_state = #{soilSampleState},</if>
            <if test="qualityLevel != null  and qualityLevel != ''">quality_level = #{qualityLevel},</if>
            <if test="samplingTool != null  and samplingTool != ''">sampling_tool = #{samplingTool},</if>
            <if test="samplingTime != null ">sampling_time = #{samplingTime},</if>
            <if test="samplingProportion != null  and samplingProportion != ''">sampling_proportion = #{samplingProportion},</if>
            <if test="lithologicalName != null  and lithologicalName != ''">lithological_name = #{lithologicalName},</if>
            <if test="testType != null  and testType != ''">test_type = #{testType},</if>
            <if test="fillerPercent != null ">filler_percent = #{fillerPercent},</if>
            <if test="coreShape != null  and coreShape != ''">core_shape = #{coreShape},</if>
            <if test="lengthRangeSmall != null  and lengthRangeSmall != ''">length_range_small = #{lengthRangeSmall},</if>
            <if test="lengthRangeBig != null  and lengthRangeBig != ''">length_range_big = #{lengthRangeBig},</if>
            <if test="longitude != null ">longitude = #{longitude},</if>
            <if test="latitude != null ">latitude = #{latitude},</if>
            <if test="locationTime != null ">location_time = #{locationTime},</if>
            <if test="createTime != null ">create_time = #{createTime},</if>
            <if test="updateTime != null ">update_time = #{updateTime},</if>
            <if test="remarks != null  and remarks != ''">remarks = #{remarks},</if>
            <if test="descriptor != null  and descriptor != ''">descriptor = #{descriptor},</if>
            <if test="driller != null  and driller != ''">driller = #{driller},</if>
            <if test="sampleImg != null  and sampleImg != ''">sample_img = #{sampleImg},</if>
            <if test="sampleVideo != null  and sampleVideo != ''">sample_video = #{sampleVideo},</if>
            <if test="delFlag != null  and delFlag != ''">del_flag = #{delFlag},</if>
            <if test="lithologicaltype != null  and lithologicaltype != ''">lithologicalType = #{lithologicaltype},</if>
            <if test="ishistory != null  and ishistory != ''">isHistory = #{ishistory},</if>
            <if test="recordNo != null  and recordNo != ''">record_no = #{recordNo},</if>
            <if test="recordType != null  and recordType != ''">record_type = #{recordType},</if>
        </trim>
        where id = #{id}
    </update>
 
    <delete id="deleteSampleInfoById" parameterType="String">
        delete from js_sample_info where id = #{id}
    </delete>
 
    <delete id="deleteSampleInfoByIds" parameterType="String">
        delete from js_sample_info where id in 
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
    
</mapper>