<?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.goldenwater.slaj.eng.mapper.AttEngResMapper">
    <select id="selectByGuid" parameterType="String" resultType="java.util.LinkedHashMap">select * from att_eng_res where guid = #{guid}</select>
    <select id="selectList" parameterType="map" resultType="java.util.LinkedHashMap">
        select * from att_eng_res <where><if test="engGuid != null">AND eng_guid = #{engGuid}</if><if test="engName != null">AND eng_name like '%' || #{engName} || '%'</if></where>
    </select>
    <insert id="insert" parameterType="map">
        insert into att_eng_res (guid, p_guid, eng_name, eng_guid, impo_grad, appr_budg, start_date, comp_date, eng_stat, org_guid, oflp_code, if_rein_force, proj_guid, stat, res_code, cen_long, cen_lat, res_loc, rv_guid, ad_guid, eng_grad, eng_scal, dam_type_mat, dam_type_str, dam_size_hig, dam_size_len, dam_cre_elv, des_fl_stand, fl_low_lim_lev, fl_low_lim_lev_start, fl_low_lim_lev_end, des_fl_stag, main_fl_type, dead_lev, tot_cap, dead_cap, flco_cap, note, coll_time, upd_time, rec_pers, eng_rein_force_guid)
        values (#{guid}, #{pGuid}, #{engName}, #{engGuid}, #{impoGrad}, #{apprBudg}, #{startDate}, #{compDate}, #{engStat}, #{orgGuid}, #{oflpCode}, #{ifReinForce}, #{projGuid}, #{stat}, #{resCode}, #{cenLong}, #{cenLat}, #{resLoc}, #{rvGuid}, #{adGuid}, #{engGrad}, #{engScal}, #{damTypeMat}, #{damTypeStr}, #{damSizeHig}, #{damSizeLen}, #{damCreElv}, #{desFlStand}, #{flLowLimLev}, #{flLowLimLevStart}, #{flLowLimLevEnd}, #{desFlStag}, #{mainFlType}, #{deadLev}, #{totCap}, #{deadCap}, #{flcoCap}, #{note}, #{collTime}, #{updTime}, #{recPers}, #{engReinForceGuid})
    </insert>
    <update id="update" parameterType="map">
        update att_eng_res <set>
            <if test="engName != null">eng_name = #{engName},</if>
            <if test="impoGrad != null">impo_grad = #{impoGrad},</if>
            <if test="apprBudg != null">appr_budg = #{apprBudg},</if>
            <if test="startDate != null">start_date = #{startDate},</if>
            <if test="compDate != null">comp_date = #{compDate},</if>
            <if test="engStat != null">eng_stat = #{engStat},</if>
            <if test="orgGuid != null">org_guid = #{orgGuid},</if>
            <if test="oflpCode != null">oflp_code = #{oflpCode},</if>
            <if test="ifReinForce != null">if_rein_force = #{ifReinForce},</if>
            <if test="projGuid != null">proj_guid = #{projGuid},</if>
            <if test="stat != null">stat = #{stat},</if>
            <if test="resCode != null">res_code = #{resCode},</if>
            <if test="cenLong != null">cen_long = #{cenLong},</if>
            <if test="cenLat != null">cen_lat = #{cenLat},</if>
            <if test="resLoc != null">res_loc = #{resLoc},</if>
            <if test="rvGuid != null">rv_guid = #{rvGuid},</if>
            <if test="adGuid != null">ad_guid = #{adGuid},</if>
            <if test="engGrad != null">eng_grad = #{engGrad},</if>
            <if test="engScal != null">eng_scal = #{engScal},</if>
            <if test="damTypeMat != null">dam_type_mat = #{damTypeMat},</if>
            <if test="damTypeStr != null">dam_type_str = #{damTypeStr},</if>
            <if test="damSizeHig != null">dam_size_hig = #{damSizeHig},</if>
            <if test="damSizeLen != null">dam_size_len = #{damSizeLen},</if>
            <if test="damCreElv != null">dam_cre_elv = #{damCreElv},</if>
            <if test="desFlStand != null">des_fl_stand = #{desFlStand},</if>
            <if test="flLowLimLev != null">fl_low_lim_lev = #{flLowLimLev},</if>
            <if test="flLowLimLevStart != null">fl_low_lim_lev_start = #{flLowLimLevStart},</if>
            <if test="flLowLimLevEnd != null">fl_low_lim_lev_end = #{flLowLimLevEnd},</if>
            <if test="desFlStag != null">des_fl_stag = #{desFlStag},</if>
            <if test="mainFlType != null">main_fl_type = #{mainFlType},</if>
            <if test="deadLev != null">dead_lev = #{deadLev},</if>
            <if test="totCap != null">tot_cap = #{totCap},</if>
            <if test="deadCap != null">dead_cap = #{deadCap},</if>
            <if test="flcoCap != null">flco_cap = #{flcoCap},</if>
            <if test="note != null">note = #{note},</if>
            <if test="updTime != null">upd_time = #{updTime},</if>
            <if test="recPers != null">rec_pers = #{recPers},</if>
            <if test="engReinForceGuid != null">eng_rein_force_guid = #{engReinForceGuid},</if>
        </set> where guid = #{guid}
    </update>
    <delete id="deleteByGuid" parameterType="String">delete from att_eng_res where guid = #{guid}</delete>
    <delete id="deleteByGuids" parameterType="map">delete from att_eng_res where guid in <foreach item="g" collection="array" open="(" separator="," close=")">#{g}</foreach></delete>
</mapper>
