| <?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) < #{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> |