| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351 |
- <?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.AttSdBaseDao">
- <resultMap type="cn.com.goldenwater.dcproj.model.AttSdBase" id="attSdBaseResultMap">
- <result property="sdCode" column="SD_CODE"/>
- <result property="sdName" column="SD_NAME"/>
- <result property="sdType" column="SD_TYPE"/>
- <result property="sdTypeStr" column="SD_TYPE_STR"/>
- <result property="conArea" column="CON_AREA"/>
- <result property="totCap" column="TOT_CAP"/>
- <result property="flcoCap" column="FLCO_CAP"/>
- <result property="sdrCap" column="SDR_CAP"/>
- <result property="flcoYear" column="FLCO_YEAR"/>
- <result property="warpCap" column="WARP_CAP"/>
- <result property="damSizeHig" column="DAM_SIZE_HIG"/>
- <result property="damTopLen" column="DAM_TOP_LEN"/>
- <result property="adCode" column="AD_CODE"/>
- <result property="sdLoc" column="SD_LOC"/>
- <result property="centerX" column="CENTER_X"/>
- <result property="centerY" column="CENTER_Y"/>
- <result property="gdX" column="GD_X"/>
- <result property="gdY" column="GD_Y"/>
- <result property="asinttds" column="ASINTTDS"/>
- <result property="noSpway" column="NO_SPWAY"/>
- <result property="damTear" column="DAM_TEAR"/>
- <result property="damLandSubSide" column="DAM_LAND_SUB_SIDE"/>
- <result property="damRsog" column="DAM_RSOG"/>
- <result property="damLopc" column="DAM_LOPC"/>
- <result property="dsLts" column="DS_LTS"/>
- <result property="dsCc" column="DS_CC"/>
- <result property="dsOc" column="DS_OC"/>
- <result property="frsMar" column="FRS_MAR"/>
- <result property="frsTbd" column="FRS_TBD"/>
- <result property="frsOth" column="FRS_OTH"/>
- <result property="note" column="NOTE"/>
- <result property="inTm" column="IN_TM"/>
- <result property="upTm" column="UP_TM"/>
- </resultMap>
-
- <sql id="table_columns">
- SD_CODE,
- SD_NAME,
- SD_TYPE,
- SD_TYPE_STR,
- CON_AREA,
- TOT_CAP,
- FLCO_CAP,
- SDR_CAP,
- FLCO_YEAR,
- WARP_CAP,
- DAM_SIZE_HIG,
- DAM_TOP_LEN,
- AD_CODE,
- SD_LOC,
- CENTER_X,
- CENTER_Y,
- GD_X,
- GD_Y,
- ASINTTDS,
- NO_SPWAY,
- DAM_TEAR,
- DAM_LAND_SUB_SIDE,
- DAM_RSOG,
- DAM_LOPC,
- DS_LTS,
- DS_CC,
- DS_OC,
- FRS_MAR,
- FRS_TBD,
- FRS_OTH,
- NOTE,
- IN_TM,
- UP_TM
- </sql>
- <sql id="entity_properties">
- #{sdCode},
- #{sdName},
- #{sdType},
- #{sdTypeStr},
- #{conArea},
- #{totCap},
- #{flcoCap},
- #{sdrCap},
- #{flcoYear},
- #{warpCap},
- #{damSizeHig},
- #{damTopLen},
- #{adCode},
- #{sdLoc},
- #{centerX},
- #{centerY},
- #{gdX},
- #{gdY},
- #{asinttds},
- #{noSpway},
- #{damTear},
- #{damLandSubSide},
- #{damRsog},
- #{damLopc},
- #{dsLts},
- #{dsCc},
- #{dsOc},
- #{frsMar},
- #{frsTbd},
- #{frsOth},
- #{note},
- #{inTm},
- #{upTm}
- </sql>
- <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
- <sql id="page_where">
- <trim prefix="where" prefixOverrides="and | or ">
- <if test="sdName != null and sdName != ''">and SD_NAME = #{sdName}</if>
- <if test="sdType != null and sdType != ''">and SD_TYPE = #{sdType}</if>
- <if test="sdTypeStr != null and sdTypeStr != ''">and SD_TYPE_STR = #{sdTypeStr}</if>
- <if test="conArea != null and conArea != ''">and CON_AREA = #{conArea}</if>
- <if test="totCap != null and totCap != ''">and TOT_CAP = #{totCap}</if>
- <if test="flcoCap != null and flcoCap != ''">and FLCO_CAP = #{flcoCap}</if>
- <if test="sdrCap != null and sdrCap != ''">and SDR_CAP = #{sdrCap}</if>
- <if test="flcoYear != null and flcoYear != ''">and FLCO_YEAR = #{flcoYear}</if>
- <if test="warpCap != null and warpCap != ''">and WARP_CAP = #{warpCap}</if>
- <if test="damSizeHig != null and damSizeHig != ''">and DAM_SIZE_HIG = #{damSizeHig}</if>
- <if test="damTopLen != null and damTopLen != ''">and DAM_TOP_LEN = #{damTopLen}</if>
- <if test="adCode != null and adCode != ''">and AD_CODE = #{adCode}</if>
- <if test="sdLoc != null and sdLoc != ''">and SD_LOC = #{sdLoc}</if>
- <if test="centerX != null and centerX != ''">and CENTER_X = #{centerX}</if>
- <if test="centerY != null and centerY != ''">and CENTER_Y = #{centerY}</if>
- <if test="gdX != null and gdX != ''">and GD_X = #{gdX}</if>
- <if test="gdY != null and gdY != ''">and GD_Y = #{gdY}</if>
- <if test="asinttds != null and asinttds != ''">and ASINTTDS = #{asinttds}</if>
- <if test="noSpway != null and noSpway != ''">and NO_SPWAY = #{noSpway}</if>
- <if test="damTear != null and damTear != ''">and DAM_TEAR = #{damTear}</if>
- <if test="damLandSubSide != null and damLandSubSide != ''">and DAM_LAND_SUB_SIDE = #{damLandSubSide}</if>
- <if test="damRsog != null and damRsog != ''">and DAM_RSOG = #{damRsog}</if>
- <if test="damLopc != null and damLopc != ''">and DAM_LOPC = #{damLopc}</if>
- <if test="dsLts != null and dsLts != ''">and DS_LTS = #{dsLts}</if>
- <if test="dsCc != null and dsCc != ''">and DS_CC = #{dsCc}</if>
- <if test="dsOc != null and dsOc != ''">and DS_OC = #{dsOc}</if>
- <if test="frsMar != null and frsMar != ''">and FRS_MAR = #{frsMar}</if>
- <if test="frsTbd != null and frsTbd != ''">and FRS_TBD = #{frsTbd}</if>
- <if test="frsOth != null and frsOth != ''">and FRS_OTH = #{frsOth}</if>
- <if test="note != null and note != ''">and NOTE = #{note}</if>
- <if test="inTm != null">and IN_TM = #{inTm}</if>
- <if test="upTm != null">and UP_TM = #{upTm}</if>
- </trim>
- </sql>
- <select id="get" resultMap="attSdBaseResultMap" parameterType="String" >
- select <include refid="table_columns" /> from ATT_SD_BASE where SD_CODE = #{id}
- </select>
- <select id="getBy" resultMap="attSdBaseResultMap">
- select <include refid="table_columns" /> from ATT_SD_BASE <include refid="page_where" />
- </select>
- <select id="findAll" resultMap="attSdBaseResultMap">
- select <include refid="table_columns" /> from ATT_SD_BASE
- </select>
- <select id="findList" resultMap="attSdBaseResultMap">
- select <include refid="table_columns" /> from ATT_SD_BASE <include refid="page_where" />
- </select>
- <select id="selectCount" resultType="int" >
- select count(ID) from ATT_SD_BASE <include refid="page_where" />
- </select>
- <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.AttSdBase">
- insert into ATT_SD_BASE( <include refid="table_columns" /> )
- values ( <include refid="entity_properties" /> )
- </insert>
- <delete id="delete" parameterType="java.lang.String">
- delete from ATT_SD_BASE where ID = #{id}
- </delete>
- <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.AttSdBase">
- delete from ATT_SD_BASE <include refid="page_where" />
- </delete>
- <update id="deleteInFlag" parameterType="java.lang.String">
- update ATT_SD_BASE set flag_valid = 0 where ID = #{id}
- </update>
- <update id="update" parameterType="cn.com.goldenwater.dcproj.model.AttSdBase">
- update ATT_SD_BASE
- <trim prefix="set" suffixOverrides=",">
- <if test="sdName != null and sdName != ''">SD_NAME = #{sdName},</if>
- <if test="sdType != null and sdType != ''">SD_TYPE = #{sdType},</if>
- <if test="sdTypeStr != null and sdTypeStr != ''">SD_TYPE_STR = #{sdTypeStr},</if>
- <if test="conArea != null and conArea != ''">CON_AREA = #{conArea},</if>
- <if test="totCap != null and totCap != ''">TOT_CAP = #{totCap},</if>
- <if test="flcoCap != null and flcoCap != ''">FLCO_CAP = #{flcoCap},</if>
- <if test="sdrCap != null and sdrCap != ''">SDR_CAP = #{sdrCap},</if>
- <if test="flcoYear != null and flcoYear != ''">FLCO_YEAR = #{flcoYear},</if>
- <if test="warpCap != null and warpCap != ''">WARP_CAP = #{warpCap},</if>
- <if test="damSizeHig != null and damSizeHig != ''">DAM_SIZE_HIG = #{damSizeHig},</if>
- <if test="damTopLen != null and damTopLen != ''">DAM_TOP_LEN = #{damTopLen},</if>
- <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
- <if test="sdLoc != null and sdLoc != ''">SD_LOC = #{sdLoc},</if>
- <if test="centerX != null and centerX != ''">CENTER_X = #{centerX},</if>
- <if test="centerY != null and centerY != ''">CENTER_Y = #{centerY},</if>
- <if test="gdX != null and gdX != ''">GD_X = #{gdX},</if>
- <if test="gdY != null and gdY != ''">GD_Y = #{gdY},</if>
- <if test="asinttds != null and asinttds != ''">ASINTTDS = #{asinttds},</if>
- <if test="noSpway != null and noSpway != ''">NO_SPWAY = #{noSpway},</if>
- <if test="damTear != null and damTear != ''">DAM_TEAR = #{damTear},</if>
- <if test="damLandSubSide != null and damLandSubSide != ''">DAM_LAND_SUB_SIDE = #{damLandSubSide},</if>
- <if test="damRsog != null and damRsog != ''">DAM_RSOG = #{damRsog},</if>
- <if test="damLopc != null and damLopc != ''">DAM_LOPC = #{damLopc},</if>
- <if test="dsLts != null and dsLts != ''">DS_LTS = #{dsLts},</if>
- <if test="dsCc != null and dsCc != ''">DS_CC = #{dsCc},</if>
- <if test="dsOc != null and dsOc != ''">DS_OC = #{dsOc},</if>
- <if test="frsMar != null and frsMar != ''">FRS_MAR = #{frsMar},</if>
- <if test="frsTbd != null and frsTbd != ''">FRS_TBD = #{frsTbd},</if>
- <if test="frsOth != null and frsOth != ''">FRS_OTH = #{frsOth},</if>
- <if test="note != null and note != ''">NOTE = #{note},</if>
- <if test="inTm != null">IN_TM = #{inTm},</if>
- <if test="upTm != null">UP_TM = #{upTm},</if>
- </trim>
- <where>SD_CODE = #{id}</where>
- </update>
- <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.AttSdBase">
- update ATT_SD_BASE
- <trim prefix="set" suffixOverrides=",">
- <if test="sdName != null and sdName != ''">SD_NAME = #{sdName},</if>
- <if test="sdType != null and sdType != ''">SD_TYPE = #{sdType},</if>
- <if test="sdTypeStr != null and sdTypeStr != ''">SD_TYPE_STR = #{sdTypeStr},</if>
- <if test="conArea != null and conArea != ''">CON_AREA = #{conArea},</if>
- <if test="totCap != null and totCap != ''">TOT_CAP = #{totCap},</if>
- <if test="flcoCap != null and flcoCap != ''">FLCO_CAP = #{flcoCap},</if>
- <if test="sdrCap != null and sdrCap != ''">SDR_CAP = #{sdrCap},</if>
- <if test="flcoYear != null and flcoYear != ''">FLCO_YEAR = #{flcoYear},</if>
- <if test="warpCap != null and warpCap != ''">WARP_CAP = #{warpCap},</if>
- <if test="damSizeHig != null and damSizeHig != ''">DAM_SIZE_HIG = #{damSizeHig},</if>
- <if test="damTopLen != null and damTopLen != ''">DAM_TOP_LEN = #{damTopLen},</if>
- <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
- <if test="sdLoc != null and sdLoc != ''">SD_LOC = #{sdLoc},</if>
- <if test="centerX != null and centerX != ''">CENTER_X = #{centerX},</if>
- <if test="centerY != null and centerY != ''">CENTER_Y = #{centerY},</if>
- <if test="gdX != null and gdX != ''">GD_X = #{gdX},</if>
- <if test="gdY != null and gdY != ''">GD_Y = #{gdY},</if>
- <if test="asinttds != null and asinttds != ''">ASINTTDS = #{asinttds},</if>
- <if test="noSpway != null and noSpway != ''">NO_SPWAY = #{noSpway},</if>
- <if test="damTear != null and damTear != ''">DAM_TEAR = #{damTear},</if>
- <if test="damLandSubSide != null and damLandSubSide != ''">DAM_LAND_SUB_SIDE = #{damLandSubSide},</if>
- <if test="damRsog != null and damRsog != ''">DAM_RSOG = #{damRsog},</if>
- <if test="damLopc != null and damLopc != ''">DAM_LOPC = #{damLopc},</if>
- <if test="dsLts != null and dsLts != ''">DS_LTS = #{dsLts},</if>
- <if test="dsCc != null and dsCc != ''">DS_CC = #{dsCc},</if>
- <if test="dsOc != null and dsOc != ''">DS_OC = #{dsOc},</if>
- <if test="frsMar != null and frsMar != ''">FRS_MAR = #{frsMar},</if>
- <if test="frsTbd != null and frsTbd != ''">FRS_TBD = #{frsTbd},</if>
- <if test="frsOth != null and frsOth != ''">FRS_OTH = #{frsOth},</if>
- <if test="note != null and note != ''">NOTE = #{note},</if>
- <if test="inTm != null">IN_TM = #{inTm},</if>
- <if test="upTm != null">UP_TM = #{upTm},</if>
- </trim>
- <include refid="page_where" />
- </update>
- <select id="getObjByPersId" resultType="cn.com.goldenwater.dcproj.model.AttSdBase" parameterType="cn.com.goldenwater.dcproj.param.PersObjParam">
- SELECT A.* ,B.OBJ_ID,B.ID groupId,C.ID rgstrId FROM ATT_SD_BASE A LEFT JOIN BIS_INSP_ALL_OBJ B ON A.sd_code = B.CODE
- LEFT JOIN BIS_INSP_SD_RGSTR C ON B.OBJ_ID = C.OBJ_ID
- WHERE B.PTYPE = #{objType} AND
- B.id in (${inIdsSql})
- <choose>
- <when test="province !=null and province !=''">
- and B.AD_CODE =#{province}
- </when>
- <otherwise>
- and B.AD_CODE is null
- </otherwise>
- </choose>
- <if test="adName != null and adName != ''">and A.NAME LIKE '%${adName}%'</if>
- <if test="adCode != null and adCode != ''">and A.AD_CODE LIKE '${adCode}%'</if>
- </select>
- <!-- 其他自定义SQL -->
- <select id="findListBy" parameterType="cn.com.goldenwater.dcproj.param.PersObjParam" resultType="cn.com.goldenwater.dcproj.model.AttSdBase">
- SELECT
- A.SD_CODE,
- A.SD_NAME,
- A.SD_TYPE,
- A.SD_TYPE_STR,
- A.CON_AREA,
- A.TOT_CAP,
- A.FLCO_CAP
- A.SDR_CAP,
- A.FLCO_YEAR,
- A.WARP_CAP,
- A.DAM_SIZE_HIG,
- A.DAM_TOP_LEN,
- A.AD_CODE,
- A.SD_LOC,
- A.CENTER_X,
- A.CENTER_Y,
- A.GD_X,
- A.GD_Y,
- A.ASINTTDS,
- A.NO_SPWAY,
- A.DAM_TEAR,
- A.DAM_LAND_SUB_SIDE,
- A.DAM_RSOG,
- A.DAM_LOPC,
- A.DS_LTS,
- A.DS_CC,
- A.DS_OC,
- A.FRS_MAR,
- A.FRS_TBD,
- A.FRS_OTH,
- A.NOTE,
- A.IN_TM,
- A.UP_TM
- FROM ATT_SD_BASE A
- where 1=1
- <if test="adName != null and adName != ''">and A.SD_NAME LIKE '%${adName}%'</if>
- <if test="adCode != null and adCode != ''">and A.AD_CODE LIKE '${adCode}%'</if>
- <if test="maxLgtd != null and maxLgtd != '' and minLgtd != null and minLgtd != ''">and A.CENTER_X BETWEEN
- #{minLgtd} AND #{maxLgtd}
- </if>
- <if test="maxLttd != null and maxLttd != '' and minLttd != null and minLttd != ''">and A.CENTER_Y BETWEEN
- #{minLttd} AND #{maxLttd}
- </if>
- </select>
- <select id="getObjListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.model.AttSdBase" parameterType="String">
- select t.*
- from ATT_SD_BASE t
- where t.SD_CODE not in (
- select CODE from BIS_INSP_ALL_OBJ B where id like concat(#{inspGroupId},'%') and B.obj_type=#{objType}
- <choose>
- <when test="province !=null and province !=''">
- and B.AD_CODE =#{province}
- </when>
- <otherwise>
- and B.AD_CODE is null
- </otherwise>
- </choose>
- )
- <if test="adName != null and adName != ''">and t.nm LIKE '%${adName}%'</if>
- <if test="adCode != null and adCode != ''">and t.AD_CODE LIKE '${adCode}%'</if>
- </select>
- </mapper>
|