BisInspRsvrynRgstrDao.xml 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="cn.com.goldenwater.dcproj.dao.BisInspRsvrynRgstrDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.BisInspRsvrynRgstr" id="bisInspRsvrynRgstrResultMap">
  5. <result property="rgstrId" column="RGSTR_ID"/>
  6. <result property="objId" column="OBJ_ID"/>
  7. <result property="rsvrNm" column="RSVR_NM"/>
  8. <result property="adCode" column="AD_CODE"/>
  9. <result property="resCreateTime" column="RES_CREATE_TIME"/>
  10. <result property="engScal" column="ENG_SCAL"/>
  11. <result property="hystSite" column="HYST_SITE"/>
  12. <result property="totCap" column="TOT_CAP"/>
  13. <result property="damRegCode" column="DAM_REG_CODE"/>
  14. <result property="damType" column="DAM_TYPE"/>
  15. <result property="hasDamRegCode" column="HAS_DAM_REG_CODE"/>
  16. <result property="resCreateTimeNote" column="RES_CREATE_TIME_NOTE"/>
  17. <result property="engScalNote" column="ENG_SCAL_NOTE"/>
  18. <result property="state" column="STATE"/>
  19. <result property="groupLeader" column="GROUP_LEADER"/>
  20. <result property="groupLeaderTel" column="GROUP_LEADER_TEL"/>
  21. <result property="recPersId" column="REC_PERS_ID"/>
  22. <result property="recPers" column="REC_PERS"/>
  23. <result property="recPersTel" column="REC_PERS_TEL"/>
  24. <result property="uptm" column="UPTM"/>
  25. <result property="intm" column="INTM"/>
  26. <result property="note" column="NOTE"/>
  27. <result property="dataStat" column="DATA_STAT"/>
  28. <result property="dataStat" column="DATA_STAT"/>
  29. <result property="rsvrLong" column="RSVR_LONG"/>
  30. <result property="rsvrLat" column="RSVR_LAT"/>
  31. <result property="baseStat" column="BASE_STAT"/>
  32. <result property="viewStat" column="VIEW_STAT"/>
  33. <result property="presStat" column="PRES_STAT"/>
  34. <result property="resRunStat" column="RES_RUN_STAT"/>
  35. <result property="damMaxHigh" column="DAM_MAX_HIGH"/>
  36. <result property="rsCode" column="RS_CODE"/>
  37. <result property="liaisonManTel" column="liaison_Man_Tel"/>
  38. <result property="liaisonMan" column="liaison_Man"/>
  39. <result property="rsvrAdmName" column="rsvr_adm_name"/>
  40. <result property="compDateStr" column="COMP_DATE_STR"/>
  41. <result property="reverStat" column="REVER_STAT"/>
  42. <result property="location" column="location"/>
  43. <result property="rsClass" column="RS_CLASS"/>
  44. <result property="impdDt" column="IMPD_DT"/>
  45. <result property="rnfcImpdDt" column="RNFC_IMPD_DT"/>
  46. <result property="desFlStag" column="DES_FL_STAG"/>
  47. <result property="flConTopStag" column="FL_CON_TOP_STAG"/>
  48. <result property="reinStat" column="REIN_STAT"/>
  49. <result property="damStat" column="DAM_STAT"/>
  50. <result property="safeStat" column="SAFE_STAT"/>
  51. <result property="orgId" column="ORG_ID"/>
  52. <result property="normz" column="NORMZ"/>
  53. <result property="fsltdz" column="FSLTDZ"/>
  54. <result property="chkInfoStat" column="CHK_INFO_STAT"/>
  55. <result property="rectStat" column="RECT_STAT"/>
  56. <result property="inspType" column="INSP_TYPE"/>
  57. <result property="isAction" column="IS_ACTION"/>
  58. <result property="isSaf" column="IS_SAF"/>
  59. <result property="isSite" column="IS_SITE"/>
  60. <result property="dutyDep" column="DUTY_DEP"/>
  61. </resultMap>
  62. <sql id="table_columns">
  63. RGSTR_ID,ORG_ID,
  64. OBJ_ID,
  65. RSVR_NM,
  66. AD_CODE,
  67. RES_CREATE_TIME,
  68. ENG_SCAL,
  69. NORMZ,
  70. FSLTDZ,
  71. HYST_SITE,
  72. TOT_CAP,
  73. DAM_REG_CODE,
  74. DAM_TYPE,
  75. HAS_DAM_REG_CODE,
  76. RES_CREATE_TIME_NOTE,
  77. ENG_SCAL_NOTE,
  78. STATE,
  79. GROUP_LEADER,
  80. GROUP_LEADER_TEL,
  81. REC_PERS_ID,
  82. REC_PERS,
  83. REC_PERS_TEL,
  84. UPTM,
  85. INTM,
  86. NOTE,
  87. DATA_STAT,
  88. RSVR_LONG,
  89. 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
  90. ,location,SAFE_STAT,
  91. RS_CLASS,
  92. IMPD_DT,
  93. RNFC_IMPD_DT,
  94. DES_FL_STAG,
  95. FL_CON_TOP_STAG,
  96. REIN_STAT,
  97. CHK_INFO_STAT,
  98. RECT_STAT,
  99. DAM_STAT, INSP_TYPE, IS_ACTION, IS_SAF, IS_SITE, DUTY_DEP
  100. </sql>
  101. <sql id="entity_properties">
  102. #{rgstrId},#{orgId},
  103. #{objId},
  104. #{rsvrNm},
  105. #{adCode},
  106. #{resCreateTime},
  107. #{engScal},
  108. #{normz},
  109. #{fsltdz},
  110. #{hystSite},
  111. #{totCap},
  112. #{damRegCode},
  113. #{damType},
  114. #{hasDamRegCode},
  115. #{resCreateTimeNote},
  116. #{engScalNote},
  117. #{state},
  118. #{groupLeader},
  119. #{groupLeaderTel},
  120. #{recPersId},
  121. #{recPers},
  122. #{recPersTel},
  123. #{uptm},
  124. #{intm},
  125. #{note},
  126. #{dataStat},
  127. #{rsvrLong},
  128. #{rsvrLat},#{resRunStat},#{presStat},#{viewStat},#{baseStat},#{damMaxHigh},#{rsCode},#{liaisonManTel},#{liaisonMan},#{rsvrAdmName},#{compDateStr}
  129. ,#{reverStat},#{location},#{safeStat},
  130. #{rsClass},
  131. #{impdDt},
  132. #{rnfcImpdDt},
  133. #{desFlStag},
  134. #{flConTopStag},
  135. #{reinStat},
  136. #{chkInfoStat},
  137. #{rectStat},
  138. #{damStat},#{inspType},#{isAction},#{isSaf},#{isSite},#{dutyDep}
  139. </sql>
  140. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  141. <sql id="page_where">
  142. <trim prefix="where" prefixOverrides="and | or ">
  143. <if test="dutyDep != null and dutyDep != ''">and DUTY_DEP = #{dutyDep}</if>
  144. <if test="isSite != null and isSite != ''">and IS_SITE = #{isSite}</if>
  145. <if test="isAction != null and isAction != ''">and IS_ACTION = #{isAction}</if>
  146. <if test="isSaf != null and isSaf != ''">and IS_SAF = #{isSaf}</if>
  147. <if test="inspType != null and inspType != ''">and INSP_TYPE = #{inspType}</if>
  148. <if test="objId != null and objId != ''">and OBJ_ID = #{objId}</if>
  149. <if test="damMaxHigh != null and damMaxHigh != ''">and DAM_MAX_HIGH = #{damMaxHigh}</if>
  150. <if test="rsvrNm != null and rsvrNm != ''">and RSVR_NM LIKE '%'||#{rsvrNm}||'%'</if>
  151. <if test="adCode != null and adCode != ''">and AD_CODE = #{adCode}</if>
  152. <if test="resCreateTime != null">and RES_CREATE_TIME = #{resCreateTime}</if>
  153. <if test="engScal != null and engScal != ''">and ENG_SCAL = #{engScal}</if>
  154. <if test="normz != null and normz != ''">and NORMZ = #{normz}</if>
  155. <if test="fsltdz != null and fsltdz != ''">and FSLTDZ = #{fsltdz}</if>
  156. <if test="hystSite != null and hystSite != ''">and HYST_SITE = #{hystSite}</if>
  157. <if test="totCap != null and totCap != ''">and TOT_CAP = #{totCap}</if>
  158. <if test="damRegCode != null and damRegCode != ''">and DAM_REG_CODE = #{damRegCode}</if>
  159. <if test="damType != null and damType != ''">and DAM_TYPE = #{damType}</if>
  160. <if test="hasDamRegCode != null and hasDamRegCode != ''">and HAS_DAM_REG_CODE = #{hasDamRegCode}</if>
  161. <if test="resCreateTimeNote != null and resCreateTimeNote != ''">and RES_CREATE_TIME_NOTE =
  162. #{resCreateTimeNote}
  163. </if>
  164. <if test="engScalNote != null and engScalNote != ''">and ENG_SCAL_NOTE = #{engScalNote}</if>
  165. <if test="state != null and state != ''">and STATE = #{state}</if>
  166. <if test="groupLeader != null and groupLeader != ''">and GROUP_LEADER = #{groupLeader}</if>
  167. <if test="groupLeaderTel != null and groupLeaderTel != ''">and GROUP_LEADER_TEL = #{groupLeaderTel}</if>
  168. <if test="recPersId != null and recPersId != ''">and REC_PERS_ID = #{recPersId}</if>
  169. <if test="recPers != null and recPers != ''">and REC_PERS = #{recPers}</if>
  170. <if test="recPersTel != null and recPersTel != ''">and REC_PERS_TEL = #{recPersTel}</if>
  171. <if test="uptm != null">and UPTM = #{uptm}</if>
  172. <if test="intm != null">and INTM = #{intm}</if>
  173. <if test="note != null and note != ''">and NOTE = #{note}</if>
  174. <if test="dataStat != null and dataStat != ''">and DATA_STAT = #{dataStat}</if>
  175. <if test="baseStat != null and baseStat != ''">and BASE_STAT = #{baseStat}</if>
  176. <if test="viewStat != null and viewStat != ''">and VIEW_STAT = #{viewStat}</if>
  177. <if test="presStat != null and presStat != ''">and PRES_STAT = #{presStat}</if>
  178. <if test="resRunStat != null and resRunStat != ''">and RES_RUN_STAT = #{resRunStat}</if>
  179. <if test="rsCode != null and rsCode != ''">and RS_CODE = #{rsCode}</if>
  180. <if test="rsvrAdmName != null and rsvrAdmName != ''">and rsvr_Adm_Name = #{rsvrAdmName}</if>
  181. <if test="compDateStr != null and compDateStr != ''">and comp_Date_Str = #{compDateStr}</if>
  182. <if test="reverStat != null and reverStat != ''">and rever_Stat = #{reverStat}</if>
  183. <if test="location != null and location != ''">and location = #{location}</if>
  184. <if test="rgstrId != null and rgstrId != ''">and RGSTR_ID = #{rgstrId}</if>
  185. <if test="rsClass != null">and RS_CLASS = #{rsClass}</if>
  186. <if test="impdDt != null">and IMPD_DT = #{impdDt}</if>
  187. <if test="rnfcImpdDt != null">and RNFC_IMPD_DT = #{rnfcImpdDt}</if>
  188. <if test="desFlStag != null and desFlStag != ''">and DES_FL_STAG = #{desFlStag}</if>
  189. <if test="flConTopStag != null and flConTopStag != ''">and FL_CON_TOP_STAG = #{flConTopStag}</if>
  190. <if test="reinStat != null and reinStat != ''">and REIN_STAT = #{reinStat}</if>
  191. <if test="damStat != null and damStat != ''">and DAM_STAT = #{damStat}</if>
  192. <if test="safeStat != null and safeStat != ''">and SAFE_STAT = #{safeStat}</if>
  193. <if test="rectStat != null and rectStat != ''">and RECT_STAT = #{rectStat}</if>
  194. <if test="chkInfoStat != null and chkInfoStat != ''">and CHK_INFO_STAT = #{chkInfoStat}</if>
  195. </trim>
  196. </sql>
  197. <select id="get" resultMap="bisInspRsvrynRgstrResultMap" parameterType="String">
  198. select
  199. <include refid="table_columns"/>
  200. from BIS_INSP_RSVRYN_rgstr where RGSTR_ID = #{id}
  201. </select>
  202. <select id="getBy" resultMap="bisInspRsvrynRgstrResultMap">
  203. select
  204. <include refid="table_columns"/>
  205. from BIS_INSP_RSVRYN_rgstr
  206. <include refid="page_where"/>
  207. </select>
  208. <select id="findAll" resultMap="bisInspRsvrynRgstrResultMap">
  209. select
  210. <include refid="table_columns"/>
  211. from BIS_INSP_RSVRYN_rgstr
  212. </select>
  213. <select id="findList" resultMap="bisInspRsvrynRgstrResultMap">
  214. select r.* from BIS_INSP_RSVRYN_rgstr r
  215. <include refid="page_where"/>
  216. </select>
  217. <select id="findPcPage" resultType="cn.com.goldenwater.dcproj.dto.BisInspRsvrynRgstrPcDto"
  218. parameterType="cn.com.goldenwater.dcproj.param.TypeParam">
  219. select * from
  220. (
  221. SELECT
  222. A.ID,A.OBJ_ID,A.CODE,A.NM,A.PTYPE,A.LGTD,A.LTTD,
  223. B.STATE,B.NORMZ, B.FSLTDZ, B.RES_RUN_STAT,B.VIEW_STAT,B.AD_CODE,B.BASE_STAT,
  224. B.PRES_STAT,B.REVER_STAT,B.LOCATION,B.HYST_SITE,
  225. B.RES_CREATE_TIME,B.HAS_DAM_REG_CODE,B.DAM_TYPE,B.DATA_STAT,
  226. B.REIN_STAT,B.DAM_STAT,B.SAFE_STAT, B.INSP_TYPE, B.IS_ACTION, B.IS_SAF, B.IS_SITE, B.DUTY_DEP,
  227. B.DAM_REG_CODE,B.RGSTR_ID,B.GROUP_LEADER,B.GROUP_LEADER_TEL,B.FL_CON_TOP_STAG,
  228. B.RS_CLASS, B.IMPD_DT, B.RNFC_IMPD_DT, B.DES_FL_STAG, B.CHK_INFO_STAT, B.RECT_STAT,
  229. B.REC_PERS,B.REC_PERS_ID,B.REC_PERS_TEL,B.NOTE,B.UPTM,B.INTM,B.COMP_DATE_STR,
  230. (CASE WHEN B.STATE IS NULL THEN '0' ELSE B.STATE END) AS wtdstState,
  231. (CASE WHEN B.ENG_SCAL IS NULL THEN TO_CHAR(E.ENG_SCAL) ELSE B.ENG_SCAL END) AS ENG_SCAL,
  232. (CASE WHEN B.TOT_CAP IS NULL THEN E.TOT_CAP ELSE B.TOT_CAP END) TOT_CAP,
  233. (CASE WHEN B.RSVR_NM IS NULL THEN TO_CHAR(E.RS_NAME) ELSE B.RSVR_NM END) AS RSVR_NM,
  234. (CASE WHEN B.RSVR_ADM_NAME IS NULL THEN E.RS_ADM_NAME ELSE B.RSVR_ADM_NAME END) RS_ADM_NAME,
  235. AD.AD_FULL_NAME,IA.PNM groupName,ria.pnm riverName,
  236. (select pnm from BIS_INSP_ALL where id = ia.pid)||ia.pnm upGroupName
  237. FROM BIS_INSP_ALL_OBJ A
  238. JOIN BIS_INSP_RSVRYN_RGSTR B ON A.OBJ_ID = B.OBJ_ID
  239. LEFT JOIN ATT_RS_BASE E ON A.CODE=E.RS_CODE
  240. LEFT JOIN ATT_AD_X_BASE AD ON B.AD_CODE = AD.AD_CODE
  241. LEFT JOIN BIS_INSP_ALL IA ON A.ID = IA.ID
  242. LEFT JOIN BIS_INSP_ALL RIA ON SUBSTR(A.ID,0,6) = ria.id
  243. <where>
  244. <if test="tabType =='2'.toString()">
  245. AND IA.ENTM &lt; TO_DATE(#{nowTime},'yyyy-MM-dd')+1
  246. </if>
  247. <if test="tabType =='1'.toString()">
  248. AND IA.ENTM &gt;= TO_DATE(#{nowTime},'yyyy-MM-dd')
  249. </if>
  250. <if test=" repeatId ==1 ">
  251. AND B.REPEAT_ID IS NOT NULL
  252. </if>
  253. <if test=" repeatId ==2 ">AND B.REPEAT_ID IS NULL</if>
  254. <choose>
  255. <when test="province !=null and province !=''">
  256. AND A.AD_CODE = #{province}
  257. </when>
  258. <otherwise>
  259. AND A.AD_CODE IS NULL
  260. </otherwise>
  261. </choose>
  262. <if test="adName != null and adName != ''">and ad.AD_FULL_NAME LIKE '%${adName}%'</if>
  263. <if test="engScal != null and engScal != ''">and B.ENG_SCAL = #{engScal}</if>
  264. <if test="riverId != null and riverId != ''">and ria.id = #{riverId}</if>
  265. <if test="groupId != null and groupId != ''">and A.id = #{groupId}</if>
  266. <if test="sttm != null and sttm != '' and entm != null and entm != ''">
  267. AND B.INTM &gt;= TO_DATE(#{sttm},'YYYY-MM-DD') AND B.INTM &lt; TO_DATE(#{entm},'YYYY-MM-DD')+1
  268. </if>
  269. and
  270. REGEXP_LIKE(
  271. A.Id,'^('||
  272. ( case when(SELECT count(id) from BIS_INSP_ALL_RLATION WHERE PERSID =#{presId}
  273. <include refid="orgIdSql"/>
  274. and type=#{pType}
  275. )>0 then
  276. (SELECT LISTAGG(id, '|') WITHIN GROUP(ORDER BY PERSID) as
  277. id FROM BIS_INSP_ALL_RLATION WHERE PERSID =#{presId} and type=#{pType}
  278. <include refid="orgIdSql"/>
  279. )
  280. else (select 'non' from dual) end)
  281. ||')')
  282. ) a where a.PTYPE=#{pType}
  283. <if test="id !=null and id !=''">
  284. and id like '${id}%'
  285. </if>
  286. <if test="state !=null and state !=''">
  287. <!-- and wtdstState =#{state} -->
  288. AND wtdstState in (${state})
  289. </if>
  290. <if test="code !=null and code !=''">
  291. and code like '${code}%'
  292. </if>
  293. <if test="rsName !=null and rsName !=''">
  294. and rsvr_nm like '%${rsName}%'
  295. </if>
  296. <if test="name !=null and name !=''">
  297. and rsvr_nm like '%${name}%'
  298. </if>
  299. <if test="rsvrAdmName !=null and rsvrAdmName !=''">
  300. and rsvr_adm_name like '%${rsvrAdmName}%'
  301. </if>
  302. </where>
  303. <choose>
  304. <when test="ids !=null and ids !=''">
  305. order by code asc
  306. </when>
  307. <otherwise>
  308. order by wtdstState,code desc
  309. </otherwise>
  310. </choose>
  311. </select>
  312. <select id="findPageByType" resultType="cn.com.goldenwater.dcproj.dto.BisInspRsvrynRgstrDto"
  313. parameterType="cn.com.goldenwater.dcproj.param.TypeParam">
  314. select * from
  315. (SELECT
  316. A.CODE, A.ID,A.PTYPE,A.OBJ_INTM,A.OBJ_ID,A.IS_SET_OBJ,
  317. (case when b.rsvr_nm is null then A.nm else b.rsvr_nm end) nm,
  318. CASE WHEN B.STATE IS NULL THEN '0' ELSE B.STATE END AS wtdstState,
  319. (case when b.rsvr_adm_name is null then e.rs_adm_name else b.rsvr_adm_name end) as rs_adm_name,
  320. (case when b.eng_scal is null then to_char(e.eng_scal) else b.eng_scal end) eng_scal,
  321. (case when b.hyst_site is null then to_char(e.location) else b.hyst_site end) as hyst_site,
  322. (case when b.location is null then to_char(e.location) else b.location end) location,
  323. B.RSVR_LONG as LGTD,B.RSVR_LAT as LTTD,
  324. B.NORMZ, B.FSLTDZ, b.state, b.res_run_stat,b.view_stat,b.base_stat,b.pres_stat,b.rever_Stat,b.REIN_STAT,b.DAM_STAT,b.SAFE_STAT,b.rgstr_id rgstrId,b.rsvr_nm rsvrNm,
  325. b.ad_code adCode, b.res_create_time resCreateTime,b.tot_cap totCap,
  326. b.dam_reg_code damRegCode, b.dam_type damType,b.has_dam_reg_code hasDamRegCode,
  327. b.res_create_time_note resCreateTimeNote, b.eng_scal_note engScalNote,b.group_leader groupLeader,
  328. b.group_leader_tel groupLeaderTel,b.rec_pers_id recPersId, b.rec_pers recPers,
  329. b.comp_Date_Str compDateStr,b.rec_pers_tel recPersTel,b.liaison_man liaisonMan,
  330. b.liaison_man_tel liaisonManTel, b.uptm ,b.intm,b.note,
  331. b.RS_CLASS, b.IMPD_DT, b.RNFC_IMPD_DT, b.DES_FL_STAG, b.CHK_INFO_STAT, b.RECT_STAT,
  332. b.FL_CON_TOP_STAG, B.INSP_TYPE, B.IS_ACTION, B.IS_SAF, B.IS_SITE, B.DUTY_DEP
  333. FROM BIS_INSP_ALL_OBJ A
  334. JOIN BIS_INSP_RSVRYN_RGSTR B ON A.OBJ_ID = B.OBJ_ID
  335. LEFT JOIN ATT_RS_BASE E ON A.CODE=E.RS_CODE
  336. where
  337. REGEXP_LIKE(
  338. A.Id,'^('||
  339. ( case when(SELECT count(id) from BIS_INSP_ALL_RLATION WHERE PERSID =#{presId}
  340. <include refid="orgIdSql"/>
  341. )>0 then
  342. (SELECT LISTAGG(id, '|') WITHIN GROUP(ORDER BY PERSID) as id FROM BIS_INSP_ALL_RLATION WHERE PERSID =#{presId}
  343. <include refid="orgIdSql"/>
  344. )
  345. else (select 'non' from dual) end)
  346. ||')')
  347. ) a
  348. <where>
  349. <if test="plnaId !=null and plnaId !=''">
  350. and a.id like '${plnaId}%'
  351. </if>
  352. <if test="state !=null and state !=''">
  353. and wtdstState =#{state}
  354. </if>
  355. <if test="engScal !=null and engScal !=''">
  356. and eng_scal in (${engScal})
  357. </if>
  358. <if test="code !=null and code !=''">
  359. and adCode like '${code}%'
  360. </if>
  361. <if test="rsName !=null and rsName !=''">
  362. and rsvrNm like '%${rsName}%'
  363. </if>
  364. <if test="inspType !=null and inspType !=''">
  365. and INSP_TYPE =#{inspType}
  366. </if>
  367. </where>
  368. order by code asc
  369. <if test="orderBy != null and orderBy != ''">
  370. ,${orderBy}
  371. </if>
  372. </select>
  373. <!--通过此用户ID下的所有行政编码-->
  374. <select id="selectAdCodeByUserId" resultType="string">
  375. select LISTAGG(code, ',') WITHIN GROUP (ORDER BY code) "code" from (
  376. select distinct substr(code,0,2) code from BIS_INSP_ALL_OBJ A
  377. where
  378. REGEXP_LIKE(
  379. A.Id,'^('||
  380. ( case when(SELECT count(id) from BIS_INSP_ALL_RLATION WHERE PERSID =#{presId}
  381. <include refid="orgIdSql"/>
  382. )>0 then
  383. (SELECT LISTAGG(id, '|') WITHIN GROUP(ORDER BY PERSID) as
  384. id FROM BIS_INSP_ALL_RLATION WHERE PERSID =#{presId}
  385. <include refid="orgIdSql"/>
  386. )
  387. else (select 'non' from dual) end)
  388. ||')')
  389. and a.PTYPE = #{ptype}
  390. )
  391. </select>
  392. <sql id="orgIdSql">
  393. <choose>
  394. <when test="orgId !=null and orgId !=''">
  395. and ORG_ID=#{orgId}
  396. </when>
  397. <otherwise>
  398. and ORG_ID is null
  399. </otherwise>
  400. </choose>
  401. </sql>
  402. <select id="selectCount" resultType="int">
  403. select count(RGSTR_ID) from BIS_INSP_RSVRYN_rgstr
  404. <include refid="page_where"/>
  405. </select>
  406. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.BisInspRsvrynRgstr">
  407. insert into BIS_INSP_RSVRYN_rgstr(
  408. <include refid="table_columns"/>
  409. )
  410. values (
  411. <include refid="entity_properties"/>
  412. )
  413. </insert>
  414. <delete id="delete" parameterType="java.lang.String">
  415. delete from BIS_INSP_RSVRYN_rgstr where RGSTR_ID = #{id}
  416. </delete>
  417. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspRsvrynRgstr">
  418. delete from BIS_INSP_RSVRYN_rgstr
  419. <include refid="page_where"/>
  420. </delete>
  421. <delete id="deleteInFlag" parameterType="java.lang.String">
  422. delete from BIS_INSP_RSVRYN_rgstr where RGSTR_ID = #{id}
  423. </delete>
  424. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.BisInspRsvrynRgstr">
  425. update BIS_INSP_RSVRYN_rgstr
  426. <trim prefix="set" suffixOverrides=",">
  427. <if test="dutyDep != null and dutyDep != ''">DUTY_DEP = #{dutyDep},</if>
  428. <if test="isSite != null and isSite != ''">IS_SITE = #{isSite},</if>
  429. <if test="isAction != null and isAction != ''">IS_ACTION = #{isAction},</if>
  430. <if test="isSaf != null and isSaf != ''">IS_SAF = #{isSaf},</if>
  431. <if test="inspType != null and inspType != ''">INSP_TYPE = #{inspType},</if>
  432. <if test="objId != null and objId != ''">OBJ_ID = #{objId},</if>
  433. <if test="location != null and location != ''">location = #{location},</if>
  434. <if test="orgId != null and orgId != ''">ORG_ID = #{orgId},</if>
  435. <if test="rsvrNm != null and rsvrNm != ''">RSVR_NM = #{rsvrNm},</if>
  436. <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
  437. <if test="resCreateTime != null">RES_CREATE_TIME = #{resCreateTime},</if>
  438. <if test="engScal != null and engScal != ''">ENG_SCAL = #{engScal},</if>
  439. <if test="normz != null and normz != ''">NORMZ = #{normz},</if>
  440. <if test="fsltdz != null and fsltdz != ''">FSLTDZ = #{fsltdz},</if>
  441. <if test="hystSite != null and hystSite != ''">HYST_SITE = #{hystSite},</if>
  442. <if test="totCap != null and totCap != ''">TOT_CAP = #{totCap},</if>
  443. <if test="damRegCode != null and damRegCode != ''">DAM_REG_CODE = #{damRegCode},</if>
  444. <if test="damType != null and damType != ''">DAM_TYPE = #{damType},</if>
  445. <if test="hasDamRegCode != null and hasDamRegCode != ''">HAS_DAM_REG_CODE = #{hasDamRegCode},</if>
  446. <if test="resCreateTimeNote != null and resCreateTimeNote != ''">RES_CREATE_TIME_NOTE =
  447. #{resCreateTimeNote},
  448. </if>
  449. <if test="engScalNote != null and engScalNote != ''">ENG_SCAL_NOTE = #{engScalNote},</if>
  450. <if test="state != null and state != ''">STATE = #{state},</if>
  451. <if test="groupLeader != null and groupLeader != ''">GROUP_LEADER = #{groupLeader},</if>
  452. <if test="groupLeaderTel != null and groupLeaderTel != ''">GROUP_LEADER_TEL = #{groupLeaderTel},</if>
  453. <if test="recPersId != null and recPersId != ''">REC_PERS_ID = #{recPersId},</if>
  454. <if test="recPers != null and recPers != ''">REC_PERS = #{recPers},</if>
  455. <if test="recPersTel != null and recPersTel != ''">REC_PERS_TEL = #{recPersTel},</if>
  456. <if test="uptm != null">UPTM = #{uptm},</if>
  457. <if test="damMaxHigh != null and damMaxHigh != ''">DAM_MAX_HIGH = #{damMaxHigh},</if>
  458. <if test="intm != null">INTM = #{intm},</if>
  459. <if test="note != null and note != ''">NOTE = #{note},</if>
  460. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  461. <if test="reverStat != null and reverStat != ''">rever_Stat = #{reverStat},</if>
  462. <if test="rsvrLat != null and rsvrLat != ''">RSVR_LAT = #{rsvrLat},</if>
  463. <if test="rsvrLong != null and rsvrLong != ''">RSVR_LONG = #{rsvrLong},</if>
  464. <if test="baseStat != null and baseStat != ''">BASE_STAT = #{baseStat},</if>
  465. <if test="viewStat != null and viewStat != ''">VIEW_STAT = #{viewStat},</if>
  466. <if test="presStat != null and presStat != ''">PRES_STAT = #{presStat},</if>
  467. <if test="resRunStat != null and resRunStat != ''">RES_RUN_STAT = #{resRunStat},</if>
  468. <if test="rsCode != null and rsCode != ''">RS_CODE = #{rsCode},</if>
  469. <if test="liaisonManTel != null and liaisonManTel != ''">liaison_Man_Tel = #{liaisonManTel},</if>
  470. <if test="liaisonMan != null and liaisonMan != ''">liaison_Man = #{liaisonMan},</if>
  471. <if test="rsvrAdmName != null and rsvrAdmName != ''">rsvr_Adm_Name = #{rsvrAdmName},</if>
  472. <if test="compDateStr != null">COMP_DATE_STR = #{compDateStr},</if>
  473. <if test="rsClass != null">RS_CLASS = #{rsClass},</if>
  474. <if test="impdDt != null">IMPD_DT = #{impdDt},</if>
  475. <if test="rnfcImpdDt != null">RNFC_IMPD_DT = #{rnfcImpdDt},</if>
  476. <if test="desFlStag != null and desFlStag != ''">DES_FL_STAG = #{desFlStag},</if>
  477. <if test="flConTopStag != null and flConTopStag != ''">FL_CON_TOP_STAG = #{flConTopStag},</if>
  478. <if test="reinStat != null and reinStat != ''">REIN_STAT = #{reinStat},</if>
  479. <if test="damStat != null and damStat != ''">DAM_STAT = #{damStat},</if>
  480. <if test="safeStat != null and safeStat != ''">SAFE_STAT = #{safeStat},</if>
  481. <if test="rectStat != null and rectStat != ''">RECT_STAT = #{rectStat},</if>
  482. <if test="chkInfoStat != null and chkInfoStat != ''">CHK_INFO_STAT = #{chkInfoStat},</if>
  483. </trim>
  484. <where>RGSTR_ID = #{rgstrId}</where>
  485. </update>
  486. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspRsvrynRgstr">
  487. update BIS_INSP_RSVRYN_rgstr
  488. <trim prefix="set" suffixOverrides=",">
  489. <if test="dutyDep != null and dutyDep != ''">DUTY_DEP = #{dutyDep},</if>
  490. <if test="isSite != null and isSite != ''">IS_SITE = #{isSite},</if>
  491. <if test="isAction != null and isAction != ''">IS_ACTION = #{isAction},</if>
  492. <if test="isSaf != null and isSaf != ''">IS_SAF = #{isSaf},</if>
  493. <if test="inspType != null and inspType != ''">INSP_TYPE = #{inspType},</if>
  494. <if test="liaisonManTel != null and liaisonManTel != ''">liaison_Man_Tel = #{liaisonManTel},</if>
  495. <if test="liaisonMan != null and liaisonMan != ''">liaison_Man = #{liaisonMan},</if>
  496. <if test="objId != null and objId != ''">OBJ_ID = #{objId},</if>
  497. <if test="orgId != null and orgId != ''">ORG_ID = #{orgId},</if>
  498. <if test="rsvrNm != null and rsvrNm != ''">RSVR_NM = #{rsvrNm},</if>
  499. <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
  500. <if test="resCreateTime != null">RES_CREATE_TIME = #{resCreateTime},</if>
  501. <if test="engScal != null and engScal != ''">ENG_SCAL = #{engScal},</if>
  502. <if test="normz != null and normz != ''">NORMZ = #{normz},</if>
  503. <if test="fsltdz != null and fsltdz != ''">FSLTDZ = #{fsltdz},</if>
  504. <if test="hystSite != null and hystSite != ''">HYST_SITE = #{hystSite},</if>
  505. <if test="totCap != null and totCap != ''">TOT_CAP = #{totCap},</if>
  506. <if test="damRegCode != null and damRegCode != ''">DAM_REG_CODE = #{damRegCode},</if>
  507. <if test="damType != null and damType != ''">DAM_TYPE = #{damType},</if>
  508. <if test="hasDamRegCode != null and hasDamRegCode != ''">HAS_DAM_REG_CODE = #{hasDamRegCode},</if>
  509. <if test="resCreateTimeNote != null and resCreateTimeNote != ''">RES_CREATE_TIME_NOTE =
  510. #{resCreateTimeNote},
  511. </if>
  512. <if test="engScalNote != null and engScalNote != ''">ENG_SCAL_NOTE = #{engScalNote},</if>
  513. <if test="state != null and state != ''">STATE = #{state},</if>
  514. <if test="groupLeader != null and groupLeader != ''">GROUP_LEADER = #{groupLeader},</if>
  515. <if test="groupLeaderTel != null and groupLeaderTel != ''">GROUP_LEADER_TEL = #{groupLeaderTel},</if>
  516. <if test="recPersId != null and recPersId != ''">REC_PERS_ID = #{recPersId},</if>
  517. <if test="recPers != null and recPers != ''">REC_PERS = #{recPers},</if>
  518. <if test="reverStat != null and reverStat != ''">rever_Stat = #{reverStat},</if>
  519. <if test="recPersTel != null and recPersTel != ''">REC_PERS_TEL = #{recPersTel},</if>
  520. <if test="uptm != null">UPTM = #{uptm},</if>
  521. <if test="damMaxHigh != null and damMaxHigh != ''">DAM_MAX_HIGH = #{damMaxHigh},</if>
  522. <if test="intm != null">INTM = #{intm},</if>
  523. <if test="note != null and note != ''">NOTE = #{note},</if>
  524. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  525. <if test="rsvrLat != null and rsvrLat != ''">RSVR_LAT = #{rsvrLat},</if>
  526. <if test="rsvrLong != null and rsvrLong != ''">RSVR_LONG = #{rsvrLong},</if>
  527. <if test="baseStat != null and baseStat != ''">BASE_STAT = #{baseStat},</if>
  528. <if test="viewStat != null and viewStat != ''">VIEW_STAT = #{viewStat},</if>
  529. <if test="presStat != null and presStat != ''">PRES_STAT = #{presStat},</if>
  530. <if test="resRunStat != null and resRunStat != ''">RES_RUN_STAT = #{resRunStat},</if>
  531. <if test="rsCode != null and rsCode != ''">RS_CODE = #{rsCode},</if>
  532. <if test="rsvrAdmName != null and rsvrAdmName != ''">rsvr_Adm_Name = #{rsvrAdmName},</if>
  533. <if test="compDateStr != null">COMP_DATE_STR = #{compDateStr},</if>
  534. <if test="rsClass != null">RS_CLASS = #{rsClass},</if>
  535. <if test="impdDt != null">IMPD_DT = #{impdDt},</if>
  536. <if test="rnfcImpdDt != null">RNFC_IMPD_DT = #{rnfcImpdDt},</if>
  537. <if test="desFlStag != null and desFlStag != ''">DES_FL_STAG = #{desFlStag},</if>
  538. <if test="flConTopStag != null and flConTopStag != ''">FL_CON_TOP_STAG = #{flConTopStag},</if>
  539. <if test="reinStat != null and reinStat != ''">REIN_STAT = #{reinStat},</if>
  540. <if test="damStat != null and damStat != ''">DAM_STAT = #{damStat},</if>
  541. <if test="safeStat != null and safeStat != ''">SAFE_STAT = #{safeStat},</if>
  542. <if test="rectStat != null and rectStat != ''">RECT_STAT = #{rectStat},</if>
  543. <if test="chkInfoStat != null and chkInfoStat != ''">CHK_INFO_STAT = #{chkInfoStat},</if>
  544. </trim>
  545. <include refid="page_where"/>
  546. </update>
  547. <select id="getRsvrByIdNm" resultType="cn.com.goldenwater.dcproj.model.BisInspBase">
  548. select * from bis_insp_all_obj a join BIS_INSP_RSVRYN_RGSTR b on a.obj_id=b.obj_id where id=#{groupId} and a.nm like '%${nm}%'
  549. </select>
  550. <select id="getListByTm" resultType="cn.com.goldenwater.dcproj.dto.BisInspTaskTotal">
  551. select count(*) objSize from BIS_INSP_RSVRYN_rgstr t where ad_code like '${adCode}%' and intm &gt;=#{stTm} and intm&lt;#{enTm}
  552. </select>
  553. </mapper>