| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602 |
- <?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.BisInspRsvrRgstrDao">
- <resultMap type="cn.com.goldenwater.dcproj.model.BisInspRsvrRgstr" id="bisInspRsvrRgstrResultMap">
- <result property="rgstrId" column="RGSTR_ID"/>
- <result property="objId" column="OBJ_ID"/>
- <result property="rsvrNm" column="RSVR_NM"/>
- <result property="adCode" column="AD_CODE"/>
- <result property="resCreateTime" column="RES_CREATE_TIME"/>
- <result property="engScal" column="ENG_SCAL"/>
- <result property="hystSite" column="HYST_SITE"/>
- <result property="totCap" column="TOT_CAP"/>
- <result property="damRegCode" column="DAM_REG_CODE"/>
- <result property="damType" column="DAM_TYPE"/>
- <result property="hasDamRegCode" column="HAS_DAM_REG_CODE"/>
- <result property="resCreateTimeNote" column="RES_CREATE_TIME_NOTE"/>
- <result property="engScalNote" column="ENG_SCAL_NOTE"/>
- <result property="state" column="STATE"/>
- <result property="groupLeader" column="GROUP_LEADER"/>
- <result property="groupLeaderTel" column="GROUP_LEADER_TEL"/>
- <result property="recPersId" column="REC_PERS_ID"/>
- <result property="recPers" column="REC_PERS"/>
- <result property="recPersTel" column="REC_PERS_TEL"/>
- <result property="uptm" column="UPTM"/>
- <result property="intm" column="INTM"/>
- <result property="note" column="NOTE"/>
- <result property="dataStat" column="DATA_STAT"/>
- <result property="dataStat" column="DATA_STAT"/>
- <result property="rsvrLong" column="RSVR_LONG"/>
- <result property="rsvrLat" column="RSVR_LAT"/>
- <result property="baseStat" column="BASE_STAT"/>
- <result property="viewStat" column="VIEW_STAT"/>
- <result property="presStat" column="PRES_STAT"/>
- <result property="benefitStat" column="BENEFIT_STAT"/>
- <result property="resRunStat" column="RES_RUN_STAT"/>
- <result property="damMaxHigh" column="DAM_MAX_HIGH"/>
- <result property="rsCode" column="RS_CODE"/>
- <result property="liaisonManTel" column="liaison_Man_Tel"/>
- <result property="liaisonMan" column="liaison_Man"/>
- <result property="rsvrAdmName" column="rsvr_adm_name"/>
- <result property="compDateStr" column="COMP_DATE_STR"/>
- <result property="reverStat" column="REVER_STAT"/>
- <result property="location" column="location"/>
- <result property="rsClass" column="RS_CLASS"/>
- <result property="impdDt" column="IMPD_DT"/>
- <result property="rnfcImpdDt" column="RNFC_IMPD_DT"/>
- <result property="desFlStag" column="DES_FL_STAG"/>
- <result property="flConTopStag" column="FL_CON_TOP_STAG"/>
- <result property="reinStat" column="REIN_STAT"/>
- <result property="damStat" column="DAM_STAT"/>
- <result property="safeStat" column="SAFE_STAT"/>
- <result property="orgId" column="ORG_ID"/>
- <result property="normz" column="NORMZ"/>
- <result property="fsltdz" column="FSLTDZ"/>
- <result property="chkInfoStat" column="CHK_INFO_STAT"/>
- <result property="rectStat" column="RECT_STAT"/>
- <result property="inspType" column="INSP_TYPE"/>
- <result property="isAction" column="IS_ACTION"/>
- <result property="isSaf" column="IS_SAF"/>
- <result property="isSite" column="IS_SITE"/>
- <result property="dutyDep" column="DUTY_DEP"/>
- </resultMap>
- <sql id="table_columns">
- RGSTR_ID,ORG_ID,
- OBJ_ID,
- RSVR_NM,
- AD_CODE,
- RES_CREATE_TIME,
- ENG_SCAL,
- NORMZ,
- FSLTDZ,
- HYST_SITE,
- TOT_CAP,
- DAM_REG_CODE,
- DAM_TYPE,
- HAS_DAM_REG_CODE,
- RES_CREATE_TIME_NOTE,
- ENG_SCAL_NOTE,
- STATE,
- GROUP_LEADER,
- GROUP_LEADER_TEL,
- REC_PERS_ID,
- REC_PERS,
- REC_PERS_TEL,
- UPTM,
- INTM,
- NOTE,
- DATA_STAT,
- RSVR_LONG,
- RSVR_LAT,RES_RUN_STAT,PRES_STAT,VIEW_STAT,BASE_STAT,DAM_MAX_HIGH,RS_CODE,liaison_Man_Tel,liaison_Man,rsvr_adm_name,COMP_DATE_STR,REVER_STAT
- ,location,BENEFIT_STAT,SAFE_STAT,
- RS_CLASS,
- IMPD_DT,
- RNFC_IMPD_DT,
- DES_FL_STAG,
- FL_CON_TOP_STAG,
- REIN_STAT,
- CHK_INFO_STAT,
- RECT_STAT,
- DAM_STAT, INSP_TYPE, IS_ACTION, IS_SAF, IS_SITE, DUTY_DEP
- </sql>
- <sql id="entity_properties">
- #{rgstrId},#{orgId},
- #{objId},
- #{rsvrNm},
- #{adCode},
- #{resCreateTime},
- #{engScal},
- #{normz},
- #{fsltdz},
- #{hystSite},
- #{totCap},
- #{damRegCode},
- #{damType},
- #{hasDamRegCode},
- #{resCreateTimeNote},
- #{engScalNote},
- #{state},
- #{groupLeader},
- #{groupLeaderTel},
- #{recPersId},
- #{recPers},
- #{recPersTel},
- #{uptm},
- #{intm},
- #{note},
- #{dataStat},
- #{rsvrLong},
- #{rsvrLat},#{resRunStat},#{presStat},#{viewStat},#{baseStat},
- case when to_number(#{damMaxHigh}) is null then null else to_number(#{damMaxHigh}) end ,
- #{rsCode},#{liaisonManTel},#{liaisonMan},#{rsvrAdmName},#{compDateStr}
- ,#{reverStat},#{location},#{benefitStat},#{safeStat},
- #{rsClass},
- #{impdDt},
- #{rnfcImpdDt},
- #{desFlStag},
- #{flConTopStag},
- #{reinStat},
- #{chkInfoStat},
- #{rectStat},
- #{damStat},#{inspType},#{isAction},#{isSaf},#{isSite},#{dutyDep}
- </sql>
- <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
- <sql id="page_where">
- <trim prefix="where" prefixOverrides="and | or ">
- <if test="dutyDep != null and dutyDep != ''">and DUTY_DEP = #{dutyDep}</if>
- <if test="isSite != null and isSite != ''">and IS_SITE = #{isSite}</if>
- <if test="isAction != null and isAction != ''">and IS_ACTION = #{isAction}</if>
- <if test="isSaf != null and isSaf != ''">and IS_SAF = #{isSaf}</if>
- <if test="inspType != null and inspType != ''">and INSP_TYPE = #{inspType}</if>
- <if test="objId != null and objId != ''">and OBJ_ID = #{objId}</if>
- <if test="damMaxHigh != null and damMaxHigh != ''">and DAM_MAX_HIGH = #{damMaxHigh}</if>
- <if test="rsvrNm != null and rsvrNm != ''">and RSVR_NM LIKE '%'||#{rsvrNm}||'%'</if>
- <if test="adCode != null and adCode != ''">and AD_CODE = #{adCode}</if>
- <if test="resCreateTime != null">and RES_CREATE_TIME = #{resCreateTime}</if>
- <if test="engScal != null and engScal != ''">and ENG_SCAL = #{engScal}</if>
- <if test="normz != null and normz != ''">and NORMZ = #{normz}</if>
- <if test="fsltdz != null and fsltdz != ''">and FSLTDZ = #{fsltdz}</if>
- <if test="hystSite != null and hystSite != ''">and HYST_SITE = #{hystSite}</if>
- <if test="totCap != null and totCap != ''">and TOT_CAP = #{totCap}</if>
- <if test="damRegCode != null and damRegCode != ''">and DAM_REG_CODE = #{damRegCode}</if>
- <if test="damType != null and damType != ''">and DAM_TYPE = #{damType}</if>
- <if test="hasDamRegCode != null and hasDamRegCode != ''">and HAS_DAM_REG_CODE = #{hasDamRegCode}</if>
- <if test="resCreateTimeNote != null and resCreateTimeNote != ''">and RES_CREATE_TIME_NOTE =
- #{resCreateTimeNote}
- </if>
- <if test="engScalNote != null and engScalNote != ''">and ENG_SCAL_NOTE = #{engScalNote}</if>
- <if test="state != null and state != ''">and STATE = #{state}</if>
- <if test="groupLeader != null and groupLeader != ''">and GROUP_LEADER = #{groupLeader}</if>
- <if test="groupLeaderTel != null and groupLeaderTel != ''">and GROUP_LEADER_TEL = #{groupLeaderTel}</if>
- <if test="recPersId != null and recPersId != ''">and REC_PERS_ID = #{recPersId}</if>
- <if test="recPers != null and recPers != ''">and REC_PERS = #{recPers}</if>
- <if test="recPersTel != null and recPersTel != ''">and REC_PERS_TEL = #{recPersTel}</if>
- <if test="uptm != null">and UPTM = #{uptm}</if>
- <if test="intm != null">and INTM = #{intm}</if>
- <if test="note != null and note != ''">and NOTE = #{note}</if>
- <if test="dataStat != null and dataStat != ''">and DATA_STAT = #{dataStat}</if>
- <if test="baseStat != null and baseStat != ''">and BASE_STAT = #{baseStat}</if>
- <if test="viewStat != null and viewStat != ''">and VIEW_STAT = #{viewStat}</if>
- <if test="presStat != null and presStat != ''">and PRES_STAT = #{presStat}</if>
- <if test="benefitStat != null and benefitStat != ''">and benefit_Stat = #{benefitStat}</if>
- <if test="resRunStat != null and resRunStat != ''">and RES_RUN_STAT = #{resRunStat}</if>
- <if test="rsCode != null and rsCode != ''">and RS_CODE = #{rsCode}</if>
- <if test="rsvrAdmName != null and rsvrAdmName != ''">and rsvr_Adm_Name = #{rsvrAdmName}</if>
- <if test="compDateStr != null and compDateStr != ''">and comp_Date_Str = #{compDateStr}</if>
- <if test="reverStat != null and reverStat != ''">and rever_Stat = #{reverStat}</if>
- <if test="location != null and location != ''">and location = #{location}</if>
- <if test="rgstrId != null and rgstrId != ''">and RGSTR_ID = #{rgstrId}</if>
- <if test="rsClass != null">and RS_CLASS = #{rsClass}</if>
- <if test="impdDt != null">and IMPD_DT = #{impdDt}</if>
- <if test="rnfcImpdDt != null">and RNFC_IMPD_DT = #{rnfcImpdDt}</if>
- <if test="desFlStag != null and desFlStag != ''">and DES_FL_STAG = #{desFlStag}</if>
- <if test="flConTopStag != null and flConTopStag != ''">and FL_CON_TOP_STAG = #{flConTopStag}</if>
- <if test="reinStat != null and reinStat != ''">and REIN_STAT = #{reinStat}</if>
- <if test="damStat != null and damStat != ''">and DAM_STAT = #{damStat}</if>
- <if test="safeStat != null and safeStat != ''">and SAFE_STAT = #{safeStat}</if>
- <if test="rectStat != null and rectStat != ''">and RECT_STAT = #{rectStat}</if>
- <if test="chkInfoStat != null and chkInfoStat != ''">and CHK_INFO_STAT = #{chkInfoStat}</if>
- </trim>
- </sql>
- <select id="get" resultMap="bisInspRsvrRgstrResultMap" parameterType="String">
- select
- <include refid="table_columns"/>
- from bis_insp_rsvr_rgstr where RGSTR_ID = #{id}
- </select>
- <select id="getBy" resultMap="bisInspRsvrRgstrResultMap">
- select
- <include refid="table_columns"/>
- from bis_insp_rsvr_rgstr
- <include refid="page_where"/>
- </select>
- <select id="findAll" resultMap="bisInspRsvrRgstrResultMap">
- select
- <include refid="table_columns"/>
- from bis_insp_rsvr_rgstr
- </select>
- <select id="findList" resultMap="bisInspRsvrRgstrResultMap">
- select r.* from bis_insp_rsvr_rgstr r
- <include refid="page_where"/>
- </select>
- <select id="findPcPage" resultType="cn.com.goldenwater.dcproj.dto.BisInspRsvrRgstrPcDto"
- parameterType="cn.com.goldenwater.dcproj.param.TypeParam">
- select * from
- (
- SELECT
- A.ID,A.OBJ_ID,A.CODE,A.NM,A.PTYPE,A.LGTD,A.LTTD,A.PROVINCIAL,
- B.STATE,B.NORMZ, B.FSLTDZ, B.RES_RUN_STAT,B.VIEW_STAT,B.AD_CODE,B.BASE_STAT,
- B.PRES_STAT,B.REVER_STAT,B.BENEFIT_STAT,B.LOCATION,B.HYST_SITE,
- B.RES_CREATE_TIME,B.HAS_DAM_REG_CODE,B.DAM_TYPE,B.DATA_STAT,
- B.REIN_STAT,B.DAM_STAT,B.SAFE_STAT, B.INSP_TYPE, B.IS_ACTION, B.IS_SAF, B.IS_SITE, B.DUTY_DEP,
- B.DAM_REG_CODE,B.RGSTR_ID,B.GROUP_LEADER,B.GROUP_LEADER_TEL,B.FL_CON_TOP_STAG,
- B.RS_CLASS, B.IMPD_DT, B.RNFC_IMPD_DT, B.DES_FL_STAG, B.CHK_INFO_STAT, B.RECT_STAT,
- B.REC_PERS,B.REC_PERS_ID,B.REC_PERS_TEL,B.NOTE,B.UPTM,B.INTM,B.COMP_DATE_STR,
- case when TO_CHAR(SYSDATE,'yyyy-MM-dd') = TO_CHAR( p.mincolltime,'yyyy-MM-dd') then '1'
- when p.mincolltime is null then '1'
- else '0' end timeout,
- (CASE WHEN B.STATE IS NULL THEN '0' ELSE B.STATE END) AS wtdstState,
- (CASE WHEN B.ENG_SCAL IS NULL THEN TO_CHAR(E.ENG_SCAL) ELSE B.ENG_SCAL END) AS ENG_SCAL,
- (CASE WHEN B.TOT_CAP IS NULL THEN E.TOT_CAP ELSE B.TOT_CAP END) TOT_CAP,
- (CASE WHEN B.RSVR_NM IS NULL THEN TO_CHAR(E.RS_NAME) ELSE B.RSVR_NM END) AS RSVR_NM,
- (CASE WHEN B.RSVR_ADM_NAME IS NULL THEN E.RS_ADM_NAME ELSE B.RSVR_ADM_NAME END) RS_ADM_NAME,
- AD.AD_FULL_NAME,IA.PNM groupName,ria.pnm riverName,
- (select pnm from BIS_INSP_ALL where id = ia.pid)||ia.pnm upGroupName
- FROM BIS_INSP_ALL_OBJ A
- JOIN BIS_INSP_RSVR_RGSTR B ON A.OBJ_ID = B.OBJ_ID
- LEFT JOIN ATT_RS_BASE E ON A.CODE=E.RS_CODE
- LEFT JOIN ATT_AD_X_BASE AD ON B.AD_CODE = AD.AD_CODE
- LEFT JOIN BIS_INSP_ALL IA ON A.ID = IA.ID
- LEFT JOIN BIS_INSP_ALL RIA ON SUBSTR(A.ID,0,6) = ria.id
- left join (select min(coll_time) mincolltime , obj_id from BIS_INSP_PBLM group by obj_id) p on P.OBJ_ID = A.OBJ_ID
- <where>
- <if test="tabType =='2'.toString()">
- AND IA.ENTM < TO_DATE(#{nowTime},'yyyy-MM-dd')+1
- </if>
- <if test="tabType =='1'.toString()">
- AND IA.ENTM >= TO_DATE(#{nowTime},'yyyy-MM-dd')
- </if>
- <if test=" repeatId ==1 ">
- AND B.REPEAT_ID IS NOT NULL
- </if>
- <if test=" repeatId ==2 ">AND B.REPEAT_ID IS NULL</if>
- <choose>
- <when test="province !=null and province !=''">
- AND A.AD_CODE = #{province}
- </when>
- <otherwise>
- AND A.AD_CODE IS NULL
- </otherwise>
- </choose>
- <if test="adName != null and adName != ''">and ad.AD_FULL_NAME LIKE '%${adName}%'</if>
- <if test="engScal != null and engScal != ''">and B.ENG_SCAL = #{engScal}</if>
- <if test="riverId != null and riverId != ''">and ria.id = #{riverId}</if>
- <if test="groupId != null and groupId != ''">and A.id = #{groupId}</if>
- <if test="sttm != null and sttm != '' and entm != null and entm != ''">
- AND B.INTM >= TO_DATE(#{sttm},'YYYY-MM-DD') AND B.INTM < TO_DATE(#{entm},'YYYY-MM-DD')+1
- </if>
- and
- REGEXP_LIKE(
- A.Id,'^('||
- ( case when(SELECT count(id) from BIS_INSP_ALL_RLATION WHERE PERSID =#{presId}
- <include refid="orgIdSql"/>
- and type=#{pType}
- )>0 then
- (SELECT listagg(id, '|' ) as
- id FROM BIS_INSP_ALL_RLATION WHERE PERSID =#{presId} and type=#{pType}
- <include refid="orgIdSql"/> group by PERSID
- )
- else (select 'non' from dual) end)
- ||')')
- ) a where a.PTYPE=#{pType}
- <if test="id !=null and id !=''">
- and id like '${id}%'
- </if>
- <if test="state !=null and state !=''">
- <!-- and wtdstState =#{state} -->
- AND wtdstState in (${state})
- </if>
- <if test="code !=null and code !=''">
- and code like '${code}%'
- </if>
- <if test="rsName !=null and rsName !=''">
- and rsvr_nm like '%${rsName}%'
- </if>
- <if test="name !=null and name !=''">
- and rsvr_nm like '%${name}%'
- </if>
- <if test="rsvrAdmName !=null and rsvrAdmName !=''">
- and rsvr_adm_name like '%${rsvrAdmName}%'
- </if>
- </where>
- <choose>
- <when test="ids !=null and ids !=''">
- order by code asc
- </when>
- <otherwise>
- order by wtdstState,code desc
- </otherwise>
- </choose>
- </select>
- <select id="findPageByType" resultType="cn.com.goldenwater.dcproj.model.BisInspRsvrRgstrDto"
- parameterType="cn.com.goldenwater.dcproj.param.TypeParam">
- select * from
- (SELECT
- A.CODE, A.ID,A.PTYPE,A.OBJ_INTM,A.OBJ_ID,A.IS_SET_OBJ,
- (case when b.rsvr_nm is null then A.nm else b.rsvr_nm end) nm,
- CASE WHEN B.STATE IS NULL THEN '0' ELSE B.STATE END AS wtdstState,
- (case when b.rsvr_adm_name is null then e.rs_adm_name else b.rsvr_adm_name end) as rs_adm_name,
- (case when b.eng_scal is null then to_char(e.eng_scal) else b.eng_scal end) eng_scal,
- (case when b.hyst_site is null then to_char(e.location) else b.hyst_site end) as hyst_site,
- (case when b.location is null then to_char(e.location) else b.location end) AS location,
- B.RSVR_LONG as LGTD,B.RSVR_LAT as LTTD,
- B.NORMZ, B.FSLTDZ, b.state, b.res_run_stat,b.view_stat,b.base_stat,b.pres_stat,b.rever_Stat,
- b.BENEFIT_STAT,b.REIN_STAT,b.DAM_STAT,b.SAFE_STAT,b.rgstr_id rgstrId,b.rsvr_nm rsvrNm,
- b.ad_code adCode, b.res_create_time resCreateTime,b.tot_cap totCap,
- b.dam_reg_code damRegCode, b.dam_type damType,b.has_dam_reg_code hasDamRegCode,
- b.res_create_time_note resCreateTimeNote, b.eng_scal_note engScalNote,b.group_leader groupLeader,
- b.group_leader_tel groupLeaderTel,b.rec_pers_id recPersId, b.rec_pers recPers,
- b.comp_Date_Str compDateStr,b.rec_pers_tel recPersTel,b.liaison_man liaisonMan,
- b.liaison_man_tel liaisonManTel, b.uptm ,b.intm,b.note,
- b.RS_CLASS, b.IMPD_DT, b.RNFC_IMPD_DT, b.DES_FL_STAG, b.CHK_INFO_STAT, b.RECT_STAT,
- b.FL_CON_TOP_STAG, B.INSP_TYPE, B.IS_ACTION, B.IS_SAF, B.IS_SITE, B.DUTY_DEP,
- F.VIEW_ID viewID
- FROM BIS_INSP_ALL_OBJ A
- JOIN BIS_INSP_RSVR_RGSTR B ON A.OBJ_ID = B.OBJ_ID
- LEFT JOIN ATT_RS_BASE E ON A.CODE=E.RS_CODE
- LEFT JOIN BIS_INSP_BASE_VIEW F ON B.RGSTR_ID=F.RGSTR_ID
- where
- REGEXP_LIKE(
- A.Id,'^('||
- ( case when(SELECT count(id) from BIS_INSP_ALL_RLATION WHERE PERSID =#{presId} and id like '00%'
- <include refid="orgIdSql"/>
- )>0 then
- (SELECT string_agg(id, '|' ) as
- id FROM BIS_INSP_ALL_RLATION WHERE PERSID =#{presId}
- <include refid="orgIdSql"/>
- and id like '00%' group by PERSID
- )
- else (select 'non' from dual) end)
- ||')')
- ) a where a.PTYPE=#{pType}
- <if test="plnaId !=null and plnaId !=''">
- and a.id like '${plnaId}%'
- </if>
- <if test="state !=null and state !=''">
- and wtdstState =#{state}
- </if>
- <if test="engScal !=null and engScal !=''">
- and eng_scal in (${engScal})
- </if>
- <if test="code !=null and code !=''">
- and adCode like '${code}%'
- </if>
- <if test="rsName !=null and rsName !=''">
- and rsvrNm like '%${rsName}%'
- </if>
- <if test="inspType !=null and inspType !=''">
- and INSP_TYPE =#{inspType}
- </if>
- order by code asc
- <if test="orderBy != null and orderBy != ''">
- ,${orderBy}
- </if>
- </select>
- <!--通过此用户ID下的所有行政编码-->
- <select id="selectAdCodeByUserId" resultType="string">
- select string_agg(code, ',' ORDER BY code as code from (
- select distinct substr(code,0,2) code from BIS_INSP_ALL_OBJ A
- where
- REGEXP_LIKE(
- A.Id,'^('||
- ( case when(SELECT count(id) from BIS_INSP_ALL_RLATION WHERE PERSID =#{presId}
- <include refid="orgIdSql"/>
- )>0 then
- (SELECT string_agg(id, '|' ) as
- id FROM BIS_INSP_ALL_RLATION WHERE PERSID =#{presId}
- <include refid="orgIdSql"/> group by PERSID
- )
- else (select 'non' from dual) end)
- ||')')
- and a.PTYPE = #{ptype}
- ) group by code
- </select>
- <sql id="orgIdSql">
- <choose>
- <when test="orgId !=null and orgId !=''">
- and ORG_ID=#{orgId}
- </when>
- <otherwise>
- and ORG_ID is null
- </otherwise>
- </choose>
- </sql>
- <select id="selectCount" resultType="int">
- select count(RGSTR_ID) from bis_insp_rsvr_rgstr
- <include refid="page_where"/>
- </select>
- <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.BisInspRsvrRgstr">
- insert into bis_insp_rsvr_rgstr(
- <include refid="table_columns"/>
- )
- values (
- <include refid="entity_properties"/>
- )
- </insert>
- <delete id="delete" parameterType="java.lang.String">
- delete from bis_insp_rsvr_rgstr where RGSTR_ID = #{id}
- </delete>
- <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspRsvrRgstr">
- delete from bis_insp_rsvr_rgstr
- <include refid="page_where"/>
- </delete>
- <delete id="deleteInFlag" parameterType="java.lang.String">
- delete from bis_insp_rsvr_rgstr where RGSTR_ID = #{id}
- </delete>
- <update id="update" parameterType="cn.com.goldenwater.dcproj.model.BisInspRsvrRgstr">
- update bis_insp_rsvr_rgstr
- <trim prefix="set" suffixOverrides=",">
- <if test="dutyDep != null and dutyDep != ''">DUTY_DEP = #{dutyDep},</if>
- <if test="isSite != null and isSite != ''">IS_SITE = #{isSite},</if>
- <if test="isAction != null and isAction != ''">IS_ACTION = #{isAction},</if>
- <if test="isSaf != null and isSaf != ''">IS_SAF = #{isSaf},</if>
- <if test="inspType != null and inspType != ''">INSP_TYPE = #{inspType},</if>
- <if test="objId != null and objId != ''">OBJ_ID = #{objId},</if>
- <if test="location != null and location != ''">location = #{location},</if>
- <if test="orgId != null and orgId != ''">ORG_ID = #{orgId},</if>
- <if test="rsvrNm != null and rsvrNm != ''">RSVR_NM = #{rsvrNm},</if>
- <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
- <if test="resCreateTime != null">RES_CREATE_TIME = #{resCreateTime},</if>
- <if test="engScal != null and engScal != ''">ENG_SCAL = #{engScal},</if>
- <if test='normz != null and normz != ""'>NORMZ = #{normz},</if>
- FSLTDZ = #{fsltdz},
- <if test='hystSite != null and hystSite != ""'>HYST_SITE = #{hystSite},</if>
- TOT_CAP = #{totCap},
- <if test="damRegCode != null and damRegCode != ''">DAM_REG_CODE = #{damRegCode},</if>
- <if test="damType != null and damType != ''">DAM_TYPE = #{damType},</if>
- <if test="hasDamRegCode != null and hasDamRegCode != ''">HAS_DAM_REG_CODE = #{hasDamRegCode},</if>
- <if test="resCreateTimeNote != null and resCreateTimeNote != ''">RES_CREATE_TIME_NOTE =
- #{resCreateTimeNote},
- </if>
- <if test="engScalNote != null and engScalNote != ''">ENG_SCAL_NOTE = #{engScalNote},</if>
- <if test="state != null and state != ''">STATE = #{state},</if>
- <if test="groupLeader != null and groupLeader != ''">GROUP_LEADER = #{groupLeader},</if>
- <if test="groupLeaderTel != null and groupLeaderTel != ''">GROUP_LEADER_TEL = #{groupLeaderTel},</if>
- <if test="recPersId != null and recPersId != ''">REC_PERS_ID = #{recPersId},</if>
- <if test="recPers != null and recPers != ''">REC_PERS = #{recPers},</if>
- <if test="recPersTel != null and recPersTel != ''">REC_PERS_TEL = #{recPersTel},</if>
- <if test="uptm != null">UPTM = #{uptm},</if>
- <if test="damMaxHigh != null and damMaxHigh != ''">DAM_MAX_HIGH = to_number(#{damMaxHigh}),</if>
- <if test="intm != null">INTM = #{intm},</if>
- <if test="note != null and note != ''">NOTE = #{note},</if>
- <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
- <if test="reverStat != null and reverStat != ''">rever_Stat = #{reverStat},</if>
- <if test="rsvrLat != null and rsvrLat != ''">RSVR_LAT = #{rsvrLat},</if>
- <if test="rsvrLong != null and rsvrLong != ''">RSVR_LONG = #{rsvrLong},</if>
- <if test="baseStat != null and baseStat != ''">BASE_STAT = #{baseStat},</if>
- <if test="viewStat != null and viewStat != ''">VIEW_STAT = #{viewStat},</if>
- <if test="presStat != null and presStat != ''">PRES_STAT = #{presStat},</if>
- <if test="benefitStat != null and benefitStat != ''">benefit_Stat = #{benefitStat},</if>
- <if test="resRunStat != null and resRunStat != ''">RES_RUN_STAT = #{resRunStat},</if>
- <if test="rsCode != null and rsCode != ''">RS_CODE = #{rsCode},</if>
- <if test="liaisonManTel != null and liaisonManTel != ''">liaison_Man_Tel = #{liaisonManTel},</if>
- <if test="liaisonMan != null and liaisonMan != ''">liaison_Man = #{liaisonMan},</if>
- <if test="rsvrAdmName != null and rsvrAdmName != ''">rsvr_Adm_Name = #{rsvrAdmName},</if>
- <if test="compDateStr != null">COMP_DATE_STR = #{compDateStr},</if>
- <if test="rsClass != null">RS_CLASS = #{rsClass},</if>
- <if test="impdDt != null">IMPD_DT = #{impdDt},</if>
- <if test="rnfcImpdDt != null">RNFC_IMPD_DT = #{rnfcImpdDt},</if>
- <if test="desFlStag != null and desFlStag != ''">DES_FL_STAG = #{desFlStag},</if>
- <if test="flConTopStag != null and flConTopStag != ''">FL_CON_TOP_STAG = #{flConTopStag},</if>
- <if test="reinStat != null and reinStat != ''">REIN_STAT = #{reinStat},</if>
- <if test="damStat != null and damStat != ''">DAM_STAT = #{damStat},</if>
- <if test="safeStat != null and safeStat != ''">SAFE_STAT = #{safeStat},</if>
- <if test="rectStat != null and rectStat != ''">RECT_STAT = #{rectStat},</if>
- <if test="chkInfoStat != null and chkInfoStat != ''">CHK_INFO_STAT = #{chkInfoStat},</if>
- </trim>
- <where>RGSTR_ID = #{rgstrId}</where>
- </update>
- <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspRsvrRgstr">
- update bis_insp_rsvr_rgstr
- <trim prefix="set" suffixOverrides=",">
- <if test="dutyDep != null and dutyDep != ''">DUTY_DEP = #{dutyDep},</if>
- <if test="isSite != null and isSite != ''">IS_SITE = #{isSite},</if>
- <if test="isAction != null and isAction != ''">IS_ACTION = #{isAction},</if>
- <if test="isSaf != null and isSaf != ''">IS_SAF = #{isSaf},</if>
- <if test="inspType != null and inspType != ''">INSP_TYPE = #{inspType},</if>
- <if test="liaisonManTel != null and liaisonManTel != ''">liaison_Man_Tel = #{liaisonManTel},</if>
- <if test="liaisonMan != null and liaisonMan != ''">liaison_Man = #{liaisonMan},</if>
- <if test="objId != null and objId != ''">OBJ_ID = #{objId},</if>
- <if test="orgId != null and orgId != ''">ORG_ID = #{orgId},</if>
- <if test="rsvrNm != null and rsvrNm != ''">RSVR_NM = #{rsvrNm},</if>
- <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
- <if test="resCreateTime != null">RES_CREATE_TIME = #{resCreateTime},</if>
- <if test="engScal != null and engScal != ''">ENG_SCAL = #{engScal},</if>
- <if test="normz != null and normz != ''">NORMZ = #{normz},</if>
- FSLTDZ = #{fsltdz},
- <if test="hystSite != null and hystSite != ''">HYST_SITE = #{hystSite},</if>
- TOT_CAP = #{totCap},
- <if test="damRegCode != null and damRegCode != ''">DAM_REG_CODE = #{damRegCode},</if>
- <if test="damType != null and damType != ''">DAM_TYPE = #{damType},</if>
- <if test="hasDamRegCode != null and hasDamRegCode != ''">HAS_DAM_REG_CODE = #{hasDamRegCode},</if>
- <if test="resCreateTimeNote != null and resCreateTimeNote != ''">RES_CREATE_TIME_NOTE =
- #{resCreateTimeNote},
- </if>
- <if test="engScalNote != null and engScalNote != ''">ENG_SCAL_NOTE = #{engScalNote},</if>
- <if test="state != null and state != ''">STATE = #{state},</if>
- <if test="groupLeader != null and groupLeader != ''">GROUP_LEADER = #{groupLeader},</if>
- <if test="groupLeaderTel != null and groupLeaderTel != ''">GROUP_LEADER_TEL = #{groupLeaderTel},</if>
- <if test="recPersId != null and recPersId != ''">REC_PERS_ID = #{recPersId},</if>
- <if test="recPers != null and recPers != ''">REC_PERS = #{recPers},</if>
- <if test="reverStat != null and reverStat != ''">rever_Stat = #{reverStat},</if>
- <if test="recPersTel != null and recPersTel != ''">REC_PERS_TEL = #{recPersTel},</if>
- <if test="uptm != null">UPTM = #{uptm},</if>
- <if test="damMaxHigh != null and damMaxHigh != ''">DAM_MAX_HIGH = #{damMaxHigh},</if>
- <if test="intm != null">INTM = #{intm},</if>
- <if test="note != null and note != ''">NOTE = #{note},</if>
- <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
- <if test="rsvrLat != null and rsvrLat != ''">RSVR_LAT = #{rsvrLat},</if>
- <if test="rsvrLong != null and rsvrLong != ''">RSVR_LONG = #{rsvrLong},</if>
- <if test="baseStat != null and baseStat != ''">BASE_STAT = #{baseStat},</if>
- <if test="viewStat != null and viewStat != ''">VIEW_STAT = #{viewStat},</if>
- <if test="presStat != null and presStat != ''">PRES_STAT = #{presStat},</if>
- <if test="resRunStat != null and resRunStat != ''">RES_RUN_STAT = #{resRunStat},</if>
- <if test="rsCode != null and rsCode != ''">RS_CODE = #{rsCode},</if>
- <if test="rsvrAdmName != null and rsvrAdmName != ''">rsvr_Adm_Name = #{rsvrAdmName},</if>
- <if test="compDateStr != null">COMP_DATE_STR = #{compDateStr},</if>
- <if test="rsClass != null">RS_CLASS = #{rsClass},</if>
- <if test="impdDt != null">IMPD_DT = #{impdDt},</if>
- <if test="rnfcImpdDt != null">RNFC_IMPD_DT = #{rnfcImpdDt},</if>
- <if test="desFlStag != null and desFlStag != ''">DES_FL_STAG = #{desFlStag},</if>
- <if test="flConTopStag != null and flConTopStag != ''">FL_CON_TOP_STAG = #{flConTopStag},</if>
- <if test="reinStat != null and reinStat != ''">REIN_STAT = #{reinStat},</if>
- <if test="damStat != null and damStat != ''">DAM_STAT = #{damStat},</if>
- <if test="safeStat != null and safeStat != ''">SAFE_STAT = #{safeStat},</if>
- <if test="rectStat != null and rectStat != ''">RECT_STAT = #{rectStat},</if>
- <if test="chkInfoStat != null and chkInfoStat != ''">CHK_INFO_STAT = #{chkInfoStat},</if>
- </trim>
- <include refid="page_where"/>
- </update>
- <select id="getRsvrByIdNm" resultType="cn.com.goldenwater.dcproj.model.BisInspBase">
- select * from bis_insp_all_obj a join BIS_INSP_RSVR_RGSTR b on a.obj_id=b.obj_id where id=#{groupId} and a.nm like '%${nm}%'
- </select>
- <select id="getListByTm" resultType="cn.com.goldenwater.dcproj.dto.BisInspTaskTotal">
- select count(*) objSize from bis_insp_rsvr_rgstr t where ad_code like '${adCode}%' and intm >=#{stTm} and intm<#{enTm}
- </select>
- <select id="getByPblmId" resultMap="bisInspRsvrRgstrResultMap">
- select RGSTR_ID, DAM_REG_CODE,OBJ_ID,RS_CODE from bis_insp_rsvr_rgstr where RGSTR_ID in (select REGID from BIS_INSP_PBLM where PBLM_ID = #{pblmId} )
- </select>
- <update id="updateDamRegCodeByRsCode" parameterType="cn.com.goldenwater.dcproj.model.BisInspRsvrRgstr">
- update bis_insp_rsvr_rgstr
- set DAM_REG_CODE = #{damRegCode} ,UPTM = #{uptm}
- where RS_CODE = #{rsCode}
- </update>
- </mapper>
|