<?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.HydrologyWellInfoMapper"> 
 | 
     
 | 
    <resultMap type="HydrologyWellInfo" id="HydrologyWellInfoResult"> 
 | 
        <result property="id"    column="id"    /> 
 | 
        <result property="num"    column="num"    /> 
 | 
        <result property="scales"    column="scales"    /> 
 | 
        <result property="address"    column="address"    /> 
 | 
        <result property="lng"    column="lng"    /> 
 | 
        <result property="lat"    column="lat"    /> 
 | 
        <result property="wellDate"    column="well_date"    /> 
 | 
        <result property="constructionUnit"    column="construction_unit"    /> 
 | 
        <result property="depth"    column="depth"    /> 
 | 
        <result property="wellType"    column="well_type"    /> 
 | 
        <result property="wellBit"    column="well_bit"    /> 
 | 
        <result property="wellCasing"    column="well_casing"    /> 
 | 
        <result property="wellNature"    column="well_nature"    /> 
 | 
        <result property="eleResistivity"    column="ele_resistivity"    /> 
 | 
        <result property="machineType"    column="machine_type"    /> 
 | 
        <result property="interpretation"    column="interpretation"    /> 
 | 
        <result property="userExplain"    column="user_explain"    /> 
 | 
        <result property="userProof"    column="user_proof"    /> 
 | 
        <result property="userCheck"    column="user_check"    /> 
 | 
        <result property="surveyCompany"    column="survey_company"    /> 
 | 
        <result property="surveyCompanyAddr"    column="survey_company_addr"    /> 
 | 
        <result property="surveyEngineer"    column="survey_engineer"    /> 
 | 
        <result property="surveyTel"    column="survey_tel"    /> 
 | 
        <result property="remark"    column="remark"    /> 
 | 
    </resultMap> 
 | 
  
 | 
    <sql id="selectHydrologyWellInfoVo"> 
 | 
        select id, num, scales , address, lng, lat, well_date, construction_unit, depth, well_type, well_bit, well_casing, well_nature, ele_resistivity, machine_type, interpretation, user_explain, user_proof, user_check, survey_company, survey_company_addr, survey_engineer, survey_tel, remark from js_hydrology_well_info 
 | 
    </sql> 
 | 
  
 | 
    <select id="selectHydrologyWellInfoList" parameterType="HydrologyWellInfo" resultMap="HydrologyWellInfoResult"> 
 | 
        <include refid="selectHydrologyWellInfoVo"/> 
 | 
        <where>   
 | 
            <if test="num != null  and num != ''"> and num = #{num}</if> 
 | 
            <if test="scales != null  and scales != ''"> and scales = #{scales}</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="wellDate != null  and wellDate != ''"> and well_date = #{wellDate}</if> 
 | 
            <if test="constructionUnit != null  and constructionUnit != ''"> and construction_unit = #{constructionUnit}</if> 
 | 
            <if test="depth != null "> and depth = #{depth}</if> 
 | 
            <if test="wellType != null  and wellType != ''"> and well_type = #{wellType}</if> 
 | 
            <if test="wellBit != null  and wellBit != ''"> and well_bit = #{wellBit}</if> 
 | 
            <if test="wellCasing != null  and wellCasing != ''"> and well_casing = #{wellCasing}</if> 
 | 
            <if test="wellNature != null  and wellNature != ''"> and well_nature = #{wellNature}</if> 
 | 
            <if test="eleResistivity != null  and eleResistivity != ''"> and ele_resistivity = #{eleResistivity}</if> 
 | 
            <if test="machineType != null  and machineType != ''"> and machine_type = #{machineType}</if> 
 | 
            <if test="interpretation != null  and interpretation != ''"> and interpretation = #{interpretation}</if> 
 | 
            <if test="userExplain != null  and userExplain != ''"> and user_explain = #{userExplain}</if> 
 | 
            <if test="userProof != null  and userProof != ''"> and user_proof = #{userProof}</if> 
 | 
            <if test="userCheck != null  and userCheck != ''"> and user_check = #{userCheck}</if> 
 | 
            <if test="surveyCompany != null  and surveyCompany != ''"> and survey_company = #{surveyCompany}</if> 
 | 
            <if test="surveyCompanyAddr != null  and surveyCompanyAddr != ''"> and survey_company_addr = #{surveyCompanyAddr}</if> 
 | 
            <if test="surveyEngineer != null  and surveyEngineer != ''"> and survey_engineer = #{surveyEngineer}</if> 
 | 
            <if test="surveyTel != null  and surveyTel != ''"> and survey_tel = #{surveyTel}</if> 
 | 
        </where> 
 | 
    </select> 
 | 
     
 | 
    <select id="selectHydrologyWellInfoById" parameterType="Long" resultMap="HydrologyWellInfoResult"> 
 | 
        <include refid="selectHydrologyWellInfoVo"/> 
 | 
        where id = #{id} 
 | 
    </select> 
 | 
         
 | 
    <insert id="insertHydrologyWellInfo" parameterType="HydrologyWellInfo" useGeneratedKeys="true" keyProperty="id"> 
 | 
        insert into js_hydrology_well_info 
 | 
        <trim prefix="(" suffix=")" suffixOverrides=","> 
 | 
            <if test="num != null  and num != ''">num,</if> 
 | 
            <if test="scales != null  and scales != ''">scales,</if> 
 | 
            <if test="address != null  and address != ''">address,</if> 
 | 
            <if test="lng != null ">lng,</if> 
 | 
            <if test="lat != null ">lat,</if> 
 | 
            <if test="wellDate != null  and wellDate != ''">well_date,</if> 
 | 
            <if test="constructionUnit != null  and constructionUnit != ''">construction_unit,</if> 
 | 
            <if test="depth != null ">depth,</if> 
 | 
            <if test="wellType != null  and wellType != ''">well_type,</if> 
 | 
            <if test="wellBit != null  and wellBit != ''">well_bit,</if> 
 | 
            <if test="wellCasing != null  and wellCasing != ''">well_casing,</if> 
 | 
            <if test="wellNature != null  and wellNature != ''">well_nature,</if> 
 | 
            <if test="eleResistivity != null  and eleResistivity != ''">ele_resistivity,</if> 
 | 
            <if test="machineType != null  and machineType != ''">machine_type,</if> 
 | 
            <if test="interpretation != null  and interpretation != ''">interpretation,</if> 
 | 
            <if test="userExplain != null  and userExplain != ''">user_explain,</if> 
 | 
            <if test="userProof != null  and userProof != ''">user_proof,</if> 
 | 
            <if test="userCheck != null  and userCheck != ''">user_check,</if> 
 | 
            <if test="surveyCompany != null  and surveyCompany != ''">survey_company,</if> 
 | 
            <if test="surveyCompanyAddr != null  and surveyCompanyAddr != ''">survey_company_addr,</if> 
 | 
            <if test="surveyEngineer != null  and surveyEngineer != ''">survey_engineer,</if> 
 | 
            <if test="surveyTel != null  and surveyTel != ''">survey_tel,</if> 
 | 
            <if test="remark != null  and remark != ''">remark,</if> 
 | 
         </trim> 
 | 
        <trim prefix="values (" suffix=")" suffixOverrides=","> 
 | 
            <if test="num != null  and num != ''">#{num},</if> 
 | 
            <if test="scales != null  and scales != ''">#{scales},</if> 
 | 
            <if test="address != null  and address != ''">#{address},</if> 
 | 
            <if test="lng != null ">#{lng},</if> 
 | 
            <if test="lat != null ">#{lat},</if> 
 | 
            <if test="wellDate != null  and wellDate != ''">#{wellDate},</if> 
 | 
            <if test="constructionUnit != null  and constructionUnit != ''">#{constructionUnit},</if> 
 | 
            <if test="depth != null ">#{depth},</if> 
 | 
            <if test="wellType != null  and wellType != ''">#{wellType},</if> 
 | 
            <if test="wellBit != null  and wellBit != ''">#{wellBit},</if> 
 | 
            <if test="wellCasing != null  and wellCasing != ''">#{wellCasing},</if> 
 | 
            <if test="wellNature != null  and wellNature != ''">#{wellNature},</if> 
 | 
            <if test="eleResistivity != null  and eleResistivity != ''">#{eleResistivity},</if> 
 | 
            <if test="machineType != null  and machineType != ''">#{machineType},</if> 
 | 
            <if test="interpretation != null  and interpretation != ''">#{interpretation},</if> 
 | 
            <if test="userExplain != null  and userExplain != ''">#{userExplain},</if> 
 | 
            <if test="userProof != null  and userProof != ''">#{userProof},</if> 
 | 
            <if test="userCheck != null  and userCheck != ''">#{userCheck},</if> 
 | 
            <if test="surveyCompany != null  and surveyCompany != ''">#{surveyCompany},</if> 
 | 
            <if test="surveyCompanyAddr != null  and surveyCompanyAddr != ''">#{surveyCompanyAddr},</if> 
 | 
            <if test="surveyEngineer != null  and surveyEngineer != ''">#{surveyEngineer},</if> 
 | 
            <if test="surveyTel != null  and surveyTel != ''">#{surveyTel},</if> 
 | 
            <if test="remark != null  and remark != ''">#{remark},</if> 
 | 
         </trim> 
 | 
    </insert> 
 | 
  
 | 
    <update id="updateHydrologyWellInfo" parameterType="HydrologyWellInfo"> 
 | 
        update js_hydrology_well_info 
 | 
        <trim prefix="SET" suffixOverrides=","> 
 | 
            <if test="num != null  and num != ''">num = #{num},</if> 
 | 
            <if test="scales != null  and scales != ''">scales = #{scales},</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="wellDate != null  and wellDate != ''">well_date = #{wellDate},</if> 
 | 
            <if test="constructionUnit != null  and constructionUnit != ''">construction_unit = #{constructionUnit},</if> 
 | 
            <if test="depth != null ">depth = #{depth},</if> 
 | 
            <if test="wellType != null  and wellType != ''">well_type = #{wellType},</if> 
 | 
            <if test="wellBit != null  and wellBit != ''">well_bit = #{wellBit},</if> 
 | 
            <if test="wellCasing != null  and wellCasing != ''">well_casing = #{wellCasing},</if> 
 | 
            <if test="wellNature != null  and wellNature != ''">well_nature = #{wellNature},</if> 
 | 
            <if test="eleResistivity != null  and eleResistivity != ''">ele_resistivity = #{eleResistivity},</if> 
 | 
            <if test="machineType != null  and machineType != ''">machine_type = #{machineType},</if> 
 | 
            <if test="interpretation != null  and interpretation != ''">interpretation = #{interpretation},</if> 
 | 
            <if test="userExplain != null  and userExplain != ''">user_explain = #{userExplain},</if> 
 | 
            <if test="userProof != null  and userProof != ''">user_proof = #{userProof},</if> 
 | 
            <if test="userCheck != null  and userCheck != ''">user_check = #{userCheck},</if> 
 | 
            <if test="surveyCompany != null  and surveyCompany != ''">survey_company = #{surveyCompany},</if> 
 | 
            <if test="surveyCompanyAddr != null  and surveyCompanyAddr != ''">survey_company_addr = #{surveyCompanyAddr},</if> 
 | 
            <if test="surveyEngineer != null  and surveyEngineer != ''">survey_engineer = #{surveyEngineer},</if> 
 | 
            <if test="surveyTel != null  and surveyTel != ''">survey_tel = #{surveyTel},</if> 
 | 
            <if test="remark != null  and remark != ''">remark = #{remark},</if> 
 | 
        </trim> 
 | 
        where id = #{id} 
 | 
    </update> 
 | 
  
 | 
    <delete id="deleteHydrologyWellInfoById" parameterType="Long"> 
 | 
        delete from js_hydrology_well_info where id = #{id} 
 | 
    </delete> 
 | 
  
 | 
    <delete id="deleteHydrologyWellInfoByIds" parameterType="String"> 
 | 
        delete from js_hydrology_well_info where id in  
 | 
        <foreach item="id" collection="array" open="(" separator="," close=")"> 
 | 
            #{id} 
 | 
        </foreach> 
 | 
    </delete> 
 | 
     
 | 
</mapper> 
 |