| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391 |
- <?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.BisInspHystInfoDao">
- <resultMap type="cn.com.goldenwater.dcproj.model.BisInspHystInfo" id="bisInspHystInfoResultMap">
- <result property="baseId" column="BASE_ID"/>
- <result property="statisCode" column="STATIS_CODE"/>
- <result property="isNeedRuleAsWfip" column="IS_NEED_RULE_AS_WFIP"/>
- <result property="rectState" column="RECT_STATE"/>
- <result property="oocState" column="OOC_STATE"/>
- <result property="sfmngState" column="SFMNG_STATE"/>
- <result property="fillInfoIsFake" column="FILL_INFO_IS_FAKE"/>
- <result property="isRuleAsWfip" column="IS_RULE_AS_WFIP"/>
- <result property="note" column="NOTE"/>
- <result property="status" column="STATUS"/>
- <result property="persId" column="PERS_ID"/>
- <result property="intm" column="INTM"/>
- <result property="uptm" column="UPTM"/>
- <result property="id" column="ID"/>
- <result property="rgstrId" column="RGSTR_ID"/>
- <result property="hystName" column="HYST_NAME"/>
- <result property="linkMan" column="LINK_MAN"/>
- <result property="linkTel" column="LINK_TEL"/>
- <result property="adCode" column="AD_CODE"/>
- <result property="adName" column="AD_NAME"/>
- <result property="hystSite" column="HYST_SITE"/>
- <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="hystLong" column="HYST_LONG"/>
- <result property="hystLat" column="HYST_LAT"/>
- <result property="hystGdX" column="HYST_GD_X"/>
- <result property="hystGdY" column="HYST_GD_Y"/>
- <result property="rvName" column="RV_NAME"/>
- <result property="compDate" column="COMP_DATE"/>
- <result property="ownerType" column="OWNER_TYPE"/>
- <result property="exptType" column="EXPT_TYPE"/>
- <result property="insCap" column="INS_CAP"/>
- <result property="damHeig" column="DAM_HEIG"/>
- <result property="totCap" column="TOT_CAP"/>
- <result property="hystIsReg" column="HYST_IS_REG"/>
- <result property="regNo" column="REG_NO"/>
- <result property="isSafety" column="IS_SAFETY"/>
- <result property="zlgyFlow" column="ZLGY_FLOW"/>
- <result property="exmnType" column="EXMN_TYPE"/>
- <result property="platInfoIsFullAwr" column="PLAT_INFO_IS_FULL_AWR"/>
- <result property="awrInfoNo" column="AWR_INFO_NO"/>
- </resultMap>
-
- <sql id="table_columns">
- BASE_ID,
- STATIS_CODE,
- IS_NEED_RULE_AS_WFIP,
- RECT_STATE,
- OOC_STATE,
- SFMNG_STATE,
- FILL_INFO_IS_FAKE,
- IS_RULE_AS_WFIP,
- NOTE,
- STATUS,
- PERS_ID,
- INTM,
- UPTM,
- ID,
- RGSTR_ID,
- HYST_NAME,
- LINK_MAN,
- LINK_TEL,
- AD_CODE,
- AD_NAME,
- HYST_SITE,
- CENTER_X,
- CENTER_Y,
- GD_X,
- GD_Y,
- HYST_LONG,
- HYST_LAT,
- HYST_GD_X,
- HYST_GD_Y,
- RV_NAME,
- COMP_DATE,
- OWNER_TYPE,
- EXPT_TYPE,
- INS_CAP,
- DAM_HEIG,
- TOT_CAP,
- HYST_IS_REG,
- REG_NO,
- IS_SAFETY,
- ZLGY_FLOW,
- EXMN_TYPE,
- PLAT_INFO_IS_FULL_AWR,
- AWR_INFO_NO
- </sql>
- <sql id="entity_properties">
- #{baseId},
- #{statisCode},
- #{isNeedRuleAsWfip},
- #{rectState},
- #{oocState},
- #{sfmngState},
- #{fillInfoIsFake},
- #{isRuleAsWfip},
- #{note},
- #{status},
- #{persId},
- #{intm},
- #{uptm},
- #{id},
- #{rgstrId},
- #{hystName},
- #{linkMan},
- #{linkTel},
- #{adCode},
- #{adName},
- #{hystSite},
- #{centerX},
- #{centerY},
- #{gdX},
- #{gdY},
- #{hystLong},
- #{hystLat},
- #{hystGdX},
- #{hystGdY},
- #{rvName},
- #{compDate},
- #{ownerType},
- #{exptType},
- #{insCap},
- #{damHeig},
- #{totCap},
- #{hystIsReg},
- #{regNo},
- #{isSafety},
- #{zlgyFlow},
- #{exmnType},
- #{platInfoIsFullAwr},
- #{awrInfoNo}
- </sql>
- <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
- <sql id="page_where">
- <trim prefix="where" prefixOverrides="and | or ">
- <if test="statisCode != null and statisCode != ''">and STATIS_CODE = #{statisCode}</if>
- <if test="isNeedRuleAsWfip != null and isNeedRuleAsWfip != ''">and IS_NEED_RULE_AS_WFIP = #{isNeedRuleAsWfip}</if>
- <if test="rectState != null and rectState != ''">and RECT_STATE = #{rectState}</if>
- <if test="oocState != null and oocState != ''">and OOC_STATE = #{oocState}</if>
- <if test="sfmngState != null and sfmngState != ''">and SFMNG_STATE = #{sfmngState}</if>
- <if test="fillInfoIsFake != null and fillInfoIsFake != ''">and FILL_INFO_IS_FAKE = #{fillInfoIsFake}</if>
- <if test="isRuleAsWfip != null and isRuleAsWfip != ''">and IS_RULE_AS_WFIP = #{isRuleAsWfip}</if>
- <if test="note != null and note != ''">and NOTE = #{note}</if>
- <if test="status != null and status != ''">and STATUS = #{status}</if>
- <if test="persId != null and persId != ''">and PERS_ID = #{persId}</if>
- <if test="intm != null">and INTM = #{intm}</if>
- <if test="uptm != null">and UPTM = #{uptm}</if>
- <if test="id != null and id != ''">and ID = #{id}</if>
- <if test="rgstrId != null and rgstrId != ''">and RGSTR_ID = #{rgstrId}</if>
- <if test="hystName != null and hystName != ''">and HYST_NAME = #{hystName}</if>
- <if test="linkMan != null and linkMan != ''">and LINK_MAN = #{linkMan}</if>
- <if test="linkTel != null and linkTel != ''">and LINK_TEL = #{linkTel}</if>
- <if test="adCode != null and adCode != ''">and AD_CODE = #{adCode}</if>
- <if test="adName != null and adName != ''">and AD_NAME = #{adName}</if>
- <if test="hystSite != null and hystSite != ''">and HYST_SITE = #{hystSite}</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="hystLong != null and hystLong != ''">and HYST_LONG = #{hystLong}</if>
- <if test="hystLat != null and hystLat != ''">and HYST_LAT = #{hystLat}</if>
- <if test="hystGdX != null and hystGdX != ''">and HYST_GD_X = #{hystGdX}</if>
- <if test="hystGdY != null and hystGdY != ''">and HYST_GD_Y = #{hystGdY}</if>
- <if test="rvName != null and rvName != ''">and RV_NAME = #{rvName}</if>
- <if test="compDate != null and compDate != ''">and COMP_DATE = #{compDate}</if>
- <if test="ownerType != null and ownerType != ''">and OWNER_TYPE = #{ownerType}</if>
- <if test="exptType != null and exptType != ''">and EXPT_TYPE = #{exptType}</if>
- <if test="insCap != null and insCap != ''">and INS_CAP = #{insCap}</if>
- <if test="damHeig != null and damHeig != ''">and DAM_HEIG = #{damHeig}</if>
- <if test="totCap != null and totCap != ''">and TOT_CAP = #{totCap}</if>
- <if test="hystIsReg != null and hystIsReg != ''">and HYST_IS_REG = #{hystIsReg}</if>
- <if test="regNo != null and regNo != ''">and REG_NO = #{regNo}</if>
- <if test="isSafety != null and isSafety != ''">and IS_SAFETY = #{isSafety}</if>
- <if test="zlgyFlow != null and zlgyFlow != ''">and ZLGY_FLOW = #{zlgyFlow}</if>
- <if test="exmnType != null and exmnType != ''">and EXMN_TYPE = #{exmnType}</if>
- <if test="platInfoIsFullAwr != null and platInfoIsFullAwr != ''">and PLAT_INFO_IS_FULL_AWR = #{platInfoIsFullAwr}</if>
- <if test="awrInfoNo != null and awrInfoNo != ''">and AWR_INFO_NO = #{awrInfoNo}</if>
- </trim>
- </sql>
- <select id="get" resultMap="bisInspHystInfoResultMap" parameterType="String" >
- select <include refid="table_columns" /> from BIS_INSP_HYST_INFO where ID = #{id}
- </select>
- <select id="getBy" resultMap="bisInspHystInfoResultMap">
- select <include refid="table_columns" /> from BIS_INSP_HYST_INFO <include refid="page_where" />
- </select>
- <select id="findAll" resultMap="bisInspHystInfoResultMap">
- select <include refid="table_columns" /> from BIS_INSP_HYST_INFO
- </select>
- <select id="findList" resultMap="bisInspHystInfoResultMap">
- select <include refid="table_columns" /> from BIS_INSP_HYST_INFO <include refid="page_where" />
- </select>
- <select id="selectCount" resultType="int" >
- select count(ID) from BIS_INSP_HYST_INFO <include refid="page_where" />
- </select>
- <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.BisInspHystInfo">
- insert into BIS_INSP_HYST_INFO( <include refid="table_columns" /> )
- values ( <include refid="entity_properties" /> )
- </insert>
- <delete id="delete" parameterType="java.lang.String">
- delete from BIS_INSP_HYST_INFO where ID = #{id}
- </delete>
- <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspHystInfo">
- delete from BIS_INSP_HYST_INFO <include refid="page_where" />
- </delete>
- <update id="deleteInFlag" parameterType="java.lang.String">
- update BIS_INSP_HYST_INFO set flag_valid = 0 where ID = #{id}
- </update>
- <update id="update" parameterType="cn.com.goldenwater.dcproj.model.BisInspHystInfo">
- update BIS_INSP_HYST_INFO
- <trim prefix="set" suffixOverrides=",">
- <if test="statisCode != null">STATIS_CODE = #{statisCode},</if>
- <if test="isNeedRuleAsWfip != null">IS_NEED_RULE_AS_WFIP = #{isNeedRuleAsWfip},</if>
- <if test="rectState != null">RECT_STATE = #{rectState},</if>
- <if test="oocState != null">OOC_STATE = #{oocState},</if>
- <if test="sfmngState != null">SFMNG_STATE = #{sfmngState},</if>
- <if test="fillInfoIsFake != null">FILL_INFO_IS_FAKE = #{fillInfoIsFake},</if>
- <if test="isRuleAsWfip != null">IS_RULE_AS_WFIP = #{isRuleAsWfip},</if>
- <if test="note != null">NOTE = #{note},</if>
- <if test="status != null">STATUS = #{status},</if>
- <if test="persId != null">PERS_ID = #{persId},</if>
- <if test="intm != null">INTM = #{intm},</if>
- <if test="uptm != null">UPTM = #{uptm},</if>
- <if test="id != null and id != ''">ID = #{id},</if>
- <if test="rgstrId != null and rgstrId != ''">RGSTR_ID = #{rgstrId},</if>
- <if test="hystName != null">HYST_NAME = #{hystName},</if>
- <if test="linkMan != null">LINK_MAN = #{linkMan},</if>
- <if test="linkTel != null">LINK_TEL = #{linkTel},</if>
- <if test="adCode != null">AD_CODE = #{adCode},</if>
- <if test="adName != null">AD_NAME = #{adName},</if>
- <if test="hystSite != null">HYST_SITE = #{hystSite},</if>
- <if test="centerX != null">CENTER_X = #{centerX},</if>
- <if test="centerY != null">CENTER_Y = #{centerY},</if>
- <if test="gdX != null">GD_X = #{gdX},</if>
- <if test="gdY != null">GD_Y = #{gdY},</if>
- <if test="hystLong != null">HYST_LONG = #{hystLong},</if>
- <if test="hystLat != null">HYST_LAT = #{hystLat},</if>
- <if test="hystGdX != null">HYST_GD_X = #{hystGdX},</if>
- <if test="hystGdY != null">HYST_GD_Y = #{hystGdY},</if>
- <if test="rvName != null">RV_NAME = #{rvName},</if>
- <if test="compDate != null">COMP_DATE = #{compDate},</if>
- <if test="ownerType != null">OWNER_TYPE = #{ownerType},</if>
- <if test="exptType != null">EXPT_TYPE = #{exptType},</if>
- <if test="insCap != null">INS_CAP = #{insCap},</if>
- <if test="damHeig != null">DAM_HEIG = #{damHeig},</if>
- <if test="totCap != null">TOT_CAP = #{totCap},</if>
- <if test="hystIsReg != null">HYST_IS_REG = #{hystIsReg},</if>
- <if test="regNo != null">REG_NO = #{regNo},</if>
- <if test="isSafety != null">IS_SAFETY = #{isSafety},</if>
- <if test="zlgyFlow != null">ZLGY_FLOW = #{zlgyFlow},</if>
- <if test="exmnType != null">EXMN_TYPE = #{exmnType},</if>
- <if test="platInfoIsFullAwr != null">PLAT_INFO_IS_FULL_AWR = #{platInfoIsFullAwr},</if>
- <if test="awrInfoNo != null">AWR_INFO_NO = #{awrInfoNo},</if>
- </trim>
- <where>ID = #{id}</where>
- </update>
- <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspHystInfo">
- update BIS_INSP_HYST_INFO
- <trim prefix="set" suffixOverrides=",">
- <if test="statisCode != null">STATIS_CODE = #{statisCode},</if>
- <if test="isNeedRuleAsWfip != null">IS_NEED_RULE_AS_WFIP = #{isNeedRuleAsWfip},</if>
- <if test="rectState != null">RECT_STATE = #{rectState},</if>
- <if test="oocState != null">OOC_STATE = #{oocState},</if>
- <if test="sfmngState != null">SFMNG_STATE = #{sfmngState},</if>
- <if test="fillInfoIsFake != null">FILL_INFO_IS_FAKE = #{fillInfoIsFake},</if>
- <if test="isRuleAsWfip != null">IS_RULE_AS_WFIP = #{isRuleAsWfip},</if>
- <if test="note != null">NOTE = #{note},</if>
- <if test="status != null">STATUS = #{status},</if>
- <if test="persId != null">PERS_ID = #{persId},</if>
- <if test="intm != null">INTM = #{intm},</if>
- <if test="uptm != null">UPTM = #{uptm},</if>
- <if test="id != null and id != ''">ID = #{id},</if>
- <if test="rgstrId != null and rgstrId != ''">RGSTR_ID = #{rgstrId},</if>
- <if test="hystName != null">HYST_NAME = #{hystName},</if>
- <if test="linkMan != null">LINK_MAN = #{linkMan},</if>
- <if test="linkTel != null">LINK_TEL = #{linkTel},</if>
- <if test="adCode != null">AD_CODE = #{adCode},</if>
- <if test="adName != null">AD_NAME = #{adName},</if>
- <if test="hystSite != null">HYST_SITE = #{hystSite},</if>
- <if test="centerX != null">CENTER_X = #{centerX},</if>
- <if test="centerY != null">CENTER_Y = #{centerY},</if>
- <if test="gdX != null">GD_X = #{gdX},</if>
- <if test="gdY != null">GD_Y = #{gdY},</if>
- <if test="hystLong != null">HYST_LONG = #{hystLong},</if>
- <if test="hystLat != null">HYST_LAT = #{hystLat},</if>
- <if test="hystGdX != null">HYST_GD_X = #{hystGdX},</if>
- <if test="hystGdY != null">HYST_GD_Y = #{hystGdY},</if>
- <if test="rvName != null">RV_NAME = #{rvName},</if>
- <if test="compDate != null">COMP_DATE = #{compDate},</if>
- <if test="ownerType != null">OWNER_TYPE = #{ownerType},</if>
- <if test="exptType != null">EXPT_TYPE = #{exptType},</if>
- <if test="insCap != null">INS_CAP = #{insCap},</if>
- <if test="damHeig != null">DAM_HEIG = #{damHeig},</if>
- <if test="totCap != null">TOT_CAP = #{totCap},</if>
- <if test="hystIsReg != null">HYST_IS_REG = #{hystIsReg},</if>
- <if test="regNo != null">REG_NO = #{regNo},</if>
- <if test="isSafety != null">IS_SAFETY = #{isSafety},</if>
- <if test="zlgyFlow != null">ZLGY_FLOW = #{zlgyFlow},</if>
- <if test="exmnType != null">EXMN_TYPE = #{exmnType},</if>
- <if test="platInfoIsFullAwr != null">PLAT_INFO_IS_FULL_AWR = #{platInfoIsFullAwr},</if>
- <if test="awrInfoNo != null">AWR_INFO_NO = #{awrInfoNo},</if>
- </trim>
- <include refid="page_where" />
- </update>
- <!-- 其他自定义SQL -->
- <update id="updateGdXy" parameterType="cn.com.goldenwater.dcproj.model.BisInspHystInfo">
- update BIS_INSP_HYST_INFO
- <trim prefix="set" suffixOverrides=",">
- <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="hystLong != null and hystLong != ''">HYST_LONG = #{hystLong},</if>
- <if test="hystLat != null and hystLat != ''">HYST_LAT = #{hystLat},</if>
- <if test="hystGdX != null and hystGdX != ''">HYST_GD_X = #{hystGdX},</if>
- <if test="hystGdY != null and hystGdY != ''">HYST_GD_Y = #{hystGdY},</if>
- </trim>
- <where>ID = #{id}</where>
- </update>
- <select id="findHystList" resultType="cn.com.goldenwater.dcproj.dto.BisInspRgstrDto">
- SELECT * FROM (
- select B.OBJ_ID AS objId, A.HYST_NAME AS nm, #{pType} pType, A.ID, B.ID as rgstrId, A.LINK_MAN AS attn, A.BASE_ID as code,
- A.CENTER_X AS CENTERX, A.CENTER_Y AS CENTERY,
- A.HYST_LONG AS LGTD, A.HYST_LAT AS LTTD,
- A.HYST_GD_X AS gdX, A.HYST_GD_Y AS gdY,
- A.ID AS wintCode,
- (case when A.STATUS is null then '0' else A.STATUS end) STATUS,
- A.INTM,A.UPTM,
- (CASE WHEN B.AD_FULL_NAME IS NULL THEN to_char( e.AD_FULL_NAME ) ELSE B.AD_FULL_NAME END ) adName
- from BIS_INSP_HYST_INFO A
- LEFT JOIN BIS_INSP_HYST_RGSTR B ON A.RGSTR_ID=B.ID
- LEFT JOIN ATT_AD_X_BASE e on B.AD_CODE = e.ad_code
- LEFT JOIN BIS_INSP_ALL_OBJ C ON B.OBJ_ID = C.OBJ_ID
- WHERE C.Id in (
- select distinct id from (
- SELECT P.id FROM BIS_INSP_ALL P START WITH P.PID IN (SELECT id FROM BIS_INSP_ALL_RLATION A
- WHERE A.PERSID = #{presId} AND Type=#{pType}
- and (length(id) between 2 and 20))
- CONNECT BY P.PID = PRIOR P.ID
- union all
- SELECT P.id FROM BIS_INSP_ALL P where p.id in (SELECT id FROM BIS_INSP_ALL_RLATION A
- WHERE A.PERSID = #{presId} AND Type=#{pType}
- and length(id)> 11 )
- )
- )
- <if test="adCodes !=null and adCodes !=''">
- and
- <foreach item="item" index="index" collection="adCodes.split(',')" open="(" separator="or" close=")">
- b.ad_code like concat('${item}','%')
- </foreach>
- </if>
- ) A WHERE a.PTYPE=#{pType}
- <if test="status !=null and status !=''">
- and STATUS in (${status})
- </if>
- <if test="rsName !=null and rsName !=''">
- and a.nm like '%${rsName}%'
- </if>
- <if test="code !=null and code !=''">
- and a.code = #{code}
- </if>
- <if test="adName != null and adName != ''">and a.adName like '%${adName}%'</if>
- <if test="sttm != null and sttm != ''">and a.Intm>= TO_DATE(#{sttm},'YYYY-MM-DD')</if>
- <if test="entm != null and entm != ''">and a.Intm < To_DATE(#{entm},'yyyy-MM-dd') + 1</if>
- </select>
- </mapper>
|