地质所 沉降监测网建设项目
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
<?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.hydrology.mapper.HydrologyHoleInfoMapper">
    
    <resultMap type="HydrologyHoleInfo" id="HydrologyHoleInfoResult">
        <result property="id"    column="id"    />
        <result property="holeNum"    column="hole_num"    />
        <result property="district"    column="district"    />
        <result property="address"    column="address"    />
        <result property="lng"    column="lng"    />
        <result property="lat"    column="lat"    />
        <result property="holeDepth"    column="hole_depth"    />
        <result property="elevation"    column="elevation"    />
        <result property="wellDate"    column="well_date"    />
        <result property="pipeDepth"    column="pipe_depth"    />
        <result property="machineType"    column="machine_type"    />
        <result property="remark"    column="remark"    />
        <result property="createTime"    column="create_time"    />
    </resultMap>
    
   
    <sql id="selectHydrologyHoleInfoVo">
        select id, hole_num, district, address, lng, lat, hole_depth, elevation, well_date, pipe_depth, machine_type, remark, create_time from js_hydrology_hole_info
    </sql>
    
    <select id="selectSpecificFiledList" parameterType="HydrologyHoleInfo" resultMap="HydrologyHoleInfoResult">
       select id, hole_num, lng, lat from js_hydrology_hole_info
        <where>  
            <if test="holeNum != null  and holeNum != ''"> and hole_num = #{holeNum}</if>
            <if test="district != null  and district != ''"> and district = #{district}</if>
            <if test="address != null  and address != ''"> and address = #{address}</if>
            <if test="lng != null "> and lng = #{lng}</if>
            <if test="lat != null "> and lat = #{lat}</if>
            <if test="holeDepth != null "> and hole_depth = #{holeDepth}</if>
            <if test="elevation != null "> and elevation = #{elevation}</if>
            <if test="wellDate != null  and wellDate != ''"> and well_date = #{wellDate}</if>
            <if test="pipeDepth != null  and pipeDepth != ''"> and pipe_depth = #{pipeDepth}</if>
            <if test="machineType != null  and machineType != ''"> and machine_type = #{machineType}</if>
        </where>
    </select>
 
    <select id="selectHydrologyHoleInfoList" parameterType="HydrologyHoleInfo" resultMap="HydrologyHoleInfoResult">
        <include refid="selectHydrologyHoleInfoVo"/>
        <where>  
            <if test="holeNum != null  and holeNum != ''"> and hole_num = #{holeNum}</if>
            <if test="district != null  and district != ''"> and district = #{district}</if>
            <if test="address != null  and address != ''"> and address = #{address}</if>
            <if test="lng != null "> and lng = #{lng}</if>
            <if test="lat != null "> and lat = #{lat}</if>
            <if test="holeDepth != null "> and hole_depth = #{holeDepth}</if>
            <if test="elevation != null "> and elevation = #{elevation}</if>
            <if test="wellDate != null  and wellDate != ''"> and well_date = #{wellDate}</if>
            <if test="pipeDepth != null  and pipeDepth != ''"> and pipe_depth = #{pipeDepth}</if>
            <if test="machineType != null  and machineType != ''"> and machine_type = #{machineType}</if>
        </where>
    </select>
    
    <select id="selectHydrologyHoleInfoById" parameterType="Long" resultMap="HydrologyHoleInfoResult">
        <include refid="selectHydrologyHoleInfoVo"/>
        where id = #{id}
    </select>
    
     <select id="selectByCircle" resultMap="HydrologyHoleInfoResult">
           select id, hole_num, lng, lat from js_hydrology_hole_info
           WHERE  fun_distance(#{latitude},#{longitude} ,lat,lng) &lt; #{radius}
     </select>
        
    <insert id="insertHydrologyHoleInfo" parameterType="HydrologyHoleInfo" useGeneratedKeys="true" keyProperty="id">
        insert into js_hydrology_hole_info
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="holeNum != null  and holeNum != ''">hole_num,</if>
            <if test="district != null  and district != ''">district,</if>
            <if test="address != null  and address != ''">address,</if>
            <if test="lng != null ">lng,</if>
            <if test="lat != null ">lat,</if>
            <if test="holeDepth != null ">hole_depth,</if>
            <if test="elevation != null ">elevation,</if>
            <if test="wellDate != null  and wellDate != ''">well_date,</if>
            <if test="pipeDepth != null  and pipeDepth != ''">pipe_depth,</if>
            <if test="machineType != null  and machineType != ''">machine_type,</if>
            <if test="remark != null  and remark != ''">remark,</if>
            <if test="createTime != null ">create_time,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="holeNum != null  and holeNum != ''">#{holeNum},</if>
            <if test="district != null  and district != ''">#{district},</if>
            <if test="address != null  and address != ''">#{address},</if>
            <if test="lng != null ">#{lng},</if>
            <if test="lat != null ">#{lat},</if>
            <if test="holeDepth != null ">#{holeDepth},</if>
            <if test="elevation != null ">#{elevation},</if>
            <if test="wellDate != null  and wellDate != ''">#{wellDate},</if>
            <if test="pipeDepth != null  and pipeDepth != ''">#{pipeDepth},</if>
            <if test="machineType != null  and machineType != ''">#{machineType},</if>
            <if test="remark != null  and remark != ''">#{remark},</if>
            <if test="createTime != null ">#{createTime},</if>
         </trim>
    </insert>
 
    <update id="updateHydrologyHoleInfo" parameterType="HydrologyHoleInfo">
        update js_hydrology_hole_info
        <trim prefix="SET" suffixOverrides=",">
            <if test="holeNum != null  and holeNum != ''">hole_num = #{holeNum},</if>
            <if test="district != null  and district != ''">district = #{district},</if>
            <if test="address != null  and address != ''">address = #{address},</if>
            <if test="lng != null ">lng = #{lng},</if>
            <if test="lat != null ">lat = #{lat},</if>
            <if test="holeDepth != null ">hole_depth = #{holeDepth},</if>
            <if test="elevation != null ">elevation = #{elevation},</if>
            <if test="wellDate != null  and wellDate != ''">well_date = #{wellDate},</if>
            <if test="pipeDepth != null  and pipeDepth != ''">pipe_depth = #{pipeDepth},</if>
            <if test="machineType != null  and machineType != ''">machine_type = #{machineType},</if>
            <if test="remark != null  and remark != ''">remark = #{remark},</if>
            <if test="createTime != null ">create_time = #{createTime},</if>
        </trim>
        where id = #{id}
    </update>
 
    <delete id="deleteHydrologyHoleInfoById" parameterType="Long">
        delete from js_hydrology_hole_info where id = #{id}
    </delete>
 
    <delete id="deleteHydrologyHoleInfoByIds" parameterType="String">
        delete from js_hydrology_hole_info where id in 
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
    
     <delete id="deleteHydrologyHoleInfoByNum" parameterType="String">
        delete from js_hydrology_hole_info where hole_num = #{holeNum}
    </delete>
    
    
</mapper>