d380a78af94d07301e5d8e976e2df120e0c60ce4.svn-base 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654
  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.BisInspRslkbkRgstrDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.BisInspRslkbkRgstr" id="bisInspRslkbkRgstrResultMap">
  5. <result property="rsName" column="RS_NAME"/>
  6. <result property="hasDamRegCode" column="HAS_DAM_REG_CODE"/>
  7. <result property="damRegCode" column="DAM_REG_CODE"/>
  8. <result property="adCode" column="AD_CODE"/>
  9. <result property="location" column="LOCATION"/>
  10. <result property="hystSite" column="HYST_SITE"/>
  11. <result property="centerX" column="CENTER_X"/>
  12. <result property="centerY" column="CENTER_Y"/>
  13. <result property="gdX" column="GD_X"/>
  14. <result property="gdY" column="GD_Y"/>
  15. <result property="rsAdmCode" column="RS_ADM_CODE"/>
  16. <result property="rsAdmName" column="RS_ADM_NAME"/>
  17. <result property="engScal" column="ENG_SCAL"/>
  18. <result property="rsClass" column="RS_CLASS"/>
  19. <result property="damType" column="DAM_TYPE"/>
  20. <result property="totCap" column="TOT_CAP"/>
  21. <result property="damSizeHig" column="DAM_SIZE_HIG"/>
  22. <result property="desFlStag" column="DES_FL_STAG"/>
  23. <result property="flConTopStag" column="FL_CON_TOP_STAG"/>
  24. <result property="impdDt" column="IMPD_DT"/>
  25. <result property="rnfcImpdDt" column="RNFC_IMPD_DT"/>
  26. <result property="resCreateTime" column="RES_CREATE_TIME"/>
  27. <result property="groupLeader" column="GROUP_LEADER"/>
  28. <result property="groupLeaderTel" column="GROUP_LEADER_TEL"/>
  29. <result property="recPersId" column="REC_PERS_ID"/>
  30. <result property="recPers" column="REC_PERS"/>
  31. <result property="recPersTel" column="REC_PERS_TEL"/>
  32. <result property="intm" column="INTM"/>
  33. <result property="uptm" column="UPTM"/>
  34. <result property="note" column="NOTE"/>
  35. <result property="state" column="STATE"/>
  36. <result property="dataStat" column="DATA_STAT"/>
  37. <result property="isAction" column="IS_ACTION"/>
  38. <result property="inspType" column="INSP_TYPE"/>
  39. <result property="isSaf" column="IS_SAF"/>
  40. <result property="id" column="ID"/>
  41. <result property="objId" column="OBJ_ID"/>
  42. <result property="rsCode" column="RS_CODE"/>
  43. <result property="normz" column="NORMZ"/>
  44. <result property="fsltdz" column="FSLTDZ"/>
  45. </resultMap>
  46. <sql id="table_columns">
  47. RS_NAME,
  48. HAS_DAM_REG_CODE,
  49. DAM_REG_CODE,
  50. AD_CODE,
  51. LOCATION,
  52. HYST_SITE,
  53. CENTER_X,
  54. CENTER_Y,
  55. GD_X,
  56. GD_Y,
  57. RS_ADM_CODE,
  58. RS_ADM_NAME,
  59. ENG_SCAL,
  60. RS_CLASS,
  61. DAM_TYPE,
  62. TOT_CAP,
  63. DAM_SIZE_HIG,
  64. DES_FL_STAG,
  65. FL_CON_TOP_STAG,
  66. IMPD_DT,
  67. RNFC_IMPD_DT,
  68. RES_CREATE_TIME,
  69. GROUP_LEADER,
  70. GROUP_LEADER_TEL,
  71. REC_PERS_ID,
  72. REC_PERS,
  73. REC_PERS_TEL,
  74. INTM,
  75. UPTM,
  76. NOTE,
  77. STATE,
  78. DATA_STAT,
  79. IS_ACTION,
  80. INSP_TYPE,
  81. IS_SAF,
  82. ID,
  83. OBJ_ID,
  84. NORMZ,
  85. FSLTDZ,
  86. RS_CODE
  87. </sql>
  88. <sql id="entity_properties">
  89. #{rsName},
  90. #{hasDamRegCode},
  91. #{damRegCode},
  92. #{adCode},
  93. #{location},
  94. #{hystSite},
  95. #{centerX},
  96. #{centerY},
  97. #{gdX},
  98. #{gdY},
  99. #{rsAdmCode},
  100. #{rsAdmName},
  101. #{engScal},
  102. #{rsClass},
  103. #{damType},
  104. #{totCap},
  105. #{damSizeHig},
  106. #{desFlStag},
  107. #{flConTopStag},
  108. #{impdDt},
  109. #{rnfcImpdDt},
  110. #{resCreateTime},
  111. #{groupLeader},
  112. #{groupLeaderTel},
  113. #{recPersId},
  114. #{recPers},
  115. #{recPersTel},
  116. #{intm},
  117. #{uptm},
  118. #{note},
  119. #{state},
  120. #{dataStat},
  121. #{isAction},
  122. #{inspType},
  123. #{isSaf},
  124. #{id},
  125. #{objId},
  126. #{normz},
  127. #{fsltdz},
  128. #{rsCode}
  129. </sql>
  130. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  131. <sql id="page_where">
  132. <trim prefix="where" prefixOverrides="and | or ">
  133. <if test="normz != null and normz != ''">and NORMZ = #{normz}</if>
  134. <if test="fsltdz != null and fsltdz != ''">and FSLTDZ = #{fsltdz}</if>
  135. <if test="rsName != null and rsName != ''">
  136. and RS_NAME = #{rsName}
  137. </if>
  138. <if test="hasDamRegCode != null and hasDamRegCode != ''">
  139. and HAS_DAM_REG_CODE = #{hasDamRegCode}
  140. </if>
  141. <if test="damRegCode != null and damRegCode != ''">
  142. and DAM_REG_CODE = #{damRegCode}
  143. </if>
  144. <if test="adCode != null and adCode != ''">
  145. and AD_CODE = #{adCode}
  146. </if>
  147. <if test="location != null and location != ''">
  148. and LOCATION = #{location}
  149. </if>
  150. <if test="hystSite != null and hystSite != ''">
  151. and HYST_SITE = #{hystSite}
  152. </if>
  153. <if test="centerX != null and centerX != ''">
  154. and CENTER_X = #{centerX}
  155. </if>
  156. <if test="centerY != null and centerY != ''">
  157. and CENTER_Y = #{centerY}
  158. </if>
  159. <if test="gdX != null and gdX != ''">
  160. and GD_X = #{gdX}
  161. </if>
  162. <if test="gdY != null and gdY != ''">
  163. and GD_Y = #{gdY}
  164. </if>
  165. <if test="rsAdmCode != null and rsAdmCode != ''">
  166. and RS_ADM_CODE = #{rsAdmCode}
  167. </if>
  168. <if test="rsAdmName != null and rsAdmName != ''">
  169. and RS_ADM_NAME = #{rsAdmName}
  170. </if>
  171. <if test="engScal != null and engScal != ''">
  172. and ENG_SCAL = #{engScal}
  173. </if>
  174. <if test="rsClass != null and rsClass != ''">
  175. and RS_CLASS = #{rsClass}
  176. </if>
  177. <if test="damType != null and damType != ''">
  178. and DAM_TYPE = #{damType}
  179. </if>
  180. <if test="totCap != null and totCap != ''">
  181. and TOT_CAP = #{totCap}
  182. </if>
  183. <if test="damSizeHig != null and damSizeHig != ''">
  184. and DAM_SIZE_HIG = #{damSizeHig}
  185. </if>
  186. <if test="desFlStag != null and desFlStag != ''">
  187. and DES_FL_STAG = #{desFlStag}
  188. </if>
  189. <if test="flConTopStag != null and flConTopStag != ''">
  190. and FL_CON_TOP_STAG = #{flConTopStag}
  191. </if>
  192. <if test="impdDt != null">
  193. and IMPD_DT = #{impdDt}
  194. </if>
  195. <if test="rnfcImpdDt != null">
  196. and RNFC_IMPD_DT = #{rnfcImpdDt}
  197. </if>
  198. <if test="resCreateTime != null">
  199. and RES_CREATE_TIME = #{resCreateTime}
  200. </if>
  201. <if test="groupLeader != null and groupLeader != ''">
  202. and GROUP_LEADER = #{groupLeader}
  203. </if>
  204. <if test="groupLeaderTel != null and groupLeaderTel != ''">
  205. and GROUP_LEADER_TEL = #{groupLeaderTel}
  206. </if>
  207. <if test="recPersId != null and recPersId != ''">
  208. and REC_PERS_ID = #{recPersId}
  209. </if>
  210. <if test="recPers != null and recPers != ''">
  211. and REC_PERS = #{recPers}
  212. </if>
  213. <if test="recPersTel != null and recPersTel != ''">
  214. and REC_PERS_TEL = #{recPersTel}
  215. </if>
  216. <if test="intm != null">
  217. and INTM = #{intm}
  218. </if>
  219. <if test="uptm != null">
  220. and UPTM = #{uptm}
  221. </if>
  222. <if test="note != null and note != ''">
  223. and NOTE = #{note}
  224. </if>
  225. <if test="state != null and state != ''">
  226. and STATE = #{state}
  227. </if>
  228. <if test="dataStat != null and dataStat != ''">
  229. and DATA_STAT = #{dataStat}
  230. </if>
  231. <if test="isAction != null and isAction != ''">
  232. and IS_ACTION = #{isAction}
  233. </if>
  234. <if test="inspType != null and inspType != ''">
  235. and INSP_TYPE = #{inspType}
  236. </if>
  237. <if test="isSaf != null and isSaf != ''">
  238. and IS_SAF = #{isSaf}
  239. </if>
  240. <if test="objId != null and objId != ''">
  241. and OBJ_ID = #{objId}
  242. </if>
  243. <if test="rsCode != null and rsCode != ''">
  244. and RS_CODE = #{rsCode}
  245. </if>
  246. and DATA_STAT='0'
  247. </trim>
  248. </sql>
  249. <select id="get" resultMap="bisInspRslkbkRgstrResultMap" parameterType="String">
  250. select
  251. <include refid="table_columns"/>
  252. from BIS_INSP_RSLKBK_RGSTR where ID = #{id}
  253. </select>
  254. <select id="getBy" resultMap="bisInspRslkbkRgstrResultMap">
  255. select
  256. <include refid="table_columns"/>
  257. from BIS_INSP_RSLKBK_RGSTR
  258. <include refid="page_where"/>
  259. </select>
  260. <select id="findAll" resultMap="bisInspRslkbkRgstrResultMap">
  261. select
  262. <include refid="table_columns"/>
  263. from BIS_INSP_RSLKBK_RGSTR
  264. </select>
  265. <select id="findList" resultMap="bisInspRslkbkRgstrResultMap">
  266. select
  267. <include refid="table_columns"/>
  268. from BIS_INSP_RSLKBK_RGSTR
  269. <include refid="page_where"/>
  270. </select>
  271. <select id="selectCount" resultType="int">
  272. select count(ID) from BIS_INSP_RSLKBK_RGSTR
  273. <include refid="page_where"/>
  274. </select>
  275. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.BisInspRslkbkRgstr">
  276. insert into BIS_INSP_RSLKBK_RGSTR(
  277. <include refid="table_columns"/>
  278. )
  279. values (
  280. <include refid="entity_properties"/>
  281. )
  282. </insert>
  283. <delete id="delete" parameterType="java.lang.String">
  284. update BIS_INSP_RSLKBK_RGSTR set DATA_STAT='9' where ID = #{id}
  285. </delete>
  286. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspRslkbkRgstr">
  287. update BIS_INSP_RSLKBK_RGSTR set DATA_STAT='9'
  288. <include refid="page_where"/>
  289. </delete>
  290. <update id="deleteInFlag" parameterType="java.lang.String">
  291. update BIS_INSP_RSLKBK_RGSTR set DATA_STAT = '9' where ID = #{id}
  292. </update>
  293. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.BisInspRslkbkRgstr">
  294. update BIS_INSP_RSLKBK_RGSTR
  295. <trim prefix="set" suffixOverrides=",">
  296. <if test="normz != null and normz != ''">NORMZ = #{normz},</if>
  297. <if test="fsltdz != null and fsltdz != ''">FSLTDZ = #{fsltdz},</if>
  298. <if test="rsName != null and rsName != ''">RS_NAME
  299. = #{rsName},
  300. </if>
  301. <if test="hasDamRegCode != null and hasDamRegCode != ''">HAS_DAM_REG_CODE
  302. = #{hasDamRegCode},
  303. </if>
  304. <if test="damRegCode != null and damRegCode != ''">DAM_REG_CODE
  305. = #{damRegCode},
  306. </if>
  307. <if test="adCode != null and adCode != ''">AD_CODE
  308. = #{adCode},
  309. </if>
  310. <if test="location != null and location != ''">LOCATION
  311. = #{location},
  312. </if>
  313. <if test="hystSite != null and hystSite != ''">HYST_SITE
  314. = #{hystSite},
  315. </if>
  316. <if test="centerX != null and centerX != ''">CENTER_X
  317. = #{centerX},
  318. </if>
  319. <if test="centerY != null and centerY != ''">CENTER_Y
  320. = #{centerY},
  321. </if>
  322. <if test="gdX != null and gdX != ''">GD_X
  323. = #{gdX},
  324. </if>
  325. <if test="gdY != null and gdY != ''">GD_Y
  326. = #{gdY},
  327. </if>
  328. <if test="rsAdmCode != null and rsAdmCode != ''">RS_ADM_CODE
  329. = #{rsAdmCode},
  330. </if>
  331. <if test="rsAdmName != null and rsAdmName != ''">RS_ADM_NAME
  332. = #{rsAdmName},
  333. </if>
  334. <if test="engScal != null and engScal != ''">ENG_SCAL
  335. = #{engScal},
  336. </if>
  337. <if test="rsClass != null and rsClass != ''">RS_CLASS
  338. = #{rsClass},
  339. </if>
  340. <if test="damType != null and damType != ''">DAM_TYPE
  341. = #{damType},
  342. </if>
  343. <if test="totCap != null and totCap != ''">TOT_CAP
  344. = #{totCap},
  345. </if>
  346. <if test="damSizeHig != null and damSizeHig != ''">DAM_SIZE_HIG
  347. = #{damSizeHig},
  348. </if>
  349. <if test="desFlStag != null and desFlStag != ''">DES_FL_STAG
  350. = #{desFlStag},
  351. </if>
  352. <if test="flConTopStag != null and flConTopStag != ''">FL_CON_TOP_STAG
  353. = #{flConTopStag},
  354. </if>
  355. <if test="impdDt != null">IMPD_DT
  356. = #{impdDt},
  357. </if>
  358. <if test="rnfcImpdDt != null">RNFC_IMPD_DT
  359. = #{rnfcImpdDt},
  360. </if>
  361. <if test="resCreateTime != null">RES_CREATE_TIME
  362. = #{resCreateTime},
  363. </if>
  364. <if test="groupLeader != null and groupLeader != ''">GROUP_LEADER
  365. = #{groupLeader},
  366. </if>
  367. <if test="groupLeaderTel != null and groupLeaderTel != ''">GROUP_LEADER_TEL
  368. = #{groupLeaderTel},
  369. </if>
  370. <if test="recPersId != null and recPersId != ''">REC_PERS_ID
  371. = #{recPersId},
  372. </if>
  373. <if test="recPers != null and recPers != ''">REC_PERS
  374. = #{recPers},
  375. </if>
  376. <if test="recPersTel != null and recPersTel != ''">REC_PERS_TEL
  377. = #{recPersTel},
  378. </if>
  379. <if test="intm != null">INTM
  380. = #{intm},
  381. </if>
  382. <if test="uptm != null">UPTM
  383. = #{uptm},
  384. </if>
  385. <if test="note != null and note != ''">NOTE
  386. = #{note},
  387. </if>
  388. <if test="state != null and state != ''">STATE
  389. = #{state},
  390. </if>
  391. <if test="dataStat != null and dataStat != ''">DATA_STAT
  392. = #{dataStat},
  393. </if>
  394. <if test="isAction != null and isAction != ''">IS_ACTION
  395. = #{isAction},
  396. </if>
  397. <if test="inspType != null and inspType != ''">INSP_TYPE
  398. = #{inspType},
  399. </if>
  400. <if test="isSaf != null and isSaf != ''">IS_SAF
  401. = #{isSaf},
  402. </if>
  403. <if test="objId != null and objId != ''">OBJ_ID
  404. = #{objId},
  405. </if>
  406. <if test="rsCode != null and rsCode != ''">RS_CODE
  407. = #{rsCode},
  408. </if>
  409. </trim>
  410. <where>ID = #{id}</where>
  411. </update>
  412. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspRslkbkRgstr">
  413. update BIS_INSP_RSLKBK_RGSTR
  414. <trim prefix="set" suffixOverrides=",">
  415. <if test="normz != null and normz != ''">NORMZ = #{normz},</if>
  416. <if test="fsltdz != null and fsltdz != ''">FSLTDZ = #{fsltdz},</if>
  417. <if test="rsName != null and rsName != ''">RS_NAME
  418. = #{rsName},
  419. </if>
  420. <if test="hasDamRegCode != null and hasDamRegCode != ''">HAS_DAM_REG_CODE
  421. = #{hasDamRegCode},
  422. </if>
  423. <if test="damRegCode != null and damRegCode != ''">DAM_REG_CODE
  424. = #{damRegCode},
  425. </if>
  426. <if test="adCode != null and adCode != ''">AD_CODE
  427. = #{adCode},
  428. </if>
  429. <if test="location != null and location != ''">LOCATION
  430. = #{location},
  431. </if>
  432. <if test="hystSite != null and hystSite != ''">HYST_SITE
  433. = #{hystSite},
  434. </if>
  435. <if test="centerX != null and centerX != ''">CENTER_X
  436. = #{centerX},
  437. </if>
  438. <if test="centerY != null and centerY != ''">CENTER_Y
  439. = #{centerY},
  440. </if>
  441. <if test="gdX != null and gdX != ''">GD_X
  442. = #{gdX},
  443. </if>
  444. <if test="gdY != null and gdY != ''">GD_Y
  445. = #{gdY},
  446. </if>
  447. <if test="rsAdmCode != null and rsAdmCode != ''">RS_ADM_CODE
  448. = #{rsAdmCode},
  449. </if>
  450. <if test="rsAdmName != null and rsAdmName != ''">RS_ADM_NAME
  451. = #{rsAdmName},
  452. </if>
  453. <if test="engScal != null and engScal != ''">ENG_SCAL
  454. = #{engScal},
  455. </if>
  456. <if test="rsClass != null and rsClass != ''">RS_CLASS
  457. = #{rsClass},
  458. </if>
  459. <if test="damType != null and damType != ''">DAM_TYPE
  460. = #{damType},
  461. </if>
  462. <if test="totCap != null and totCap != ''">TOT_CAP
  463. = #{totCap},
  464. </if>
  465. <if test="damSizeHig != null and damSizeHig != ''">DAM_SIZE_HIG
  466. = #{damSizeHig},
  467. </if>
  468. <if test="desFlStag != null and desFlStag != ''">DES_FL_STAG
  469. = #{desFlStag},
  470. </if>
  471. <if test="flConTopStag != null and flConTopStag != ''">FL_CON_TOP_STAG
  472. = #{flConTopStag},
  473. </if>
  474. <if test="impdDt != null">IMPD_DT
  475. = #{impdDt},
  476. </if>
  477. <if test="rnfcImpdDt != null">RNFC_IMPD_DT
  478. = #{rnfcImpdDt},
  479. </if>
  480. <if test="resCreateTime != null">RES_CREATE_TIME
  481. = #{resCreateTime},
  482. </if>
  483. <if test="groupLeader != null and groupLeader != ''">GROUP_LEADER
  484. = #{groupLeader},
  485. </if>
  486. <if test="groupLeaderTel != null and groupLeaderTel != ''">GROUP_LEADER_TEL
  487. = #{groupLeaderTel},
  488. </if>
  489. <if test="recPersId != null and recPersId != ''">REC_PERS_ID
  490. = #{recPersId},
  491. </if>
  492. <if test="recPers != null and recPers != ''">REC_PERS
  493. = #{recPers},
  494. </if>
  495. <if test="recPersTel != null and recPersTel != ''">REC_PERS_TEL
  496. = #{recPersTel},
  497. </if>
  498. <if test="intm != null">INTM
  499. = #{intm},
  500. </if>
  501. <if test="uptm != null">UPTM
  502. = #{uptm},
  503. </if>
  504. <if test="note != null and note != ''">NOTE
  505. = #{note},
  506. </if>
  507. <if test="state != null and state != ''">STATE
  508. = #{state},
  509. </if>
  510. <if test="dataStat != null and dataStat != ''">DATA_STAT
  511. = #{dataStat},
  512. </if>
  513. <if test="isAction != null and isAction != ''">IS_ACTION
  514. = #{isAction},
  515. </if>
  516. <if test="inspType != null and inspType != ''">INSP_TYPE
  517. = #{inspType},
  518. </if>
  519. <if test="isSaf != null and isSaf != ''">IS_SAF
  520. = #{isSaf},
  521. </if>
  522. <if test="objId != null and objId != ''">OBJ_ID
  523. = #{objId},
  524. </if>
  525. <if test="rsCode != null and rsCode != ''">RS_CODE
  526. = #{rsCode},
  527. </if>
  528. </trim>
  529. <include refid="page_where"/>
  530. </update>
  531. <!-- 其他自定义SQL -->
  532. <select id="findPageList" resultType="cn.com.goldenwater.dcproj.dto.BisInspRslkbkRgstrDto">
  533. SELECT * FROM (
  534. select
  535. A.CODE, A.ID AS nodeId, A.NM, A.PTYPE, A.OBJ_ID, IA.PNM AS groupName,
  536. B.ID AS rgstrId, AW.AD_FULL_NAME,
  537. (CASE WHEN B.STATE IS NULL THEN '0' ELSE B.STATE END) STATE,
  538. B.RS_NAME,
  539. B.HAS_DAM_REG_CODE,
  540. B.DAM_REG_CODE,
  541. B.AD_CODE,
  542. B.LOCATION,
  543. B.HYST_SITE,
  544. B.CENTER_X,
  545. B.CENTER_Y,
  546. B.GD_X,
  547. B.GD_Y,
  548. B.RS_ADM_CODE,
  549. B.RS_ADM_NAME,
  550. B.ENG_SCAL,
  551. B.RS_CLASS,
  552. B.DAM_TYPE,
  553. B.TOT_CAP,
  554. B.DAM_SIZE_HIG,
  555. B.DES_FL_STAG,
  556. B.FL_CON_TOP_STAG,
  557. B.IMPD_DT,
  558. B.RNFC_IMPD_DT,
  559. B.RES_CREATE_TIME,
  560. B.GROUP_LEADER,
  561. B.GROUP_LEADER_TEL,
  562. B.REC_PERS_ID,
  563. B.REC_PERS,
  564. B.REC_PERS_TEL,
  565. B.INTM,
  566. B.UPTM,
  567. B.NOTE,
  568. B.DATA_STAT,
  569. B.IS_ACTION,
  570. B.INSP_TYPE,
  571. B.IS_SAF,
  572. B.ID,
  573. B.NORMZ,
  574. B.FSLTDZ,
  575. B.RS_CODE
  576. FROM BIS_INSP_ALL_OBJ A
  577. JOIN BIS_INSP_RSLKBK_RGSTR B ON A.OBJ_ID=B.OBJ_ID
  578. LEFT JOIN BIS_INSP_ALL IA ON A.ID = IA.ID
  579. LEFT JOIN ATT_AD_BASE AW ON B.AD_CODE = AW.AD_CODE
  580. where B.DATA_STAT='0'
  581. <if test="adCodes ==null or adCodes ==''">
  582. <choose>
  583. <when test='isAll =="1"'>
  584. </when>
  585. <otherwise>
  586. and
  587. A.Id in (
  588. select distinct id from (
  589. SELECT P.id FROM BIS_INSP_ALL P START WITH P.PID IN (SELECT id FROM BIS_INSP_ALL_RLATION A
  590. WHERE A.PERSID = #{presId} and TYPE = #{pType} and length(id) in (3,6,9))
  591. CONNECT BY P.PID = PRIOR P.ID
  592. union all
  593. SELECT P.id FROM BIS_INSP_ALL P where p.id in (SELECT id FROM BIS_INSP_ALL_RLATION A
  594. WHERE A.PERSID =#{presId} and TYPE = #{pType} and length(id)=12 )
  595. )
  596. )
  597. </otherwise>
  598. </choose>
  599. </if>
  600. <if test="adCodes !=null and adCodes !=''">
  601. and
  602. <foreach item="item" index="index" collection="adCodes.split(',')" open="(" separator="or" close=")">
  603. b.ad_code like concat('${item}','%')
  604. </foreach>
  605. </if>
  606. <if test="province != null and province != ''">and B.AD_CODE LIKE '%' || #{province} || '%' </if>
  607. <if test="tabType =='2'.toString()">
  608. AND IA.ENTM &lt; TO_DATE(#{nowTime},'yyyy-MM-dd')+1
  609. </if>
  610. <if test="tabType =='1'.toString()">
  611. AND IA.ENTM &gt;= TO_DATE(#{nowTime},'yyyy-MM-dd')
  612. </if>
  613. ) A
  614. <where>
  615. <if test="id !=null and id !=''">and a.nodeId like '${id}%'</if>
  616. <if test="plnaId !=null and plnaId !=''">and a.nodeId like '${plnaId}%'</if>
  617. <if test="state !=null and state !=''">and STATE in (${state})</if>
  618. <if test="rsName !=null and rsName !=''">and a.nm like '%${rsName}%'</if>
  619. <if test="code !=null and code !=''">and a.code = #{code}</if>
  620. <if test="adName != null and adName != ''">and a.AD_FULL_NAME like '%${adName}%'</if>
  621. <if test="sttm != null and sttm != ''">and a.Intm&gt;= TO_DATE(#{sttm},'YYYY-MM-DD')</if>
  622. <if test="entm != null and entm != ''">and a.Intm &lt; To_DATE(#{entm},'yyyy-MM-dd') + 1</if>
  623. <if test="groupId != null and groupId != ''">and a.nodeId = #{groupId}</if>
  624. <if test="groupIds != null and groupIds.length &gt; 0">
  625. <foreach collection="groupIds" index="index" item="gId" separator=" OR " open="and (" close=")">
  626. a.nodeId LIKE '${gId}%'
  627. </foreach>
  628. </if>
  629. </where>
  630. order by nodeId asc
  631. <if test="orderBy != null and orderBy != ''">
  632. ,nlssort(nm,'NLS_SORT=SCHINESE_PINYIN_M')
  633. </if>
  634. </select>
  635. </mapper>