地质所 沉降监测网建设项目
chenhuan
2024-05-16 0fdd42e318f51f9e3c6581473416af1cca69877f
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
<?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.ProjectInfoMapper">
    
    <resultMap type="ProjectInfo" id="ProjectInfoResult">
        <result property="id"    column="id"    />
        <result property="projectNo"    column="project_no"    />
        <result property="projectName"    column="project_name"    />
        <result property="constructionUnit"    column="construction_unit"    />
        <result property="exprorationUnit"    column="exproration_unit"    />
        <result property="serviceUnit"    column="service_unit"    />
        <result property="addressCode"    column="address_code"    />
        <result property="address"    column="address"    />
        <result property="projectLeader"    column="project_leader"    />
        <result property="projectEnginer"    column="project_enginer"    />
        <result property="startTime"    column="start_time"    />
        <result property="plannedTime"    column="planned_time"    />
        <result property="endTime"    column="end_time"    />
        <result property="projectPicture"    column="project_picture"    />
        <result property="surveyOutline"    column="survey_outline"    />
        <result property="safetyRequire"    column="safety_require"    />
        <result property="techRequire"    column="tech_require"    />
        <result property="state"    column="state"    />
        <result property="reason"    column="reason"    />
        <result property="serialNumber"    column="serial_number"    />
        <result property="isDeleted"    column="is_deleted"    />
        <result property="archiveNo"    column="archive_no"    />
        <result property="projectCategory"    column="project_category"    />
        <result property="projectIntroduction"    column="project_introduction"    />
        <result property="handInDate"    column="hand_in_date"    />
        <result property="handInPost"    column="hand_in_post"    />
        <result property="lng"    column="lng"    />
        <result property="lat"    column="lat"    />
        <result property="updateTime"    column="update_time"    />
        <result property="createTime"    column="create_time"    />
        <result property="createBy"    column="create_by"    />
         <result property="holeCount"    column="hole_count"    />
    </resultMap>
 
    <sql id="selectProjectInfoVo">
        select id, project_no, project_name, construction_unit, exproration_unit, service_unit, address_code, address, project_leader, project_enginer, start_time, planned_time, end_time, project_picture, survey_outline, safety_require, tech_require, state, reason, serial_number, is_deleted, archive_no, project_category, project_introduction, hand_in_date, hand_in_post, lng, lat, update_time, create_time, create_by,hole_count from js_project_info
    </sql>
 
    <select id="selectProjectInfoList" parameterType="ProjectInfo" resultMap="ProjectInfoResult">
        <include refid="selectProjectInfoVo"/>
        <where>  
            <if test="projectNo != null  and projectNo != ''"> and project_no = #{projectNo}</if>
            <if test="projectName != null  and projectName != ''"> and project_name like concat('%', #{projectName}, '%')</if>
            <if test="constructionUnit != null  and constructionUnit != ''"> and construction_unit like concat('%', #{constructionUnit}, '%')</if>
            <if test="exprorationUnit != null  and exprorationUnit != ''"> and exproration_unit = #{exprorationUnit}</if>
            <if test="serviceUnit != null  and serviceUnit != ''"> and service_unit = #{serviceUnit}</if>
            <if test="addressCode != null  and addressCode != ''"> and address_code = #{addressCode}</if>
            <if test="address != null  and address != ''"> and address like concat('%', #{address}, '%')</if>
            <if test="projectLeader != null  and projectLeader != ''"> and project_leader = #{projectLeader}</if>
            <if test="projectEnginer != null  and projectEnginer != ''"> and project_enginer = #{projectEnginer}</if>
            <if test="startTime != null "> and start_time &gt;= #{startTime}</if>
            <if test="plannedTime != null "> and planned_time = #{plannedTime}</if>
            <if test="endTime != null "> and end_time &lt;= #{endTime}</if>
            <if test="projectPicture != null  and projectPicture != ''"> and project_picture = #{projectPicture}</if>
            <if test="surveyOutline != null  and surveyOutline != ''"> and survey_outline = #{surveyOutline}</if>
            <if test="safetyRequire != null  and safetyRequire != ''"> and safety_require = #{safetyRequire}</if>
            <if test="techRequire != null  and techRequire != ''"> and tech_require = #{techRequire}</if>
            <if test="state != null  and state != ''"> and state = #{state}</if>
            <if test="reason != null  and reason != ''"> and reason = #{reason}</if>
            <if test="serialNumber != null  and serialNumber != ''"> and serial_number = #{serialNumber}</if>
            <if test="isDeleted != null  and isDeleted != ''"> and is_deleted = #{isDeleted}</if>
            <if test="archiveNo != null  and archiveNo != ''"> and archive_no = #{archiveNo}</if>
            <if test="projectCategory != null  and projectCategory != ''"> and project_category = #{projectCategory}</if>
            <if test="projectIntroduction != null  and projectIntroduction != ''"> and project_introduction = #{projectIntroduction}</if>
            <if test="handInDate != null "> and hand_in_date = #{handInDate}</if>
            <if test="handInPost != null  and handInPost != ''"> and hand_in_post = #{handInPost}</if>
            <if test="lng != null "> and lng = #{lng}</if>
            <if test="lat != null "> and lat = #{lat}</if>
        </where>
    </select>
    
    <select id="selectProjectInfoById" parameterType="String" resultMap="ProjectInfoResult">
        <include refid="selectProjectInfoVo"/>
        where id = #{id}
    </select>
    
     <select id="selectProjectInfoListByName" parameterType="String" resultMap="ProjectInfoResult">
        <include refid="selectProjectInfoVo"/>
        where project_name = #{projectName}
    </select>
    
     <select id="selectByPolygon" parameterType="String" resultMap="ProjectInfoResult">
          <include refid="selectProjectInfoVo"/>
           where ST_CONTAINS(GeomFromText(#{polygon}), location);
     </select>
     
     <select id="selectByPolygonContains" parameterType="String" resultMap="ProjectInfoResult">
          <include refid="selectProjectInfoVo"/>
           where MBRContains(#{polygon}, GeomFromText(location));
     </select>
          
     <select id="selectBynCircle" resultMap="ProjectInfoResult">
          <include refid="selectProjectInfoVo"/>
           WHERE  fun_distance(#{latitude},#{longitude} ,lat,lng) &lt; #{radius}
     </select>
     
     <select id="selectEmptyLnglat" resultMap="ProjectInfoResult">
       <include refid="selectProjectInfoVo"/> 
         where lng is null
     </select>
 
        
    <insert id="insertProjectInfo" parameterType="ProjectInfo">
        insert into js_project_info
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null  and id != ''">id,</if>
            <if test="projectNo != null  and projectNo != ''">project_no,</if>
            <if test="projectName != null  and projectName != ''">project_name,</if>
            <if test="constructionUnit != null  and constructionUnit != ''">construction_unit,</if>
            <if test="exprorationUnit != null  and exprorationUnit != ''">exproration_unit,</if>
            <if test="serviceUnit != null  and serviceUnit != ''">service_unit,</if>
            <if test="addressCode != null  and addressCode != ''">address_code,</if>
            <if test="address != null  and address != ''">address,</if>
            <if test="projectLeader != null  and projectLeader != ''">project_leader,</if>
            <if test="projectEnginer != null  and projectEnginer != ''">project_enginer,</if>
            <if test="startTime != null ">start_time,</if>
            <if test="plannedTime != null ">planned_time,</if>
            <if test="endTime != null ">end_time,</if>
            <if test="projectPicture != null  and projectPicture != ''">project_picture,</if>
            <if test="surveyOutline != null  and surveyOutline != ''">survey_outline,</if>
            <if test="safetyRequire != null  and safetyRequire != ''">safety_require,</if>
            <if test="techRequire != null  and techRequire != ''">tech_require,</if>
            <if test="state != null  and state != ''">state,</if>
            <if test="reason != null  and reason != ''">reason,</if>
            <if test="serialNumber != null  and serialNumber != ''">serial_number,</if>
            <if test="isDeleted != null  and isDeleted != ''">is_deleted,</if>
            <if test="archiveNo != null  and archiveNo != ''">archive_no,</if>
            <if test="projectCategory != null  and projectCategory != ''">project_category,</if>
            <if test="projectIntroduction != null  and projectIntroduction != ''">project_introduction,</if>
            <if test="handInDate != null ">hand_in_date,</if>
            <if test="handInPost != null  and handInPost != ''">hand_in_post,</if>
            <if test="lng != null ">lng,</if>
            <if test="lat != null ">lat,</if>
            <if test="updateTime != null ">update_time,</if>
            <if test="createTime != null ">create_time,</if>
            <if test="createBy != null  and createBy != ''">create_by,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="id != null  and id != ''">#{id},</if>
            <if test="projectNo != null  and projectNo != ''">#{projectNo},</if>
            <if test="projectName != null  and projectName != ''">#{projectName},</if>
            <if test="constructionUnit != null  and constructionUnit != ''">#{constructionUnit},</if>
            <if test="exprorationUnit != null  and exprorationUnit != ''">#{exprorationUnit},</if>
            <if test="serviceUnit != null  and serviceUnit != ''">#{serviceUnit},</if>
            <if test="addressCode != null  and addressCode != ''">#{addressCode},</if>
            <if test="address != null  and address != ''">#{address},</if>
            <if test="projectLeader != null  and projectLeader != ''">#{projectLeader},</if>
            <if test="projectEnginer != null  and projectEnginer != ''">#{projectEnginer},</if>
            <if test="startTime != null ">#{startTime},</if>
            <if test="plannedTime != null ">#{plannedTime},</if>
            <if test="endTime != null ">#{endTime},</if>
            <if test="projectPicture != null  and projectPicture != ''">#{projectPicture},</if>
            <if test="surveyOutline != null  and surveyOutline != ''">#{surveyOutline},</if>
            <if test="safetyRequire != null  and safetyRequire != ''">#{safetyRequire},</if>
            <if test="techRequire != null  and techRequire != ''">#{techRequire},</if>
            <if test="state != null  and state != ''">#{state},</if>
            <if test="reason != null  and reason != ''">#{reason},</if>
            <if test="serialNumber != null  and serialNumber != ''">#{serialNumber},</if>
            <if test="isDeleted != null  and isDeleted != ''">#{isDeleted},</if>
            <if test="archiveNo != null  and archiveNo != ''">#{archiveNo},</if>
            <if test="projectCategory != null  and projectCategory != ''">#{projectCategory},</if>
            <if test="projectIntroduction != null  and projectIntroduction != ''">#{projectIntroduction},</if>
            <if test="handInDate != null ">#{handInDate},</if>
            <if test="handInPost != null  and handInPost != ''">#{handInPost},</if>
            <if test="lng != null ">#{lng},</if>
            <if test="lat != null ">#{lat},</if>
            <if test="updateTime != null ">#{updateTime},</if>
            <if test="createTime != null ">#{createTime},</if>
            <if test="createBy != null  and createBy != ''">#{createBy},</if>
         </trim>
    </insert>
 
    <update id="updateProjectInfo" parameterType="ProjectInfo">
        update js_project_info
        <trim prefix="SET" suffixOverrides=",">
            <if test="projectNo != null  and projectNo != ''">project_no = #{projectNo},</if>
            <if test="projectName != null  and projectName != ''">project_name = #{projectName},</if>
            <if test="constructionUnit != null  and constructionUnit != ''">construction_unit = #{constructionUnit},</if>
            <if test="exprorationUnit != null  and exprorationUnit != ''">exproration_unit = #{exprorationUnit},</if>
            <if test="serviceUnit != null  and serviceUnit != ''">service_unit = #{serviceUnit},</if>
            <if test="addressCode != null  and addressCode != ''">address_code = #{addressCode},</if>
            <if test="address != null  and address != ''">address = #{address},</if>
            <if test="projectLeader != null  and projectLeader != ''">project_leader = #{projectLeader},</if>
            <if test="projectEnginer != null  and projectEnginer != ''">project_enginer = #{projectEnginer},</if>
            <if test="startTime != null ">start_time = #{startTime},</if>
            <if test="plannedTime != null ">planned_time = #{plannedTime},</if>
            <if test="endTime != null ">end_time = #{endTime},</if>
            <if test="projectPicture != null  and projectPicture != ''">project_picture = #{projectPicture},</if>
            <if test="surveyOutline != null  and surveyOutline != ''">survey_outline = #{surveyOutline},</if>
            <if test="safetyRequire != null  and safetyRequire != ''">safety_require = #{safetyRequire},</if>
            <if test="techRequire != null  and techRequire != ''">tech_require = #{techRequire},</if>
            <if test="state != null  and state != ''">state = #{state},</if>
            <if test="reason != null  and reason != ''">reason = #{reason},</if>
            <if test="serialNumber != null  and serialNumber != ''">serial_number = #{serialNumber},</if>
            <if test="isDeleted != null  and isDeleted != ''">is_deleted = #{isDeleted},</if>
            <if test="archiveNo != null  and archiveNo != ''">archive_no = #{archiveNo},</if>
            <if test="projectCategory != null  and projectCategory != ''">project_category = #{projectCategory},</if>
            <if test="projectIntroduction != null  and projectIntroduction != ''">project_introduction = #{projectIntroduction},</if>
            <if test="handInDate != null ">hand_in_date = #{handInDate},</if>
            <if test="handInPost != null  and handInPost != ''">hand_in_post = #{handInPost},</if>
            <if test="lng != null ">lng = #{lng},</if>
            <if test="lat != null ">lat = #{lat},</if>
            <if test="updateTime != null ">update_time = #{updateTime},</if>
            <if test="createTime != null ">create_time = #{createTime},</if>
            <if test="createBy != null  and createBy != ''">create_by = #{createBy},</if>
        </trim>
        where id = #{id}
    </update>
 
    <delete id="deleteProjectInfoById" parameterType="String">
        delete from js_project_info where id = #{id}
    </delete>
 
    <delete id="deleteProjectInfoByIds" parameterType="String">
        delete from js_project_info where id in 
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
    
    
    
</mapper>