| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377 |
- <?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="cn.com.goldenwater.dcproj.dao.AttEngResDao">
- <resultMap type="cn.com.goldenwater.dcproj.model.AttEngRes" id="attEngResResultMap">
- <result property="deadCap" column="DEAD_CAP"/>
- <result property="flcoCap" column="FLCO_CAP"/>
- <result property="note" column="NOTE"/>
- <result property="collTime" column="COLL_TIME"/>
- <result property="updTime" column="UPD_TIME"/>
- <result property="recPers" column="REC_PERS"/>
- <result property="engReinForceGuid" column="ENG_REIN_FORCE_GUID"/>
- <result property="guid" column="GUID"/>
- <result property="pGuid" column="P_GUID"/>
- <result property="engName" column="ENG_NAME"/>
- <result property="engGuid" column="ENG_GUID"/>
- <result property="impoGrad" column="IMPO_GRAD"/>
- <result property="apprBudg" column="APPR_BUDG"/>
- <result property="startDate" column="START_DATE"/>
- <result property="compDate" column="COMP_DATE"/>
- <result property="engStat" column="ENG_STAT"/>
- <result property="orgGuid" column="ORG_GUID"/>
- <result property="oflpCode" column="OFLP_CODE"/>
- <result property="ifReinForce" column="IF_REIN_FORCE"/>
- <result property="projGuid" column="PROJ_GUID"/>
- <result property="stat" column="STAT"/>
- <result property="resCode" column="RES_CODE"/>
- <result property="cenLong" column="CEN_LONG"/>
- <result property="cenLat" column="CEN_LAT"/>
- <result property="resLoc" column="RES_LOC"/>
- <result property="rvGuid" column="RV_GUID"/>
- <result property="adGuid" column="AD_GUID"/>
- <result property="engGrad" column="ENG_GRAD"/>
- <result property="engScal" column="ENG_SCAL"/>
- <result property="damTypeMat" column="DAM_TYPE_MAT"/>
- <result property="damTypeStr" column="DAM_TYPE_STR"/>
- <result property="damSizeHig" column="DAM_SIZE_HIG"/>
- <result property="damSizeLen" column="DAM_SIZE_LEN"/>
- <result property="damCreElv" column="DAM_CRE_ELV"/>
- <result property="desFlStand" column="DES_FL_STAND"/>
- <result property="flLowLimLev" column="FL_LOW_LIM_LEV"/>
- <result property="flLowLimLevStart" column="FL_LOW_LIM_LEV_START"/>
- <result property="flLowLimLevEnd" column="FL_LOW_LIM_LEV_END"/>
- <result property="desFlStag" column="DES_FL_STAG"/>
- <result property="mainFlType" column="MAIN_FL_TYPE"/>
- <result property="deadLev" column="DEAD_LEV"/>
- <result property="totCap" column="TOT_CAP"/>
- </resultMap>
- <sql id="table_columns">
- DEAD_CAP,
- FLCO_CAP,
- NOTE,
- COLL_TIME,
- UPD_TIME,
- REC_PERS,
- ENG_REIN_FORCE_GUID,
- 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
- </sql>
- <sql id="entity_properties">
- #{deadCap},
- #{flcoCap},
- #{note},
- #{collTime},
- #{updTime},
- #{recPers},
- #{engReinForceGuid},
- #{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}
- </sql>
- <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
- <sql id="page_where">
- <trim prefix="where" prefixOverrides="and | or ">
- <if test="flcoCap != null and flcoCap != ''">and FLCO_CAP = #{flcoCap}</if>
- <if test="note != null and note != ''">and NOTE = #{note}</if>
- <if test="collTime != null">and COLL_TIME = #{collTime}</if>
- <if test="updTime != null">and UPD_TIME = #{updTime}</if>
- <if test="recPers != null and recPers != ''">and REC_PERS = #{recPers}</if>
- <if test="engReinForceGuid != null and engReinForceGuid != ''">and ENG_REIN_FORCE_GUID = #{engReinForceGuid}</if>
- <if test="guid != null and guid != ''">and GUID = #{guid}</if>
- <if test="pGuid != null and pGuid != ''">and P_GUID = #{pGuid}</if>
- <if test="engName != null and engName != ''">and ENG_NAME = #{engName}</if>
- <if test="engGuid != null and engGuid != ''">and ENG_GUID = #{engGuid}</if>
- <if test="impoGrad != null">and IMPO_GRAD = #{impoGrad}</if>
- <if test="apprBudg != null and apprBudg != ''">and APPR_BUDG = #{apprBudg}</if>
- <if test="startDate != null">and START_DATE = #{startDate}</if>
- <if test="compDate != null">and COMP_DATE = #{compDate}</if>
- <if test="engStat != null">and ENG_STAT = #{engStat}</if>
- <if test="orgGuid != null and orgGuid != ''">and ORG_GUID = #{orgGuid}</if>
- <if test="oflpCode != null and oflpCode != ''">and OFLP_CODE = #{oflpCode}</if>
- <if test="ifReinForce != null">and IF_REIN_FORCE = #{ifReinForce}</if>
- <if test="projGuid != null and projGuid != ''">and PROJ_GUID = #{projGuid}</if>
- <if test="stat != null">and STAT = #{stat}</if>
- <if test="resCode != null and resCode != ''">and RES_CODE = #{resCode}</if>
- <if test="cenLong != null and cenLong != ''">and CEN_LONG = #{cenLong}</if>
- <if test="cenLat != null and cenLat != ''">and CEN_LAT = #{cenLat}</if>
- <if test="resLoc != null and resLoc != ''">and RES_LOC = #{resLoc}</if>
- <if test="rvGuid != null and rvGuid != ''">and RV_GUID = #{rvGuid}</if>
- <if test="adGuid != null and adGuid != ''">and AD_GUID = #{adGuid}</if>
- <if test="engGrad != null">and ENG_GRAD = #{engGrad}</if>
- <if test="engScal != null">and ENG_SCAL = #{engScal}</if>
- <if test="damTypeMat != null">and DAM_TYPE_MAT = #{damTypeMat}</if>
- <if test="damTypeStr != null">and DAM_TYPE_STR = #{damTypeStr}</if>
- <if test="damSizeHig != null and damSizeHig != ''">and DAM_SIZE_HIG = #{damSizeHig}</if>
- <if test="damSizeLen != null and damSizeLen != ''">and DAM_SIZE_LEN = #{damSizeLen}</if>
- <if test="damCreElv != null and damCreElv != ''">and DAM_CRE_ELV = #{damCreElv}</if>
- <if test="desFlStand != null and desFlStand != ''">and DES_FL_STAND = #{desFlStand}</if>
- <if test="flLowLimLev != null and flLowLimLev != ''">and FL_LOW_LIM_LEV = #{flLowLimLev}</if>
- <if test="flLowLimLevStart != null">and FL_LOW_LIM_LEV_START = #{flLowLimLevStart}</if>
- <if test="flLowLimLevEnd != null">and FL_LOW_LIM_LEV_END = #{flLowLimLevEnd}</if>
- <if test="desFlStag != null and desFlStag != ''">and DES_FL_STAG = #{desFlStag}</if>
- <if test="mainFlType != null">and MAIN_FL_TYPE = #{mainFlType}</if>
- <if test="deadLev != null and deadLev != ''">and DEAD_LEV = #{deadLev}</if>
- <if test="totCap != null and totCap != ''">and TOT_CAP = #{totCap}</if>
- </trim>
- </sql>
- <select id="get" resultMap="attEngResResultMap" parameterType="String" >
- select <include refid="table_columns" /> from ATT_ENG_RES where ID = #{id}
- </select>
- <select id="getBy" resultMap="attEngResResultMap">
- select <include refid="table_columns" /> from ATT_ENG_RES <include refid="page_where" />
- </select>
- <select id="findAll" resultMap="attEngResResultMap">
- select <include refid="table_columns" /> from ATT_ENG_RES
- </select>
- <select id="findList" resultMap="attEngResResultMap">
- select <include refid="table_columns" /> from ATT_ENG_RES <include refid="page_where" />
- </select>
- <select id="selectCount" resultType="int" >
- select count(ID) from ATT_ENG_RES <include refid="page_where" />
- </select>
- <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.AttEngRes">
- insert into ATT_ENG_RES( <include refid="table_columns" /> )
- values ( <include refid="entity_properties" /> )
- </insert>
- <delete id="delete" parameterType="java.lang.String">
- delete from ATT_ENG_RES where ID = #{id}
- </delete>
- <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.AttEngRes">
- delete from ATT_ENG_RES <include refid="page_where" />
- </delete>
- <update id="deleteInFlag" parameterType="java.lang.String">
- update ATT_ENG_RES set flag_valid = 0 where ID = #{id}
- </update>
- <update id="update" parameterType="cn.com.goldenwater.dcproj.model.AttEngRes">
- update ATT_ENG_RES
- <trim prefix="set" suffixOverrides=",">
- <if test="flcoCap != null and flcoCap != ''">FLCO_CAP = #{flcoCap},</if>
- <if test="note != null and note != ''">NOTE = #{note},</if>
- <if test="collTime != null">COLL_TIME = #{collTime},</if>
- <if test="updTime != null">UPD_TIME = #{updTime},</if>
- <if test="recPers != null and recPers != ''">REC_PERS = #{recPers},</if>
- <if test="engReinForceGuid != null and engReinForceGuid != ''">ENG_REIN_FORCE_GUID = #{engReinForceGuid},</if>
- <if test="guid != null and guid != ''">GUID = #{guid},</if>
- <if test="pGuid != null and pGuid != ''">P_GUID = #{pGuid},</if>
- <if test="engName != null and engName != ''">ENG_NAME = #{engName},</if>
- <if test="engGuid != null and engGuid != ''">ENG_GUID = #{engGuid},</if>
- <if test="impoGrad != null">IMPO_GRAD = #{impoGrad},</if>
- <if test="apprBudg != null and apprBudg != ''">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 and orgGuid != ''">ORG_GUID = #{orgGuid},</if>
- <if test="oflpCode != null and oflpCode != ''">OFLP_CODE = #{oflpCode},</if>
- <if test="ifReinForce != null">IF_REIN_FORCE = #{ifReinForce},</if>
- <if test="projGuid != null and projGuid != ''">PROJ_GUID = #{projGuid},</if>
- <if test="stat != null">STAT = #{stat},</if>
- <if test="resCode != null and resCode != ''">RES_CODE = #{resCode},</if>
- <if test="cenLong != null and cenLong != ''">CEN_LONG = #{cenLong},</if>
- <if test="cenLat != null and cenLat != ''">CEN_LAT = #{cenLat},</if>
- <if test="resLoc != null and resLoc != ''">RES_LOC = #{resLoc},</if>
- <if test="rvGuid != null and rvGuid != ''">RV_GUID = #{rvGuid},</if>
- <if test="adGuid != null and adGuid != ''">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 and damSizeHig != ''">DAM_SIZE_HIG = #{damSizeHig},</if>
- <if test="damSizeLen != null and damSizeLen != ''">DAM_SIZE_LEN = #{damSizeLen},</if>
- <if test="damCreElv != null and damCreElv != ''">DAM_CRE_ELV = #{damCreElv},</if>
- <if test="desFlStand != null and desFlStand != ''">DES_FL_STAND = #{desFlStand},</if>
- <if test="flLowLimLev != null and flLowLimLev != ''">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 and desFlStag != ''">DES_FL_STAG = #{desFlStag},</if>
- <if test="mainFlType != null">MAIN_FL_TYPE = #{mainFlType},</if>
- <if test="deadLev != null and deadLev != ''">DEAD_LEV = #{deadLev},</if>
- <if test="totCap != null and totCap != ''">TOT_CAP = #{totCap},</if>
- </trim>
- <where>ID = #{id}</where>
- </update>
- <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.AttEngRes">
- update ATT_ENG_RES
- <trim prefix="set" suffixOverrides=",">
- <if test="flcoCap != null and flcoCap != ''">FLCO_CAP = #{flcoCap},</if>
- <if test="note != null and note != ''">NOTE = #{note},</if>
- <if test="collTime != null">COLL_TIME = #{collTime},</if>
- <if test="updTime != null">UPD_TIME = #{updTime},</if>
- <if test="recPers != null and recPers != ''">REC_PERS = #{recPers},</if>
- <if test="engReinForceGuid != null and engReinForceGuid != ''">ENG_REIN_FORCE_GUID = #{engReinForceGuid},</if>
- <if test="guid != null and guid != ''">GUID = #{guid},</if>
- <if test="pGuid != null and pGuid != ''">P_GUID = #{pGuid},</if>
- <if test="engName != null and engName != ''">ENG_NAME = #{engName},</if>
- <if test="engGuid != null and engGuid != ''">ENG_GUID = #{engGuid},</if>
- <if test="impoGrad != null">IMPO_GRAD = #{impoGrad},</if>
- <if test="apprBudg != null and apprBudg != ''">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 and orgGuid != ''">ORG_GUID = #{orgGuid},</if>
- <if test="oflpCode != null and oflpCode != ''">OFLP_CODE = #{oflpCode},</if>
- <if test="ifReinForce != null">IF_REIN_FORCE = #{ifReinForce},</if>
- <if test="projGuid != null and projGuid != ''">PROJ_GUID = #{projGuid},</if>
- <if test="stat != null">STAT = #{stat},</if>
- <if test="resCode != null and resCode != ''">RES_CODE = #{resCode},</if>
- <if test="cenLong != null and cenLong != ''">CEN_LONG = #{cenLong},</if>
- <if test="cenLat != null and cenLat != ''">CEN_LAT = #{cenLat},</if>
- <if test="resLoc != null and resLoc != ''">RES_LOC = #{resLoc},</if>
- <if test="rvGuid != null and rvGuid != ''">RV_GUID = #{rvGuid},</if>
- <if test="adGuid != null and adGuid != ''">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 and damSizeHig != ''">DAM_SIZE_HIG = #{damSizeHig},</if>
- <if test="damSizeLen != null and damSizeLen != ''">DAM_SIZE_LEN = #{damSizeLen},</if>
- <if test="damCreElv != null and damCreElv != ''">DAM_CRE_ELV = #{damCreElv},</if>
- <if test="desFlStand != null and desFlStand != ''">DES_FL_STAND = #{desFlStand},</if>
- <if test="flLowLimLev != null and flLowLimLev != ''">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 and desFlStag != ''">DES_FL_STAG = #{desFlStag},</if>
- <if test="mainFlType != null">MAIN_FL_TYPE = #{mainFlType},</if>
- <if test="deadLev != null and deadLev != ''">DEAD_LEV = #{deadLev},</if>
- <if test="totCap != null and totCap != ''">TOT_CAP = #{totCap},</if>
- </trim>
- <include refid="page_where" />
- </update>
- <select id="getListByAdCode" resultType="cn.com.goldenwater.dcproj.model.AttEngResAssociated" parameterType="String">
- select t.*, ad.ad_code, ad.ad_grad, ad.ad_name
- from ATT_ENG_RES t, ATT_AD_BASE ad
- where t.ad_guid = ad.guid
- <if test="null != code and ''!=code">
- and ad.ad_code like #{code}
- </if>
- order by ad.ad_code, ad.ad_grad asc
- </select>
- <!-- 其他自定义SQL -->
- <select id="getListByInspGroupIdObjType" resultType="cn.com.goldenwater.dcproj.model.AttEngRes">
- select t.*,o.obj_id
- from ATT_ENG_RES t
- left join BIS_INSP_OBJ o
- on o.obj_id = t.guid
- and o.obj_type = #{objType}
- where o.insp_group_id = #{inspGroupId}
- <include refid="choseSql"/>
- </select>
- <select id="getObjListByGroupIdAndTypeNew" resultType="cn.com.goldenwater.dcproj.model.AttEngRes">
- select * from BIS_INSP_ALL_OBJ o where id like concat(#{inspGroupId},'%')
- <if test="null != objType and ''!=objType">
- and ptype=#{objType}
- </if>
- <if test="null != name and ''!=name">
- and nm like concat(#{name},'%')
- </if>
- <include refid="choseSql"/>
- </select>
- <sql id="choseSql" >
- <choose>
- <when test="province !=null and province !=''">
- and o.ad_code=#{province}
- </when>
- <otherwise>
- and o.ad_code is null
- </otherwise>
- </choose>
- </sql>
- <select id="getObjListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.model.AttEngRes">
- select *
- from ATT_ENG_RES t
- where t.guid not in (select o.obj_id
- from BIS_INSP_OBJ o
- where o.insp_group_id = #{inspGroupId}
- and o.obj_type = #{objType}
- )
- and t.stat = '1'
- <if test="null != name and '' != name">
- and t.eng_name like ''
- </if>
- </select>
- </mapper>
|