AttRsBaseDao.xml 52 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948
  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.AttRsBaseDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.AttRsBase" id="attRsBaseResultMap">
  5. <result property="engScal" column="ENG_SCAL"/>
  6. <result property="limStag" column="LIM_STAG"/>
  7. <result property="totCap" column="TOT_CAP"/>
  8. <result property="rsAdmName" column="RS_ADM_NAME"/>
  9. <result property="rsAdmCode" column="RS_ADM_CODE"/>
  10. <result property="rsAdmDep" column="RS_ADM_DEP"/>
  11. <result property="admAttRel" column="ADM_ATT_REL"/>
  12. <result property="rsCode" column="RS_CODE"/>
  13. <result property="rsName" column="RS_NAME"/>
  14. <result property="longitude" column="LONGITUDE"/>
  15. <result property="latitude" column="LATITUDE"/>
  16. <result property="location" column="LOCATION"/>
  17. <result property="admDiv" column="ADM_DIV"/>
  18. <result property="rsType" column="RS_TYPE"/>
  19. <result property="damTypeMat" column="DAM_TYPE_MAT"/>
  20. <result property="damTypeStr" column="DAM_TYPE_STR"/>
  21. <result property="damSizeHig" column="DAM_SIZE_HIG"/>
  22. <result property="centerX" column="CENTER_X"/>
  23. <result property="centerY" column="CENTER_Y"/>
  24. <result property="rsLoc" column="RS_LOC"/>
  25. <result property="regCode" column="REG_CODE"/>
  26. <result property="compDate" column="COMP_DATE"/>
  27. <result property="centerXGd" column="CENTER_X_GD"/>
  28. <result property="centerYGd" column="CENTER_Y_GD"/>
  29. <result property="uptm" column="UPTM"/>
  30. <result property="edtrPesr" column="EDTR_PESR"/>
  31. <result property="hstInsp" column="HST_INSP"/>
  32. <result property="chkState" column="CHK_STATE"/>
  33. <result property="persId" column="PERS_ID"/>
  34. <result property="compDateStr" column="COMP_DATE_STR"/>
  35. <result property="displayLevel" column="DISPLAY_LEVEL"/>
  36. <result property="rsClass" column="RS_CLASS"/>
  37. <result property="impdDt" column="IMPD_DT"/>
  38. <result property="rnfcImpdDt" column="RNFC_IMPD_DT"/>
  39. <result property="desFlStag" column="DES_FL_STAG"/>
  40. <result property="flConTopStag" column="FL_CON_TOP_STAG"/>
  41. <result property="wiunWaoLegPers" column="WIUN_WAO_LEG_PERS"/>
  42. <result property="wiunWaoLegPersUnit" column="WIUN_WAO_LEG_PERS_UNIT"/>
  43. <result property="wiunWaoLegPersDuty" column="WIUN_WAO_LEG_PERS_DUTY"/>
  44. <result property="wiunWaoLegPersTel" column="WIUN_WAO_LEG_PERS_TEL"/>
  45. <result property="techPers" column="TECH_PERS"/>
  46. <result property="techPersUnit" column="TECH_PERS_UNIT"/>
  47. <result property="techPersDuty" column="TECH_PERS_DUTY"/>
  48. <result property="techPersTel" column="TECH_PERS_TEL"/>
  49. <result property="patrolPers" column="PATROL_PERS"/>
  50. <result property="patrolPersUnit" column="PATROL_PERS_UNIT"/>
  51. <result property="patrolPersDuty" column="PATROL_PERS_DUTY"/>
  52. <result property="patrolPersTel" column="PATROL_PERS_TEL"/>
  53. <result property="damType" column="DAM_TYPE"/>
  54. <result property="jxDuty" column="JX_DUTY"/>
  55. <result property="jxDutyPhone" column="JX_DUTY_PHONE"/>
  56. <result property="jxRsvrType" column="JX_RSVR_TYPE"/>
  57. <result property="jxRsvrStndLev" column="JX_RSVR_STND_LEV"/>
  58. <result property="buildStat" column="BUILD_STAT"/>
  59. <result property="normz" column="NORMZ"/>
  60. <result property="fsltdz" column="FSLTDZ"/>
  61. <result property="inspYear" column="INSP_YEAR"/>
  62. <result property="wcEvltOld" column="WC_EVLT_OLD"/>
  63. <result property="chkType" column="CHK_TYPE"/>
  64. <result property="isTrhbco" column="IS_TRHBCO"/>
  65. <result property="trhbcoInfo" column="TRHBCO_INFO"/>
  66. <result property="isTask" column="IS_TASK"/>
  67. <result property="inspType" column="INSP_TYPE"/>
  68. <result property="isAction" column="IS_ACTION"/>
  69. <result property="isSaf" column="IS_SAF"/>
  70. <result property="dutyDep" column="DUTY_DEP"/>
  71. <result property="admDivName" column="ADM_DIV_NAME"/>
  72. <result property="provincial" column="PROVINCIAL"/>
  73. <result property="regNo" column="REG_NO"/>
  74. </resultMap>
  75. <sql id="table_columns">
  76. CENTER_X_GD,CENTER_Y_GD,UPTM,EDTR_PESR,HST_INSP,COMP_DATE_STR,
  77. ENG_SCAL,
  78. NORMZ,
  79. FSLTDZ,
  80. LIM_STAG,
  81. TOT_CAP,
  82. RS_ADM_NAME,
  83. RS_ADM_CODE,
  84. RS_ADM_DEP,
  85. ADM_ATT_REL,
  86. RS_CODE,
  87. RS_NAME,
  88. LONGITUDE,
  89. LATITUDE,
  90. LOCATION,
  91. ADM_DIV,
  92. RS_TYPE,
  93. DAM_TYPE_MAT,
  94. DAM_TYPE_STR,
  95. DAM_SIZE_HIG,
  96. CENTER_X,
  97. CENTER_Y,RS_LOC,REG_CODE,COMP_DATE,CHK_STATE,PERS_ID,DISPLAY_LEVEL,
  98. RS_CLASS,
  99. IMPD_DT,
  100. RNFC_IMPD_DT,
  101. DES_FL_STAG,
  102. FL_CON_TOP_STAG,
  103. WIUN_WAO_LEG_PERS,
  104. WIUN_WAO_LEG_PERS_UNIT,
  105. WIUN_WAO_LEG_PERS_DUTY,
  106. WIUN_WAO_LEG_PERS_TEL,
  107. TECH_PERS,
  108. TECH_PERS_UNIT,
  109. TECH_PERS_DUTY,
  110. TECH_PERS_TEL,
  111. PATROL_PERS,
  112. PATROL_PERS_UNIT,
  113. PATROL_PERS_DUTY,
  114. PATROL_PERS_TEL,DAM_TYPE,
  115. JX_DUTY,
  116. JX_DUTY_PHONE,
  117. JX_RSVR_TYPE,
  118. JX_RSVR_STND_LEV,BUILD_STAT,
  119. INSP_YEAR,WC_EVLT_OLD,CHK_TYPE,IS_TRHBCO,
  120. TRHBCO_INFO,IS_TASK, INSP_TYPE, IS_ACTION, IS_SAF, DUTY_DEP,ADM_DIV_NAME,PROVINCIAL
  121. </sql>
  122. <sql id="entity_properties">
  123. #{centerXGd},#{centerYGd},#{uptm},#{edtrPesr},#{hstInsp},#{compDateStr},
  124. #{engScal},
  125. #{normz},
  126. #{fsltdz},
  127. #{limStag},
  128. #{totCap},
  129. #{rsAdmName},
  130. #{rsAdmCode},
  131. #{rsAdmDep},
  132. #{admAttRel},
  133. #{rsCode},
  134. #{rsName},
  135. #{longitude},
  136. #{latitude},
  137. #{location},
  138. #{admDiv},
  139. #{rsType},
  140. #{damTypeMat},
  141. #{damTypeStr},
  142. #{damSizeHig},
  143. #{centerX},
  144. #{centerY},#{rsLoc},#{regCode},#{compDate},#{chkState},#{persId},#{displayLevel},
  145. #{rsClass},
  146. #{impdDt},
  147. #{rnfcImpdDt},
  148. #{desFlStag},
  149. #{flConTopStag},
  150. #{wiunWaoLegPers},
  151. #{wiunWaoLegPersUnit},
  152. #{wiunWaoLegPersDuty},
  153. #{wiunWaoLegPersTel},
  154. #{techPers},
  155. #{techPersUnit},
  156. #{techPersDuty},
  157. #{techPersTel},
  158. #{patrolPers},
  159. #{patrolPersUnit},
  160. #{patrolPersDuty},
  161. #{patrolPersTel},
  162. #{damType},
  163. #{jxDuty},
  164. #{jxDutyPhone},
  165. #{jxRsvrType},
  166. #{jxRsvrStndLev},#{buildStat},
  167. #{inspYear},#{wcEvltOld},#{chkType},
  168. #{isTrhbco},#{trhbcoInfo},#{isTask},
  169. #{inspType},#{isAction},#{isSaf},#{dutyDep},#{admDivName},#{provincial}
  170. </sql>
  171. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  172. <sql id="page_where">
  173. <trim prefix="where" prefixOverrides="and | or ">
  174. <if test="dutyDep != null and dutyDep != ''">and DUTY_DEP = #{dutyDep}</if>
  175. <if test="isAction != null and isAction != ''">and IS_ACTION = #{isAction}</if>
  176. <if test="isSaf != null and isSaf != ''">and IS_SAF = #{isSaf}</if>
  177. <if test="inspType != null and inspType != ''">and INSP_TYPE = #{inspType}</if>
  178. <if test="engScal != null and engScal != ''">and ENG_SCAL = #{engScal}</if>
  179. <if test="normz != null and normz != ''">and NORMZ = #{normz}</if>
  180. <if test="fsltdz != null and fsltdz != ''">and FSLTDZ = #{fsltdz}</if>
  181. <if test="limStag != null and limStag != ''">and LIM_STAG = #{limStag}</if>
  182. <if test="totCap != null and totCap != ''">and TOT_CAP = #{totCap}</if>
  183. <if test="rsAdmName != null and rsAdmName != ''">and RS_ADM_NAME like '%${rsAdmName}%'</if>
  184. <if test="rsAdmCode != null and rsAdmCode != ''">and RS_ADM_CODE = #{rsAdmCode}</if>
  185. <if test="rsAdmDep != null and rsAdmDep != ''">and RS_ADM_DEP = #{rsAdmDep}</if>
  186. <if test="admAttRel != null and admAttRel != ''">and ADM_ATT_REL = #{admAttRel}</if>
  187. <if test="rsCode != null and rsCode != ''">and RS_CODE = #{rsCode}</if>
  188. <if test="rsName != null and rsName != ''">and RS_NAME like '%${rsName}%'</if>
  189. <if test="longitude != null and longitude != ''">and LONGITUDE = #{longitude}</if>
  190. <if test="latitude != null and latitude != ''">and LATITUDE = #{latitude}</if>
  191. <if test="location != null and location != ''">and LOCATION like '${location}%'</if>
  192. <if test="admDiv != null and admDiv != ''">and ADM_DIV like '${admDiv}%'</if>
  193. <if test="rsType != null and rsType != ''">and RS_TYPE = #{rsType}</if>
  194. <if test="damTypeMat != null and damTypeMat != ''">and DAM_TYPE_MAT = #{damTypeMat}</if>
  195. <if test="damTypeStr != null and damTypeStr != ''">and DAM_TYPE_STR = #{damTypeStr}</if>
  196. <if test="damSizeHig != null and damSizeHig != ''">and DAM_SIZE_HIG = #{damSizeHig}</if>
  197. <if test="centerX != null and centerX != ''">and CENTER_X = #{centerX}</if>
  198. <if test="centerY != null and centerY != ''">and CENTER_Y = #{centerY}</if>
  199. <if test="rsLoc != null and rsLoc != ''">and RS_LOC = #{rsLoc}</if>
  200. <if test="regCode != null and regCode != ''">and REG_CODE = #{regCode}</if>
  201. <if test="compDate != null">and COMP_DATE = #{compDate}</if>
  202. <if test="uptm != null">and UPTM = #{uptm}</if>
  203. <if test="edtrPesr != null and edtrPesr !=''">and EDTR_PESR = #{edtrPesr}</if>
  204. <if test="hstInsp != null and hstInsp !=''">and HST_INSP = #{hstInsp}</if>
  205. <if test="compDateStr != null">and COMP_DATE_STR = #{compDateStr}</if>
  206. <if test="admDivName != null and admDivName != ''">and ADM_DIV_NAME like '${admDivName}%'</if>
  207. <if test="rsClass != null">and RS_CLASS = #{rsClass}</if>
  208. <if test="impdDt != null">and IMPD_DT = #{impdDt}</if>
  209. <if test="rnfcImpdDt != null">and RNFC_IMPD_DT = #{rnfcImpdDt}</if>
  210. <if test="desFlStag != null and desFlStag != ''">and DES_FL_STAG = #{desFlStag}</if>
  211. <if test="flConTopStag != null and flConTopStag != ''">and FL_CON_TOP_STAG = #{flConTopStag}</if>
  212. <if test="wiunWaoLegPers != null and wiunWaoLegPers != ''">and WIUN_WAO_LEG_PERS = #{wiunWaoLegPers}</if>
  213. <if test="wiunWaoLegPersUnit != null and wiunWaoLegPersUnit != ''">and WIUN_WAO_LEG_PERS_UNIT =
  214. #{wiunWaoLegPersUnit}
  215. </if>
  216. <if test="wiunWaoLegPersDuty != null and wiunWaoLegPersDuty != ''">and WIUN_WAO_LEG_PERS_DUTY =
  217. #{wiunWaoLegPersDuty}
  218. </if>
  219. <if test="wiunWaoLegPersTel != null and wiunWaoLegPersTel != ''">and WIUN_WAO_LEG_PERS_TEL =
  220. #{wiunWaoLegPersTel}
  221. </if>
  222. <if test="techPers != null and techPers != ''">and TECH_PERS = #{techPers}</if>
  223. <if test="techPersUnit != null and techPersUnit != ''">and TECH_PERS_UNIT = #{techPersUnit}</if>
  224. <if test="techPersDuty != null and techPersDuty != ''">and TECH_PERS_DUTY = #{techPersDuty}</if>
  225. <if test="techPersTel != null and techPersTel != ''">and TECH_PERS_TEL = #{techPersTel}</if>
  226. <if test="patrolPers != null and patrolPers != ''">and PATROL_PERS = #{patrolPers}</if>
  227. <if test="patrolPersUnit != null and patrolPersUnit != ''">and PATROL_PERS_UNIT = #{patrolPersUnit}</if>
  228. <if test="patrolPersDuty != null and patrolPersDuty != ''">and PATROL_PERS_DUTY = #{patrolPersDuty}</if>
  229. <if test="patrolPersTel != null and patrolPersTel != ''">and PATROL_PERS_TEL = #{patrolPersTel}</if>
  230. <if test="damType != null and damType != ''">and DAM_TYPE = #{damType}</if>
  231. <if test="jxDuty != null and jxDuty != ''">and JX_DUTY = #{jxDuty}</if>
  232. <if test="jxDutyPhone != null and jxDutyPhone != ''">and JX_DUTY_PHONE = #{jxDutyPhone}</if>
  233. <if test="jxRsvrType != null and jxRsvrType != ''">and JX_RSVR_TYPE = #{jxRsvrType}</if>
  234. <if test="jxRsvrStndLev != null and jxRsvrStndLev != ''">and JX_RSVR_STND_LEV = #{jxRsvrStndLev}</if>
  235. <if test="inspYear != null and inspYear != ''">and INSP_YEAR = '${inspYear}%'</if>
  236. <if test="wcEvltOld != null and wcEvltOld != ''">and WC_EVLT_OLD = '${wcEvltOld}%'</if>
  237. <if test="chkType != null and chkType != ''">and CHK_TYPE = '${chkType}%'</if>
  238. <if test="isTrhbco != null and isTrhbco != ''">and IS_TRHBCO = '${isTrhbco}%'</if>
  239. <if test="trhbcoInfo != null and trhbcoInfo != ''">and TRHBCO_INFO = '${trhbcoInfo}%'</if>
  240. <if test="isTask != null and isTask != ''">and IS_TASK = '${isTask}%'</if>
  241. </trim>
  242. </sql>
  243. <select id="get" resultMap="attRsBaseResultMap" parameterType="String">
  244. select
  245. <include refid="table_columns"/>
  246. from ATT_RS_BASE where RS_CODE = #{rsCode}
  247. </select>
  248. <select id="getBy" resultMap="attRsBaseResultMap">
  249. select
  250. <include refid="table_columns"/>
  251. from ATT_RS_BASE
  252. <include refid="page_where"/>
  253. </select>
  254. <select id="findEqRsList" resultMap="attRsBaseResultMap">
  255. select
  256. <include refid="table_columns"/>
  257. from ATT_RS_BASE b where 1=1
  258. <if test="rsName != null and rsName != ''">and b.RS_NAME = #{rsName}</if>
  259. <if test="admDivName != null and admDivName != ''">and b.ADM_DIV_NAME = #{admDivName}</if>
  260. </select>
  261. <select id="findRsList" resultMap="attRsBaseResultMap">
  262. select
  263. <include refid="table_columns"/>
  264. from ATT_RS_BASE b where 1=1
  265. <if test="normz != null and normz != ''">and b.NORMZ = #{normz}</if>
  266. <if test="fsltdz != null and fsltdz != ''">and b.FSLTDZ = #{fsltdz}</if>
  267. <if test="limStag != null and limStag != ''">and b.LIM_STAG = #{limStag}</if>
  268. <if test="totCap != null and totCap != ''">and b.TOT_CAP = #{totCap}</if>
  269. <if test="rsAdmName != null and rsAdmName != ''">and b.RS_ADM_NAME like '%${rsAdmName}%'</if>
  270. <if test="rsAdmCode != null and rsAdmCode != ''">and b.RS_ADM_CODE = #{rsAdmCode}</if>
  271. <if test="admDivName != null and admDivName != ''">and b.ADM_DIV_NAME = #{admDivName}</if>
  272. <if test="rsAdmDep != null and rsAdmDep != ''">and b.RS_ADM_DEP = #{rsAdmDep}</if>
  273. <if test="admAttRel != null and admAttRel != ''">and b.ADM_ATT_REL = #{admAttRel}</if>
  274. <if test="rsName != null and rsName != ''">and b.RS_NAME like '%${rsName}%'</if>
  275. <if test="rsType != null and rsType != ''">and b.RS_TYPE in (${rsType})</if>
  276. <if test="engScal != null and engScal != ''">and b.ENG_SCAL in (${engScal})</if>
  277. <if test="admDiv != null and admDiv != ''">and b.ADM_DIV like #{admDiv}||'%'</if>
  278. <if test="addvcd != null and addvcd != ''">and b.ADM_DIV like #{addvcd}||'%'</if>
  279. <if test="dutyDep != null and dutyDep != ''">and DUTY_DEP = #{dutyDep}</if>
  280. <if test="edtrPesr != null and edtrPesr !=''">and b.EDTR_PESR = #{edtrPesr}</if>
  281. <if test="hstInsp != null and hstInsp !=''">and b.HST_INSP = #{hstInsp}</if>
  282. <if test="compDateStr != null">and b.COMP_DATE_STR = #{compDateStr}</if>
  283. <if test="location != null">and b.LOCATION like '%${location}%'</if>
  284. <if test="rsClass != null">and b.RS_CLASS = #{rsClass}</if>
  285. <if test="impdDt != null">and b.IMPD_DT = #{impdDt}</if>
  286. <if test="rnfcImpdDt != null">and b.RNFC_IMPD_DT = #{rnfcImpdDt}</if>
  287. <if test="desFlStag != null and desFlStag != ''">and b.DES_FL_STAG = #{desFlStag}</if>
  288. <if test="flConTopStag != null and flConTopStag != ''">and b.FL_CON_TOP_STAG = #{flConTopStag}</if>
  289. <if test="wiunWaoLegPers != null and wiunWaoLegPers != ''">and b.WIUN_WAO_LEG_PERS = #{wiunWaoLegPers}</if>
  290. <if test="wiunWaoLegPersUnit != null and wiunWaoLegPersUnit != ''">and b.WIUN_WAO_LEG_PERS_UNIT =
  291. #{wiunWaoLegPersUnit}
  292. </if>
  293. <if test="wiunWaoLegPersDuty != null and wiunWaoLegPersDuty != ''">and b.WIUN_WAO_LEG_PERS_DUTY =
  294. #{wiunWaoLegPersDuty}
  295. </if>
  296. <if test="wiunWaoLegPersTel != null and wiunWaoLegPersTel != ''">and b.WIUN_WAO_LEG_PERS_TEL =
  297. #{wiunWaoLegPersTel}
  298. </if>
  299. <if test="techPers != null and techPers != ''">and b.TECH_PERS = #{techPers}</if>
  300. <if test="techPersUnit != null and techPersUnit != ''">and b.TECH_PERS_UNIT = #{techPersUnit}</if>
  301. <if test="techPersDuty != null and techPersDuty != ''">and b.TECH_PERS_DUTY = #{techPersDuty}</if>
  302. <if test="techPersTel != null and techPersTel != ''">and b.TECH_PERS_TEL = #{techPersTel}</if>
  303. <if test="patrolPers != null and patrolPers != ''">and b.PATROL_PERS = #{patrolPers}</if>
  304. <if test="patrolPersUnit != null and patrolPersUnit != ''">and b.PATROL_PERS_UNIT = #{patrolPersUnit}</if>
  305. <if test="patrolPersDuty != null and patrolPersDuty != ''">and b.PATROL_PERS_DUTY = #{patrolPersDuty}</if>
  306. <if test="patrolPersTel != null and patrolPersTel != ''">and b.PATROL_PERS_TEL = #{patrolPersTel}</if>
  307. <if test="damType != null and damType != ''">and b.DAM_TYPE = #{damType}</if>
  308. <if test="inspYear != null and inspYear !=''">and b.INSP_YEAR = #{inspYear}</if>
  309. <if test="wcEvltOld != null and wcEvltOld !=''">and b.WC_EVLT_OLD = #{wcEvltOld}</if>
  310. <if test="chkType != null and chkType !=''">and b.CHK_TYPE = #{chkType}</if>
  311. <if test="isTrhbco != null and isTrhbco !=''">and b.IS_TRHBCO = #{isTrhbco}</if>
  312. <if test="trhbcoInfo != null and trhbcoInfo !=''">and b.TRHBCO_INFO = #{trhbcoInfo}</if>
  313. <if test="isTask != null and isTask !=''">and b.IS_TASK = #{isTask}</if>
  314. </select>
  315. <select id="findAll" resultMap="attRsBaseResultMap">
  316. select
  317. <include refid="table_columns"/>
  318. from ATT_RS_BASE
  319. </select>
  320. <select id="findList" resultType="cn.com.goldenwater.dcproj.dto.AttRsBaseRgstrDto">
  321. select
  322. B.RS_CODE,B.RS_NAME,B.LONGITUDE,B.LATITUDE,B.LOCATION,B.ENG_SCAL,B.LIM_STAG,B.TOT_CAP,B.RS_ADM_NAME,B.RS_ADM_CODE,B.RS_ADM_DEP,
  323. B.ADM_ATT_REL,B.ADM_DIV,B.RS_TYPE,B.DAM_TYPE_MAT,B.DAM_TYPE_STR,B.DAM_SIZE_HIG,B.CENTER_X,B.CENTER_Y,B.SRC,B.DATA_QUALITY,
  324. B.INSP_TYPE, B.IS_ACTION, B.IS_SAF, B.DUTY_DEP,
  325. B.CENTER_X_GD,B.CENTER_Y_GD,B.RS_LOC,B.REG_CODE,B.COMP_DATE,B.INTM,B.REG_NO,B.HST_INSP,B.PERS_ID,B.UPTM,B.CHK_STATE,B.EDTR_PESR,
  326. B.SLPC_ADM_DIV,B.ADM_DIV_NAME,B.COMP_DATE_STR,B.DISPLAY_LEVEL,B.RS_CLASS,B.IMPD_DT,B.RNFC_IMPD_DT,B.DES_FL_STAG,B.FL_CON_TOP_STAG,
  327. B.WIUN_WAO_LEG_PERS_UNIT,B.TECH_PERS_UNIT,B.PATROL_PERS_UNIT,B.DAM_TYPE,r.rgstr_id,b.WIUN_WAO_LEG_PERS AS
  328. WIUN_WAO_LEG_PERS1,b.WIUN_WAO_LEG_PERS_TEL AS
  329. WIUN_WAO_LEG_PERS_TEL1,b.WIUN_WAO_LEG_PERS_DUTY AS WIUN_WAO_LEG_PERS_DUTY1,
  330. b.INSP_YEAR, b.WC_EVLT_OLD, b.CHK_TYPE, b.IS_TRHBCO,b.TRHBCO_INFO,b.IS_TASK,
  331. b.TECH_PERS AS TECH_PERS1,b.TECH_PERS_TEL AS TECH_PERS_TEL1,b.TECH_PERS_DUTY AS TECH_PERS_DUTY1,
  332. b.PATROL_PERS AS PATROL_PERS1,b.PATROL_PERS_TEL AS PATROL_PERS_TEL1,b.PATROL_PERS_DUTY AS PATROL_PERS_DUTY1,
  333. b.PROVINCIAL
  334. from ATT_RS_BASE b
  335. LEFT JOIN
  336. (SELECT a.*,ROW_NUMBER() OVER(PARTITION BY rs_code ORDER BY state desc,uptm DESC) rn
  337. FROM BIS_INSP_RSVR_RGSTR a
  338. ) r on b.rs_code = r.rs_code and r.rn=1
  339. <trim prefix="where" prefixOverrides="and | or ">
  340. <if test="normz != null and normz != ''">and b.NORMZ = #{normz}</if>
  341. <if test="fsltdz != null and fsltdz != ''">and b.FSLTDZ = #{fsltdz}</if>
  342. <if test="limStag != null and limStag != ''">and b.LIM_STAG = #{limStag}</if>
  343. <if test="totCap != null and totCap != ''">and b.TOT_CAP = #{totCap}</if>
  344. <if test="rsAdmName != null and rsAdmName != ''">and b.RS_ADM_NAME like '%${rsAdmName}%'</if>
  345. <if test="rsAdmCode != null and rsAdmCode != ''">and b.RS_ADM_CODE = #{rsAdmCode}</if>
  346. <if test="admDivName != null and admDivName != ''">and b.ADM_DIV_NAME = #{admDivName}</if>
  347. <if test="rsAdmDep != null and rsAdmDep != ''">and b.RS_ADM_DEP = #{rsAdmDep}</if>
  348. <if test="admAttRel != null and admAttRel != ''">and b.ADM_ATT_REL = #{admAttRel}</if>
  349. <if test="rsName != null and rsName != ''">and b.RS_NAME like '%${rsName}%'</if>
  350. <if test="rsType != null and rsType != ''">and b.RS_TYPE in (${rsType})</if>
  351. <if test="engScal != null and engScal != ''">and b.ENG_SCAL in (${engScal})</if>
  352. <if test="admDiv != null and admDiv != ''">and b.ADM_DIV like #{admDiv}||'%'</if>
  353. <if test="edtrPesr != null and edtrPesr !=''">and b.EDTR_PESR = #{edtrPesr}</if>
  354. <if test="hstInsp != null and hstInsp !=''">and b.HST_INSP = #{hstInsp}</if>
  355. <if test="compDateStr != null">and b.COMP_DATE_STR = #{compDateStr}</if>
  356. <if test="location != null">and b.LOCATION like '%${location}%'</if>
  357. <if test="rsClass != null">and b.RS_CLASS = #{rsClass}</if>
  358. <if test="impdDt != null">and b.IMPD_DT = #{impdDt}</if>
  359. <if test="rnfcImpdDt != null">and b.RNFC_IMPD_DT = #{rnfcImpdDt}</if>
  360. <if test="desFlStag != null and desFlStag != ''">and b.DES_FL_STAG = #{desFlStag}</if>
  361. <if test="flConTopStag != null and flConTopStag != ''">and b.FL_CON_TOP_STAG = #{flConTopStag}</if>
  362. <if test="wiunWaoLegPers != null and wiunWaoLegPers != ''">and b.WIUN_WAO_LEG_PERS = #{wiunWaoLegPers}</if>
  363. <if test="wiunWaoLegPersUnit != null and wiunWaoLegPersUnit != ''">and b.WIUN_WAO_LEG_PERS_UNIT =
  364. #{wiunWaoLegPersUnit}
  365. </if>
  366. <if test="wiunWaoLegPersDuty != null and wiunWaoLegPersDuty != ''">and b.WIUN_WAO_LEG_PERS_DUTY =
  367. #{wiunWaoLegPersDuty}
  368. </if>
  369. <if test="wiunWaoLegPersTel != null and wiunWaoLegPersTel != ''">and b.WIUN_WAO_LEG_PERS_TEL =
  370. #{wiunWaoLegPersTel}
  371. </if>
  372. <if test="techPers != null and techPers != ''">and b.TECH_PERS = #{techPers}</if>
  373. <if test="techPersUnit != null and techPersUnit != ''">and b.TECH_PERS_UNIT = #{techPersUnit}</if>
  374. <if test="techPersDuty != null and techPersDuty != ''">and b.TECH_PERS_DUTY = #{techPersDuty}</if>
  375. <if test="techPersTel != null and techPersTel != ''">and b.TECH_PERS_TEL = #{techPersTel}</if>
  376. <if test="patrolPers != null and patrolPers != ''">and b.PATROL_PERS = #{patrolPers}</if>
  377. <if test="patrolPersUnit != null and patrolPersUnit != ''">and b.PATROL_PERS_UNIT = #{patrolPersUnit}</if>
  378. <if test="patrolPersDuty != null and patrolPersDuty != ''">and b.PATROL_PERS_DUTY = #{patrolPersDuty}</if>
  379. <if test="patrolPersTel != null and patrolPersTel != ''">and b.PATROL_PERS_TEL = #{patrolPersTel}</if>
  380. <if test="damType != null and damType != ''">and b.DAM_TYPE = #{damType}</if>
  381. <if test="province != null and province != ''">and b.RS_CODE LIKE '${province}%'</if>
  382. <if test="inspYear != null and inspYear !=''">and b.INSP_YEAR = #{inspYear}</if>
  383. <if test="wcEvltOld != null and wcEvltOld !=''">and b.WC_EVLT_OLD = #{wcEvltOld}</if>
  384. <if test="chkType != null and chkType !=''">and b.CHK_TYPE = #{chkType}</if>
  385. <if test="isTrhbco != null and isTrhbco !=''">and b.IS_TRHBCO = #{isTrhbco}</if>
  386. <if test="trhbcoInfo != null and trhbcoInfo !=''">and b.TRHBCO_INFO = #{trhbcoInfo}</if>
  387. <if test="isTask != null and isTask !=''">and b.IS_TASK = #{isTask}</if>
  388. <if test="provincial != null and provincial !=''">and b.PROVINCIAL = #{provincial}</if>
  389. </trim>
  390. ORDER BY b.RS_CODE ASC
  391. </select>
  392. <select id="selectCount" resultType="int">
  393. select count(rs_code) from ATT_RS_BASE
  394. <include refid="page_where"/>
  395. </select>
  396. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.AttRsBase">
  397. insert into ATT_RS_BASE(
  398. <include refid="table_columns"/>
  399. )
  400. values (
  401. <include refid="entity_properties"/>
  402. )
  403. </insert>
  404. <delete id="delete" parameterType="java.lang.String">
  405. delete from ATT_RS_BASE where RS_CODE = #{rsCode}
  406. </delete>
  407. <select id="findMax" parameterType="String" resultType="String">
  408. select max(rs_code) as rs_code from ATT_RS_BASE where rs_code like '${location}%'
  409. </select>
  410. <select id="getObjId" resultType="cn.com.goldenwater.dcproj.model.AttRsBase">
  411. SELECT
  412. <include refid="table_columns"/>
  413. FROM ATT_RS_BASE
  414. WHERE RS_CODE = (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE OBJ_ID = #{objId})
  415. </select>
  416. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.AttRsBase">
  417. delete from ATT_RS_BASE
  418. <include refid="page_where"/>
  419. </delete>
  420. <update id="deleteInFlag" parameterType="java.lang.String">
  421. update ATT_RS_BASE set flag_valid = 0 where RS_CODE = #{rsCode}
  422. </update>
  423. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.AttRsBase">
  424. update ATT_RS_BASE
  425. <trim prefix="set" suffixOverrides=",">
  426. <if test="engScal != null and engScal != ''">ENG_SCAL = #{engScal},</if>
  427. <if test="dutyDep != null and dutyDep != ''">DUTY_DEP = #{dutyDep},</if>
  428. <if test="isAction != null and isAction != ''">IS_ACTION = #{isAction},</if>
  429. <if test="isSaf != null and isSaf != ''">IS_SAF = #{isSaf},</if>
  430. <if test="inspType != null and inspType != ''">INSP_TYPE = #{inspType},</if>
  431. <if test="normz != null and normz != ''">NORMZ = #{normz},</if>
  432. FSLTDZ = #{fsltdz},
  433. <if test="limStag != null and limStag != ''">LIM_STAG = #{limStag},</if>
  434. TOT_CAP = #{totCap},
  435. <if test="rsAdmName != null and rsAdmName != ''">RS_ADM_NAME = #{rsAdmName},</if>
  436. <if test="rsAdmCode != null and rsAdmCode != ''">RS_ADM_CODE = #{rsAdmCode},</if>
  437. <if test="rsAdmDep != null and rsAdmDep != ''">RS_ADM_DEP = #{rsAdmDep},</if>
  438. <if test="admAttRel != null and admAttRel != ''">ADM_ATT_REL = #{admAttRel},</if>
  439. <if test="rsName != null and rsName != ''">RS_NAME = #{rsName},</if>
  440. <if test="longitude != null and longitude != ''">LONGITUDE = #{longitude},</if>
  441. <if test="latitude != null and latitude != ''">LATITUDE = #{latitude},</if>
  442. <if test="location != null and location != ''">LOCATION = #{location},</if>
  443. <if test="admDiv != null and admDiv != ''">ADM_DIV = #{admDiv},</if>
  444. <if test="rsType != null and rsType != ''">RS_TYPE = #{rsType},</if>
  445. <if test="damTypeMat != null and damTypeMat != ''">DAM_TYPE_MAT = #{damTypeMat},</if>
  446. <if test="damTypeStr != null and damTypeStr != ''">DAM_TYPE_STR = #{damTypeStr},</if>
  447. <if test="damSizeHig != null and damSizeHig != ''">DAM_SIZE_HIG = #{damSizeHig},</if>
  448. <if test="centerX != null and centerX != ''">CENTER_X = to_number(#{centerX}),</if>
  449. <if test="centerY != null and centerY != ''">CENTER_Y = #{centerY},</if>
  450. <if test="centerXGd != null and centerXGd != ''">CENTER_X_GD = #{centerXGd},</if>
  451. <if test="centerYGd != null and centerYGd != ''">CENTER_Y_GD = #{centerYGd},</if>
  452. <if test="rsLoc != null and rsLoc != ''">RS_LOC = #{rsLoc},</if>
  453. <if test="regCode != null and regCode != ''">REG_CODE = #{regCode},</if>
  454. <if test="compDate != null ">COMP_DATE = #{compDate},</if>
  455. <if test="uptm != null">UPTM = #{uptm},</if>
  456. <if test="edtrPesr != null and edtrPesr !=''">EDTR_PESR = #{edtrPesr},</if>
  457. <if test="hstInsp != null and hstInsp !=''">HST_INSP = #{hstInsp},</if>
  458. <if test="chkState != null and chkState !=''">CHK_STATE = #{chkState},</if>
  459. <if test="persId != null and persId !=''">PERS_ID = #{persId},</if>
  460. <if test="compDateStr != null">COMP_DATE_STR = #{compDateStr},</if>
  461. <if test="displayLevel != null and displayLevel != ''">DISPLAY_LEVEL = #{displayLevel},</if>
  462. <if test="rsClass != null">RS_CLASS = #{rsClass},</if>
  463. <if test="impdDt != null">IMPD_DT = #{impdDt},</if>
  464. <if test="rnfcImpdDt != null">RNFC_IMPD_DT = #{rnfcImpdDt},</if>
  465. <if test="desFlStag != null and desFlStag != ''">DES_FL_STAG = #{desFlStag},</if>
  466. <if test="flConTopStag != null and flConTopStag != ''">FL_CON_TOP_STAG = #{flConTopStag},</if>
  467. <if test="wiunWaoLegPers != null and wiunWaoLegPers != ''">WIUN_WAO_LEG_PERS = #{wiunWaoLegPers},</if>
  468. <if test="wiunWaoLegPersUnit != null and wiunWaoLegPersUnit != ''">WIUN_WAO_LEG_PERS_UNIT =
  469. #{wiunWaoLegPersUnit},
  470. </if>
  471. <if test="wiunWaoLegPersDuty != null and wiunWaoLegPersDuty != ''">WIUN_WAO_LEG_PERS_DUTY =
  472. #{wiunWaoLegPersDuty},
  473. </if>
  474. <if test="wiunWaoLegPersTel != null and wiunWaoLegPersTel != ''">WIUN_WAO_LEG_PERS_TEL =
  475. #{wiunWaoLegPersTel},
  476. </if>
  477. <if test="techPers != null and techPers != ''">TECH_PERS = #{techPers},</if>
  478. <if test="techPersUnit != null and techPersUnit != ''">TECH_PERS_UNIT = #{techPersUnit},</if>
  479. <if test="techPersDuty != null and techPersDuty != ''">TECH_PERS_DUTY = #{techPersDuty},</if>
  480. <if test="techPersTel != null and techPersTel != ''">TECH_PERS_TEL = #{techPersTel},</if>
  481. <if test="patrolPers != null and patrolPers != ''">PATROL_PERS = #{patrolPers},</if>
  482. <if test="patrolPersUnit != null and patrolPersUnit != ''">PATROL_PERS_UNIT = #{patrolPersUnit},</if>
  483. <if test="patrolPersDuty != null and patrolPersDuty != ''">PATROL_PERS_DUTY = #{patrolPersDuty},</if>
  484. <if test="patrolPersTel != null and patrolPersTel != ''">PATROL_PERS_TEL = #{patrolPersTel},</if>
  485. <if test="damType != null and damType != ''">DAM_TYPE = #{damType},</if>
  486. <if test="jxDuty != null and jxDuty != ''">JX_DUTY = #{jxDuty},</if>
  487. <if test="jxDutyPhone != null and jxDutyPhone != ''">JX_DUTY_PHONE = #{jxDutyPhone},</if>
  488. <if test="jxRsvrType != null and jxRsvrType != ''">JX_RSVR_TYPE = #{jxRsvrType},</if>
  489. <if test="jxRsvrStndLev != null and jxRsvrStndLev != ''">JX_RSVR_STND_LEV = #{jxRsvrStndLev},</if>
  490. <if test="inspYear != null and inspYear != ''">INSP_YEAR = #{inspYear},</if>
  491. <if test="wcEvltOld != null and wcEvltOld != ''">WC_EVLT_OLD = #{wcEvltOld},</if>
  492. <if test="chkType != null and chkType != ''">CHK_TYPE = #{chkType},</if>
  493. <if test="isTrhbco != null and isTrhbco != ''">IS_TRHBCO = #{isTrhbco},</if>
  494. <if test="trhbcoInfo != null and trhbcoInfo != ''">TRHBCO_INFO = #{trhbcoInfo},</if>
  495. <if test="isTask != null and isTask != ''">IS_TASK = #{isTask},</if>
  496. <if test="admDivName != null and admDivName != ''">ADM_DIV_NAME = #{admDivName},</if>
  497. <if test="provincial != null and provincial != ''">PROVINCIAL = #{provincial},</if>
  498. </trim>
  499. <where>RS_CODE = #{rsCode}</where>
  500. </update>
  501. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.AttRsBase">
  502. update ATT_RS_BASE
  503. <trim prefix="set" suffixOverrides=",">
  504. <if test="engScal != null and engScal != ''">ENG_SCAL = #{engScal},</if>
  505. <if test="dutyDep != null and dutyDep != ''">DUTY_DEP = #{dutyDep},</if>
  506. <if test="isAction != null and isAction != ''">IS_ACTION = #{isAction},</if>
  507. <if test="isSaf != null and isSaf != ''">IS_SAF = #{isSaf},</if>
  508. <if test="inspType != null and inspType != ''">INSP_TYPE = #{inspType},</if>
  509. <if test="normz != null and normz != ''">NORMZ = #{normz},</if>
  510. FSLTDZ = #{fsltdz},
  511. <if test="limStag != null and limStag != ''">LIM_STAG = #{limStag},</if>
  512. TOT_CAP = #{totCap},
  513. <if test="rsAdmName != null and rsAdmName != ''">RS_ADM_NAME = #{rsAdmName},</if>
  514. <if test="rsAdmCode != null and rsAdmCode != ''">RS_ADM_CODE = #{rsAdmCode},</if>
  515. <if test="rsAdmDep != null and rsAdmDep != ''">RS_ADM_DEP = #{rsAdmDep},</if>
  516. <if test="admAttRel != null and admAttRel != ''">ADM_ATT_REL = #{admAttRel},</if>
  517. <if test="rsCode != null and rsCode != ''">RS_CODE = #{rsCode},</if>
  518. <if test="rsName != null and rsName != ''">RS_NAME = #{rsName},</if>
  519. <if test="longitude != null and longitude != ''">LONGITUDE = #{longitude},</if>
  520. <if test="latitude != null and latitude != ''">LATITUDE = #{latitude},</if>
  521. <if test="location != null and location != ''">LOCATION = #{location},</if>
  522. <if test="admDiv != null and admDiv != ''">ADM_DIV = #{admDiv},</if>
  523. <if test="rsType != null and rsType != ''">RS_TYPE = #{rsType},</if>
  524. <if test="damTypeMat != null and damTypeMat != ''">DAM_TYPE_MAT = #{damTypeMat},</if>
  525. <if test="damTypeStr != null and damTypeStr != ''">DAM_TYPE_STR = #{damTypeStr},</if>
  526. <if test="damSizeHig != null and damSizeHig != ''">DAM_SIZE_HIG = #{damSizeHig},</if>
  527. <if test="centerX != null and centerX != ''">CENTER_X = to_number(#{centerX}),</if>
  528. <if test="centerY != null and centerY != ''">CENTER_Y = #{centerY},</if>
  529. <if test="rsLoc != null and rsLoc != ''">RS_LOC = #{rsLoc},</if>
  530. <if test="regCode != null and regCode != ''">REG_CODE = #{regCode},</if>
  531. <if test="centerXGd != null and centerXGd != ''">CENTER_X_GD = #{centerXGd},</if>
  532. <if test="centerYGd != null and centerYGd != ''">CENTER_Y_GD = #{centerYGd},</if>
  533. <if test="compDate != null">COMP_DATE = #{compDate},</if>
  534. <if test="uptm != null">UPTM = #{uptm},</if>
  535. <if test="edtrPesr != null and edtrPesr !=''">EDTR_PESR = #{edtrPesr},</if>
  536. <if test="hstInsp != null and hstInsp !=''">HST_INSP = #{hstInsp},</if>
  537. <if test="compDateStr != null">COMP_DATE_STR = #{compDateStr},</if>
  538. <if test="displayLevel != null and displayLevel != ''">DISPLAY_LEVEL = #{displayLevel},</if>
  539. <if test="rsClass != null">RS_CLASS = #{rsClass},</if>
  540. <if test="impdDt != null">IMPD_DT = #{impdDt},</if>
  541. <if test="rnfcImpdDt != null">RNFC_IMPD_DT = #{rnfcImpdDt},</if>
  542. <if test="desFlStag != null and desFlStag != ''">DES_FL_STAG = #{desFlStag},</if>
  543. <if test="flConTopStag != null and flConTopStag != ''">FL_CON_TOP_STAG = #{flConTopStag},</if>
  544. <if test="wiunWaoLegPers != null and wiunWaoLegPers != ''">WIUN_WAO_LEG_PERS = #{wiunWaoLegPers},</if>
  545. <if test="wiunWaoLegPersUnit != null and wiunWaoLegPersUnit != ''">WIUN_WAO_LEG_PERS_UNIT =
  546. #{wiunWaoLegPersUnit},
  547. </if>
  548. <if test="wiunWaoLegPersDuty != null and wiunWaoLegPersDuty != ''">WIUN_WAO_LEG_PERS_DUTY =
  549. #{wiunWaoLegPersDuty},
  550. </if>
  551. <if test="wiunWaoLegPersTel != null and wiunWaoLegPersTel != ''">WIUN_WAO_LEG_PERS_TEL =
  552. #{wiunWaoLegPersTel},
  553. </if>
  554. <if test="techPers != null and techPers != ''">TECH_PERS = #{techPers},</if>
  555. <if test="techPersUnit != null and techPersUnit != ''">TECH_PERS_UNIT = #{techPersUnit},</if>
  556. <if test="techPersDuty != null and techPersDuty != ''">TECH_PERS_DUTY = #{techPersDuty},</if>
  557. <if test="techPersTel != null and techPersTel != ''">TECH_PERS_TEL = #{techPersTel},</if>
  558. <if test="patrolPers != null and patrolPers != ''">PATROL_PERS = #{patrolPers},</if>
  559. <if test="patrolPersUnit != null and patrolPersUnit != ''">PATROL_PERS_UNIT = #{patrolPersUnit},</if>
  560. <if test="patrolPersDuty != null and patrolPersDuty != ''">PATROL_PERS_DUTY = #{patrolPersDuty},</if>
  561. <if test="patrolPersTel != null and patrolPersTel != ''">PATROL_PERS_TEL = #{patrolPersTel},</if>
  562. <if test="damType != null and damType != ''">DAM_TYPE = #{damType},</if>
  563. <if test="jxDuty != null and jxDuty != ''">JX_DUTY = #{jxDuty},</if>
  564. <if test="jxDutyPhone != null and jxDutyPhone != ''">JX_DUTY_PHONE = #{jxDutyPhone},</if>
  565. <if test="jxRsvrType != null and jxRsvrType != ''">JX_RSVR_TYPE = #{jxRsvrType},</if>
  566. <if test="jxRsvrStndLev != null and jxRsvrStndLev != ''">JX_RSVR_STND_LEV = #{jxRsvrStndLev},</if>
  567. <if test="inspYear != null and inspYear != ''">INSP_YEAR = #{inspYear},</if>
  568. <if test="wcEvltOld != null and wcEvltOld != ''">WC_EVLT_OLD = #{wcEvltOld},</if>
  569. <if test="chkType != null and chkType != ''">CHK_TYPE = #{chkType},</if>
  570. <if test="isTrhbco != null and isTrhbco != ''">IS_TRHBCO = #{isTrhbco},</if>
  571. <if test="trhbcoInfo != null and trhbcoInfo != ''">TRHBCO_INFO = #{trhbcoInfo},</if>
  572. <if test="isTask != null and isTask != ''">IS_TASK = #{isTask},</if>
  573. <if test="admDivName != null and admDivName != ''">ADM_DIV_NAME = #{admDivName},</if>
  574. <if test="provincial != null and provincial != ''">PROVINCIAL = #{provincial},</if>
  575. </trim>
  576. <include refid="page_where"/>
  577. </update>
  578. <!-- 其他自定义SQL -->
  579. <!--根据督查组查询范围内的对象-->
  580. <select id="getListByInspGroupIdObjType" parameterType="cn.com.goldenwater.dcproj.param.PagePersObjParam"
  581. resultType="cn.com.goldenwater.dcproj.vo.AttRsBaseVo">
  582. SELECT
  583. T.*,C.ID,C.PNM,O.OBJ_ID
  584. FROM ATT_RS_BASE T
  585. JOIN BIS_INSP_ALL_OBJ O ON O.CODE = T.RS_CODE
  586. JOIN BIS_INSP_ALL C ON O.ID = C.ID
  587. where O.PTYPE = #{objType}
  588. <if test='isAll == "0"'>and o.ID = #{inspGroupId}</if>
  589. <if test='isAll == "1"'>and o.ID LIKE '${inspGroupId}%'</if>
  590. <if test="rsName != null and rsName != ''">and t.RS_NAME LIKE '%${rsName}%'</if>
  591. <if test="engScal != null and engScal != ''">and t.ENG_SCAL = #{engScal}</if>
  592. <if test="rsAdmDep != null and rsAdmDep != ''">and t.RS_ADM_DEP = #{rsAdmDep}</if>
  593. <if test="adCode != null and adCode != ''">and t.ADM_DIV LIKE '${adCode}%'</if>
  594. <choose>
  595. <when test="province !=null and province !=''">
  596. and o.ad_code like '${province}%'
  597. </when>
  598. <otherwise>
  599. and o.ad_code is null
  600. </otherwise>
  601. </choose>
  602. <!-- <if test="objType =='1'.toString()">-->
  603. <!-- AND t.ENG_SCAL in(4,5)-->
  604. <!-- </if>-->
  605. <!-- <if test="objType =='36'.toString()">-->
  606. <!-- AND t.ENG_SCAL in(1,2,3)-->
  607. <!-- </if>-->
  608. <if test="objType == '26'.toString()">
  609. and t.ENG_SCAL in (1,2,3)
  610. </if>
  611. order by t.rs_code
  612. </select>
  613. <!--查询不在范围内的对象-->
  614. <select id="getObjListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.model.AttRsBase">
  615. select *
  616. from ATT_RS_BASE t
  617. where t.rs_code not in (
  618. select CODE from BIS_INSP_ALL_OBJ where id like concat(#{inspGroupId},'%'))
  619. <if test="rsName != null and rsName != ''">and t.RS_NAME LIKE '%${rsName}%'</if>
  620. <if test="adCode != null and adCode != ''">and t.ADM_DIV LIKE '${adCode}%'</if>
  621. <if test="engScal != null and engScal != ''">and t.ENG_SCAL = #{engScal}</if>
  622. <if test="rsAdmDep != null and rsAdmDep != ''">and t.RS_ADM_DEP = #{rsAdmDep}</if>
  623. <if test="province != null and province != ''">and t.ADM_DIV LIKE '${province}%'</if>
  624. <if test="objType =='1'.toString()">AND t.ENG_SCAL in(4,5)</if>
  625. <if test="objType =='36'.toString()">AND t.ENG_SCAL in(1,2,3)</if>
  626. <if test="objType =='26'.toString()">AND t.ENG_SCAL in(1,2,3)</if>
  627. </select>
  628. <select id="getObjByPersId" parameterType="cn.com.goldenwater.dcproj.param.PersObjParam"
  629. resultType="cn.com.goldenwater.dcproj.model.AttPersRs">
  630. SELECT A.ENG_SCAL,R.RGSTR_ID,A.HST_INSP, A.INSP_TYPE, A.IS_ACTION, A.IS_SAF,A.DUTY_DEP,
  631. A.LIM_STAG,
  632. A.TOT_CAP,
  633. A.NORMZ,
  634. A.FSLTDZ,
  635. A.RS_ADM_NAME,
  636. A.RS_ADM_CODE,
  637. A.RS_ADM_DEP,
  638. A.ADM_ATT_REL,
  639. A.RS_CODE,
  640. A.RS_NAME,
  641. A.LONGITUDE,
  642. A.LATITUDE,
  643. A.LOCATION,
  644. A.ADM_DIV,
  645. A.RS_TYPE,
  646. A.DAM_TYPE_MAT,
  647. A.DAM_TYPE_STR,
  648. A.DAM_SIZE_HIG,
  649. A.CENTER_X,
  650. A.CENTER_Y,A.CENTER_X_GD,
  651. A.CENTER_Y_GD,
  652. A.RS_CLASS,
  653. A.IMPD_DT,
  654. A.RNFC_IMPD_DT,
  655. A.DES_FL_STAG,
  656. A.FL_CON_TOP_STAG,
  657. A.WIUN_WAO_LEG_PERS,
  658. A.WIUN_WAO_LEG_PERS_UNIT,
  659. A.WIUN_WAO_LEG_PERS_DUTY,
  660. A.WIUN_WAO_LEG_PERS_TEL,
  661. A.TECH_PERS,
  662. A.TECH_PERS_UNIT,
  663. A.TECH_PERS_DUTY,
  664. A.TECH_PERS_TEL,
  665. A.PATROL_PERS,
  666. A.PATROL_PERS_UNIT,
  667. A.PATROL_PERS_DUTY,
  668. A.PATROL_PERS_TEL,
  669. A.PROVINCIAL,
  670. B.ID,
  671. B.NM,
  672. B.PTYPE,
  673. B.LGTD,
  674. B.LTTD,AD.AD_NAME adName,
  675. B.INSP_YEAR,B.WC_EVLT_OLD,B.CHK_TYPE,B.IS_TRHBCO,B.TRHBCO_INFO,B.IS_TASK,
  676. B.OBJ_ID FROM ATT_RS_BASE A LEFT JOIN BIS_INSP_ALL_OBJ B ON A.RS_CODE = B.CODE
  677. LEFT JOIN BIS_INSP_RSVR_RGSTR R on B.Obj_Id=R.Obj_Id
  678. LEFT JOIN ATT_AD_BASE AD ON A.ADM_DIV = AD.AD_CODE
  679. WHERE B.PTYPE = #{objType}
  680. <choose>
  681. <when test="province !=null and province !=''">
  682. and B.AD_CODE=#{province}
  683. </when>
  684. <otherwise>
  685. and B.AD_CODE is null
  686. </otherwise>
  687. </choose>
  688. AND
  689. REGEXP_LIKE(
  690. B.Id,'^('||
  691. ( case when(SELECT count(id) from BIS_INSP_ALL_RLATION WHERE PERSID =#{persGuid}
  692. <include refid="orgIdSql"/>
  693. )>0 then
  694. (SELECT LISTAGG(id, '|') as
  695. id FROM BIS_INSP_ALL_RLATION WHERE PERSID =#{persGuid}
  696. <include refid="orgIdSql"/> GROUP BY PERSID
  697. )
  698. else (select 'non' from dual) end)
  699. ||')')
  700. and R.RGSTR_ID is not null
  701. <if test="rsName != null and rsName != ''">and A.RS_NAME LIKE '%${rsName}%'</if>
  702. <if test="adCode != null and adCode != ''">and A.ADM_DIV LIKE '${adCode}%'</if>
  703. <if test="objType =='1'.toString()">
  704. AND A.ENG_SCAL in(4,5)
  705. </if>
  706. <if test="objType =='36'.toString()">
  707. AND A.ENG_SCAL in(1,2,3)
  708. </if>
  709. ORDER BY A.RS_CODE
  710. </select>
  711. <sql id="orgIdSql">
  712. <choose>
  713. <when test="orgId !=null and orgId !=''">
  714. and ORG_ID=#{orgId}
  715. </when>
  716. <otherwise>
  717. and ORG_ID is null
  718. </otherwise>
  719. </choose>
  720. </sql>
  721. <select id="getRsCountByAdCode" resultType="Long">
  722. SELECT COUNT(RS_CODE) FROM ATT_RS_BASE WHERE ADM_DIV LIKE '${subAd}%'
  723. </select>
  724. <select id="getRsCountByGrad" resultType="cn.com.goldenwater.dcproj.dto.RsCountDto">
  725. SELECT AD.AD_CODE,AD.AD_NAME,AD.LGTD lgtd,AD.LTTD lttd,t1.rsCount FROM
  726. ATT_AD_X_BASE AD LEFT JOIN
  727. (SELECT SUBSTR(ADM_DIV,1,${sub}) subAd,count(RS_CODE) rsCount FROM ATT_RS_BASE t where 1=1
  728. <if test="objType =='1'.toString()">
  729. AND t.ENG_SCAL in(4,5)
  730. </if>
  731. <if test="objType =='36'.toString()">
  732. AND t.ENG_SCAL in(1,2,3)
  733. </if>
  734. GROUP BY SUBSTR(ADM_DIV,1,${sub})) t1
  735. ON CONCAT(t1.subAd,'${con}') = AD.AD_CODE
  736. WHERE AD.AD_GRAD = #{adGrad}
  737. <if test="adCode != null and adCode != ''">and AD.AD_CODE LIKE '${adCode}%'</if>
  738. ORDER BY AD.AD_CODE
  739. </select>
  740. <select id="getRsListByNodeIdsAndAdCodes" resultType="cn.com.goldenwater.dcproj.model.AttRsBase">
  741. select DISTINCT t.*
  742. from ATT_RS_BASE t
  743. left join BIS_INSP_ALL_OBJ o
  744. on o.code = t.rs_code
  745. where o.ptype = #{pType}
  746. AND
  747. REGEXP_LIKE(
  748. o.Id,'^('||
  749. ( case when(SELECT count(id) from BIS_INSP_ALL_RLATION WHERE PERSID =#{persGuid}
  750. <include refid="orgIdSql"/>
  751. )>0 then
  752. (SELECT LISTAGG(id, '|') as
  753. id FROM BIS_INSP_ALL_RLATION WHERE PERSID =#{persGuid}
  754. <include refid="orgIdSql"/> GROUP BY PERSID
  755. )
  756. else (select 'non' from dual) end)
  757. ||')')
  758. <if test="nodes != null and nodes != ''">
  759. AND
  760. <foreach collection="nodes" index="index" item="item" separator="or">
  761. o.id like CONCAT(#{item},'%')
  762. </foreach>
  763. </if>
  764. <if test="ads != null and ads != ''">
  765. AND
  766. <foreach collection="ads" index="index" item="item1" separator="or">
  767. t.adm_div like #{item1}
  768. </foreach>
  769. </if>
  770. <if test="pType =='1'.toString()">
  771. AND t.ENG_SCAL in(4,5)
  772. </if>
  773. <if test="pType =='36'.toString()">
  774. AND t.ENG_SCAL in(1,2,3)
  775. </if>
  776. order by t.rs_code asc
  777. </select>
  778. <select id="findGdIsNull" resultType="cn.com.goldenwater.dcproj.model.AttRsBase">
  779. select * from ATT_RS_BASE WHERE center_x is not null and center_y is not null and center_x_gd is null and center_y_gd is null
  780. </select>
  781. <select id="getRsBaseList" parameterType="cn.com.goldenwater.dcproj.param.PersObjParam"
  782. resultType="cn.com.goldenwater.dcproj.dto.BisInspObjDto">
  783. select * from (select t.rs_name as nm,t.rs_code as
  784. code,t.eng_scal,t.center_x,t.center_y,t.location,t.CENTER_X_GD gdX,t.CENTER_Y_GD gdY,
  785. case when b.state is null then '0' else b.state end as state,t.display_level,t.ADM_DIV as ad_code,
  786. t.INSP_YEAR,t.WC_EVLT_OLD,t.CHK_TYPE,t.IS_TRHBCO,t.TRHBCO_INFO,t.IS_TASK,t.PROVINCIAL
  787. from att_rs_base t
  788. left join
  789. (SELECT b.CODE,B.OBJ_ID,C.STATE,C.id as rgstr_id FROM BIS_INSP_ALL_OBJ B
  790. LEFT JOIN BIS_INSP_RSFCO_RGSTR C ON B.OBJ_ID = C.OBJ_ID
  791. where b.ptype = '26'
  792. ) b ON b.code = t.RS_CODE
  793. where t.eng_scal in ('1','2','3')) FOR_QUE WHERE 1=1
  794. <if test="state != null and state != ''">and FOR_QUE.STATE = #{state}</if>
  795. <if test="maxLgtd != null and maxLgtd != '' and minLgtd != null and minLgtd != ''">and FOR_QUE.CENTER_X BETWEEN
  796. #{minLgtd} AND #{maxLgtd}
  797. </if>
  798. <if test="maxLttd != null and maxLttd != '' and minLttd != null and minLttd != ''">and FOR_QUE.CENTER_Y BETWEEN
  799. #{minLttd} AND #{maxLttd}
  800. </if>
  801. <if test="maxcenterXGd != null and maxcenterXGd != '' and mincenterXGd != null and mincenterXGd != ''">and
  802. FOR_QUE.gdX BETWEEN #{mincenterXGd} AND #{maxcenterXGd}
  803. </if>
  804. <if test="maxcenterYGd != null and maxcenterYGd != '' and mincenterYGd != null and mincenterYGd != ''">and
  805. FOR_QUE.gdY BETWEEN #{mincenterYGd} AND #{maxcenterYGd}
  806. </if>
  807. <if test="engScal != null and engScal != ''">and FOR_QUE.ENG_SCAL = #{engScal}</if>
  808. <if test="rsName != null and rsName != ''">and FOR_QUE.NM like CONCAT('%',CONCAT(#{rsName}, '%'))</if>
  809. <if test="adCode != null and adCode != ''">and FOR_QUE.ad_code like CONCAT('%',CONCAT(#{adCode}, '%'))</if>
  810. <if test="displayLevel != null and displayLevel != ''">
  811. AND to_number(FOR_QUE.DISPLAY_LEVEL) &lt;= to_number(#{displayLevel})
  812. </if>
  813. </select>
  814. <select id="getRssfdrBaseList" parameterType="cn.com.goldenwater.dcproj.param.PersObjParam"
  815. resultType="cn.com.goldenwater.dcproj.dto.BisInspObjDto">
  816. select * from
  817. (
  818. select
  819. t.rs_name as nm,t.rs_code as code,t.eng_scal,t.center_x,t.center_y,
  820. t.location,t.CENTER_X_GD gdX,t.CENTER_Y_GD gdY,
  821. case when b.state is null then '0' else b.state end as state,
  822. t.display_level,t.ADM_DIV as ad_code, t.build_stat as type,
  823. t.provincial
  824. from att_rs_base t
  825. left join
  826. (SELECT B.CODE,B.OBJ_ID,C.STATE,C.ID AS RGSTR_ID FROM BIS_INSP_ALL_OBJ B
  827. LEFT JOIN BIS_INSP_RSSFDR_RGSTR C ON B.OBJ_ID = C.OBJ_ID
  828. WHERE B.PTYPE = '34'
  829. ) b ON b.code = t.RS_CODE
  830. where t.build_stat in ('1','2','3')) FOR_QUE WHERE 1=1
  831. <if test="state != null and state != ''">and FOR_QUE.STATE = #{state}</if>
  832. <if test="maxLgtd != null and maxLgtd != '' and minLgtd != null and minLgtd != ''">and FOR_QUE.CENTER_X BETWEEN
  833. #{minLgtd} AND #{maxLgtd}
  834. </if>
  835. <if test="maxLttd != null and maxLttd != '' and minLttd != null and minLttd != ''">and FOR_QUE.CENTER_Y BETWEEN
  836. #{minLttd} AND #{maxLttd}
  837. </if>
  838. <if test="maxcenterXGd != null and maxcenterXGd != '' and mincenterXGd != null and mincenterXGd != ''">and
  839. FOR_QUE.gdX BETWEEN #{mincenterXGd} AND #{maxcenterXGd}
  840. </if>
  841. <if test="maxcenterYGd != null and maxcenterYGd != '' and mincenterYGd != null and mincenterYGd != ''">and
  842. FOR_QUE.gdY BETWEEN #{mincenterYGd} AND #{maxcenterYGd}
  843. </if>
  844. <if test="engScal != null and engScal != ''">and FOR_QUE.ENG_SCAL = #{engScal}</if>
  845. <if test="rsName != null and rsName != ''">and FOR_QUE.NM like CONCAT('%',CONCAT(#{rsName}, '%'))</if>
  846. <if test="adCode != null and adCode != ''">and FOR_QUE.ad_code like CONCAT('%',CONCAT(#{adCode}, '%'))</if>
  847. <if test="displayLevel != null and displayLevel != ''">
  848. AND to_number(FOR_QUE.DISPLAY_LEVEL) &lt;= to_number(#{displayLevel})
  849. </if>
  850. </select>
  851. <update id="updateList" parameterType="java.util.List">
  852. <foreach collection="list" index="index" item="item" open="begin" close=";end;" separator=";">
  853. UPDATE ATT_RS_BASE
  854. <set>
  855. build_stat = '2'
  856. </set>
  857. <where>
  858. RS_CODE = #{item.rsCode}
  859. </where>
  860. </foreach>
  861. </update>
  862. <select id="getRsMlList" resultType="java.util.HashMap" parameterType="java.util.HashMap">
  863. SELECT * FROM ATT_RS_BASE_ML
  864. WHERE 1=1 and RS_CODE is null
  865. <if test="num != null and num != ''">and to_number(NUM) &lt;=#{num}</if>
  866. <if test="proNm != null and proNm != ''">and PRO_NM like CONCAT('%',CONCAT(#{proNm}, '%'))</if>
  867. <if test="proCd != null and proCd != ''">and PRO_CD = #{proCd}</if>
  868. <if test="countyNm != null and countyNm != ''">and COUNTY_NM like CONCAT('%',CONCAT(#{countyNm}, '%'))</if>
  869. <if test="countyCd != null and countyCd != ''">and COUNTY_CD = #{countyCd}</if>
  870. <if test="rsName != null and rsName != ''">and RS_NAME like CONCAT('%',CONCAT(#{rsName}, '%'))</if>
  871. <if test="rsCode != null and rsCode != ''">and RS_CODE = #{rsCode}</if>
  872. order by to_number(num)
  873. </select>
  874. <update id="updateRsMl" parameterType="java.util.HashMap">
  875. update ATT_RS_BASE_ML
  876. <trim prefix="set" suffixOverrides=",">
  877. <if test="PRO_NM != null and PRO_NM != ''">PRO_NM = #{PRO_NM},</if>
  878. <if test="PRO_CD != null and PRO_CD != ''">PRO_CD = #{PRO_CD},</if>
  879. <if test="COUNTY_NM != null and COUNTY_NM != ''">COUNTY_NM = #{COUNTY_NM},</if>
  880. <if test="COUNTY_CD != null and COUNTY_CD != ''">COUNTY_CD = #{COUNTY_CD},</if>
  881. <if test="RS_NAME != null and RS_NAME != ''">RS_NAME = #{RS_NAME},</if>
  882. <if test="RS_CODE != null and RS_CODE != ''">RS_CODE = #{RS_CODE},</if>
  883. </trim>
  884. WHERE NUM = #{NUM}
  885. </update>
  886. <select id="findRsZbList" resultType="java.util.HashMap" parameterType="java.util.HashMap">
  887. SELECT * FROM ATT_RS_BASE_ZB
  888. WHERE 1=1
  889. <if test="RS_NAME != null and RS_NAME != ''">and RS_NAME like '%${RS_NAME}%'</if>
  890. <if test="ADDVCD != null and ADDVCD != ''">and ADDVCD like #{ADDVCD}||'%'</if>
  891. <if test="ADDVNM4 != null and ADDVNM4 != ''">and ADDVNM4 like '%${ADDVNM4}%'</if>
  892. </select>
  893. <update id="updateBatchProvincial" parameterType="cn.com.goldenwater.dcproj.param.AttRsBaseParam">
  894. update ATT_RS_BASE set PROVINCIAL = #{provincial}
  895. where RS_CODE in
  896. <foreach item="rsCode" collection="rsCodes" open="(" separator="," close=")">
  897. #{rsCode}
  898. </foreach>
  899. </update>
  900. <update id="updateRegCodeByCode" parameterType="cn.com.goldenwater.dcproj.model.AttRsBase">
  901. update ATT_RS_BASE
  902. set REG_CODE = #{regCode} ,UPTM = #{uptm}
  903. where RS_CODE = #{rsCode}
  904. </update>
  905. </mapper>