8f0def949e961db62c5f435c1ea85e3eae43ada2.svn-base 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712
  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.BisInspStstnDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.BisInspStstn" id="bisInspStstnResultMap">
  5. <result property="sceneScore" column="SCENE_SCORE"/>
  6. <result property="safTotal" column="SAF_TOTAL"/>
  7. <result property="tmprTotal" column="TMPR_TOTAL"/>
  8. <result property="sceneTotal" column="SCENE_TOTAL"/>
  9. <result property="persId" column="PERS_ID"/>
  10. <result property="actualScore" column="ACTUAL_SCORE"/>
  11. <result property="total" column="TOTAL"/>
  12. <result property="safScore" column="SAF_SCORE"/>
  13. <result property="tmprScore" column="TMPR_SCORE"/>
  14. <result property="id" column="ID"/>
  15. <result property="ststnId" column="STSTN_ID"/>
  16. <result property="objId" column="OBJ_ID"/>
  17. <result property="nm" column="NM"/>
  18. <result property="adCode" column="AD_CODE"/>
  19. <result property="adName" column="AD_NAME"/>
  20. <result property="loc" column="LOC"/>
  21. <result property="prjcType" column="PRJC_TYPE"/>
  22. <result property="cost" column="COST"/>
  23. <result property="costYear" column="COST_YEAR"/>
  24. <result property="mgr" column="MGR"/>
  25. <result property="owner" column="OWNER"/>
  26. <result property="quality" column="QUALITY"/>
  27. <result property="design" column="DESIGN"/>
  28. <result property="supervisor" column="SUPERVISOR"/>
  29. <result property="build" column="BUILD"/>
  30. <result property="prjcPers" column="PRJC_PERS"/>
  31. <result property="prjcPresTel" column="PRJC_PRES_TEL"/>
  32. <result property="state" column="STATE"/>
  33. <result property="sceneState" column="SCENE_STATE"/>
  34. <result property="tmprState" column="TMPR_STATE"/>
  35. <result property="safState" column="SAF_STATE"/>
  36. <result property="pbState" column="PB_STATE"/>
  37. <result property="pbTotal" column="PB_TOTAL"/>
  38. <result property="pbScore" column="PB_SCORE"/>
  39. <result property="standardScore" column="STANDARD_SCORE"/>
  40. <result property="standardTotal" column="STANDARD_TOTAL"/>
  41. <result property="centerX" column="CENTER_X"/>
  42. <result property="centerY" column="CENTER_Y"/>
  43. <result property="gdX" column="GD_X"/>
  44. <result property="gdY" column="GD_Y"/>
  45. <result property="note" column="NOTE"/>
  46. <result property="intm" column="INTM"/>
  47. <result property="uptm" column="UPTM"/>
  48. <result property="dataStat" column="DATA_STAT"/>
  49. </resultMap>
  50. <sql id="table_columns">
  51. SCENE_SCORE,
  52. SAF_TOTAL,
  53. TMPR_TOTAL,
  54. SCENE_TOTAL,
  55. PERS_ID,
  56. ACTUAL_SCORE,
  57. TOTAL,
  58. SAF_SCORE,
  59. TMPR_SCORE,
  60. ID,
  61. STSTN_ID,
  62. OBJ_ID,
  63. NM,
  64. AD_CODE,
  65. AD_NAME,
  66. LOC,
  67. PRJC_TYPE,
  68. COST,
  69. COST_YEAR,
  70. MGR,
  71. OWNER,
  72. QUALITY,
  73. DESIGN,
  74. SUPERVISOR,
  75. BUILD,
  76. PRJC_PERS,
  77. PRJC_PRES_TEL,
  78. STATE,
  79. SCENE_STATE,
  80. TMPR_STATE,
  81. SAF_STATE,
  82. PB_STATE,
  83. PB_TOTAL,
  84. PB_SCORE,
  85. STANDARD_SCORE,
  86. CENTER_X,
  87. CENTER_Y,
  88. GD_X,
  89. GD_Y,
  90. NOTE,
  91. INTM,
  92. UPTM,
  93. DATA_STAT
  94. </sql>
  95. <sql id="entity_properties">
  96. #{sceneScore},
  97. #{safTotal},
  98. #{tmprTotal},
  99. #{sceneTotal},
  100. #{persId},
  101. #{actualScore},
  102. #{total},
  103. #{safScore},
  104. #{tmprScore},
  105. #{id},
  106. #{ststnId},
  107. #{objId},
  108. #{nm},
  109. #{adCode},
  110. #{adName},
  111. #{loc},
  112. #{prjcType},
  113. #{cost},
  114. #{costYear},
  115. #{mgr},
  116. #{owner},
  117. #{quality},
  118. #{design},
  119. #{supervisor},
  120. #{build},
  121. #{prjcPers},
  122. #{prjcPresTel},
  123. #{state},
  124. #{sceneState},
  125. #{tmprState},
  126. #{safState},
  127. #{pbState},
  128. #{pbTotal},
  129. #{pbScore},
  130. #{standardScore},
  131. #{centerX},
  132. #{centerY},
  133. #{gdX},
  134. #{gdY},
  135. #{note},
  136. #{intm},
  137. #{uptm},
  138. #{dataStat}
  139. </sql>
  140. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  141. <sql id="page_where">
  142. <trim prefix="where" prefixOverrides="and | or ">
  143. <if test="sceneScore != null and sceneScore != ''">
  144. and SCENE_SCORE = #{sceneScore}
  145. </if>
  146. <if test="safTotal != null and safTotal != ''">
  147. and SAF_TOTAL = #{safTotal}
  148. </if>
  149. <if test="tmprTotal != null and tmprTotal != ''">
  150. and TMPR_TOTAL = #{tmprTotal}
  151. </if>
  152. <if test="sceneTotal != null and sceneTotal != ''">
  153. and SCENE_TOTAL = #{sceneTotal}
  154. </if>
  155. <if test="persId != null and persId != ''">
  156. and PERS_ID = #{persId}
  157. </if>
  158. <if test="actualScore != null and actualScore != ''">
  159. and ACTUAL_SCORE = #{actualScore}
  160. </if>
  161. <if test="total != null and total != ''">
  162. and TOTAL = #{total}
  163. </if>
  164. <if test="safScore != null and safScore != ''">
  165. and SAF_SCORE = #{safScore}
  166. </if>
  167. <if test="tmprScore != null and tmprScore != ''">
  168. and TMPR_SCORE = #{tmprScore}
  169. </if>
  170. <if test="ststnId != null and ststnId != ''">
  171. and STSTN_ID = #{ststnId}
  172. </if>
  173. <if test="objId != null and objId != ''">
  174. and OBJ_ID = #{objId}
  175. </if>
  176. <if test="nm != null and nm != ''">
  177. and NM = #{nm}
  178. </if>
  179. <if test="adCode != null and adCode != ''">
  180. and AD_CODE = #{adCode}
  181. </if>
  182. <if test="adName != null and adName != ''">
  183. and AD_NAME = #{adName}
  184. </if>
  185. <if test="loc != null and loc != ''">
  186. and LOC = #{loc}
  187. </if>
  188. <if test="prjcType != null and prjcType != ''">
  189. and PRJC_TYPE = #{prjcType}
  190. </if>
  191. <if test="cost != null and cost != ''">
  192. and COST = #{cost}
  193. </if>
  194. <if test="costYear != null and costYear != ''">
  195. and COST_YEAR = #{costYear}
  196. </if>
  197. <if test="mgr != null and mgr != ''">
  198. and MGR = #{mgr}
  199. </if>
  200. <if test="owner != null and owner != ''">
  201. and OWNER = #{owner}
  202. </if>
  203. <if test="quality != null and quality != ''">
  204. and QUALITY = #{quality}
  205. </if>
  206. <if test="design != null and design != ''">
  207. and DESIGN = #{design}
  208. </if>
  209. <if test="supervisor != null and supervisor != ''">
  210. and SUPERVISOR = #{supervisor}
  211. </if>
  212. <if test="build != null and build != ''">
  213. and BUILD = #{build}
  214. </if>
  215. <if test="prjcPers != null and prjcPers != ''">
  216. and PRJC_PERS = #{prjcPers}
  217. </if>
  218. <if test="prjcPresTel != null and prjcPresTel != ''">
  219. and PRJC_PRES_TEL = #{prjcPresTel}
  220. </if>
  221. <if test="state != null and state != ''">
  222. and STATE = #{state}
  223. </if>
  224. <if test="sceneState != null and sceneState != ''">
  225. and SCENE_STATE = #{sceneState}
  226. </if>
  227. <if test="tmprState != null and tmprState != ''">
  228. and TMPR_STATE = #{tmprState}
  229. </if>
  230. <if test="safState != null and safState != ''">
  231. and SAF_STATE = #{safState}
  232. </if>
  233. <if test="pbState != null and pbState != ''">
  234. and PB_STATE = #{pbState}
  235. </if>
  236. <if test="pbTotal != null and pbTotal != ''">
  237. and PB_TOTAL = #{pbTotal}
  238. </if>
  239. <if test="pbScore != null and pbScore != ''">
  240. and PB_SCORE = #{pbScore}
  241. </if>
  242. <if test="standardScore != null and standardScore != ''">
  243. and STANDARD_SCORE = #{standardScore}
  244. </if>
  245. <if test="centerX != null and centerX != ''">
  246. and CENTER_X = #{centerX}
  247. </if>
  248. <if test="centerY != null and centerY != ''">
  249. and CENTER_Y = #{centerY}
  250. </if>
  251. <if test="gdX != null and gdX != ''">
  252. and GD_X = #{gdX}
  253. </if>
  254. <if test="gdY != null and gdY != ''">
  255. and GD_Y = #{gdY}
  256. </if>
  257. <if test="note != null and note != ''">
  258. and NOTE = #{note}
  259. </if>
  260. <if test="intm != null">
  261. and INTM = #{intm}
  262. </if>
  263. <if test="uptm != null">
  264. and UPTM = #{uptm}
  265. </if>
  266. <if test="dataStat != null and dataStat != ''">
  267. and DATA_STAT = #{dataStat}
  268. </if>
  269. and DATA_STAT='0'
  270. </trim>
  271. </sql>
  272. <select id="get" resultMap="bisInspStstnResultMap" parameterType="String">
  273. select
  274. <include refid="table_columns"/>
  275. from BIS_INSP_STSTN where ID = #{id}
  276. </select>
  277. <select id="getBy" resultMap="bisInspStstnResultMap">
  278. select
  279. <include refid="table_columns"/>
  280. from BIS_INSP_STSTN
  281. <include refid="page_where"/>
  282. </select>
  283. <select id="findAll" resultMap="bisInspStstnResultMap">
  284. select
  285. <include refid="table_columns"/>
  286. from BIS_INSP_STSTN
  287. </select>
  288. <select id="findList" resultMap="bisInspStstnResultMap">
  289. select
  290. <include refid="table_columns"/>
  291. from BIS_INSP_STSTN
  292. <include refid="page_where"/>
  293. </select>
  294. <select id="selectCount" resultType="int">
  295. select count(ID) from BIS_INSP_STSTN
  296. <include refid="page_where"/>
  297. </select>
  298. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.BisInspStstn">
  299. insert into BIS_INSP_STSTN(
  300. <include refid="table_columns"/>
  301. )
  302. values (
  303. <include refid="entity_properties"/>
  304. )
  305. </insert>
  306. <delete id="delete" parameterType="java.lang.String">
  307. update BIS_INSP_STSTN set DATA_STAT='9' where ID = #{id}
  308. </delete>
  309. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspStstn">
  310. update BIS_INSP_STSTN set DATA_STAT='9'
  311. <include refid="page_where"/>
  312. </delete>
  313. <update id="deleteInFlag" parameterType="java.lang.String">
  314. update BIS_INSP_STSTN set DATA_STAT = '9' where ID = #{id}
  315. </update>
  316. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.BisInspStstn">
  317. update BIS_INSP_STSTN
  318. <trim prefix="set" suffixOverrides=",">
  319. <if test="sceneScore != null and sceneScore != ''">SCENE_SCORE
  320. = #{sceneScore},
  321. </if>
  322. <if test="safTotal != null and safTotal != ''">SAF_TOTAL
  323. = #{safTotal},
  324. </if>
  325. <if test="tmprTotal != null and tmprTotal != ''">TMPR_TOTAL
  326. = #{tmprTotal},
  327. </if>
  328. <if test="sceneTotal != null and sceneTotal != ''">SCENE_TOTAL
  329. = #{sceneTotal},
  330. </if>
  331. <if test="persId != null and persId != ''">PERS_ID
  332. = #{persId},
  333. </if>
  334. <if test="actualScore != null and actualScore != ''">ACTUAL_SCORE
  335. = #{actualScore},
  336. </if>
  337. <if test="total != null and total != ''">TOTAL
  338. = #{total},
  339. </if>
  340. <if test="safScore != null and safScore != ''">SAF_SCORE
  341. = #{safScore},
  342. </if>
  343. <if test="tmprScore != null and tmprScore != ''">TMPR_SCORE
  344. = #{tmprScore},
  345. </if>
  346. <if test="ststnId != null and ststnId != ''">STSTN_ID
  347. = #{ststnId},
  348. </if>
  349. <if test="objId != null and objId != ''">OBJ_ID
  350. = #{objId},
  351. </if>
  352. <if test="nm != null and nm != ''">NM
  353. = #{nm},
  354. </if>
  355. <if test="adCode != null and adCode != ''">AD_CODE
  356. = #{adCode},
  357. </if>
  358. <if test="adName != null and adName != ''">AD_NAME
  359. = #{adName},
  360. </if>
  361. <if test="loc != null and loc != ''">LOC
  362. = #{loc},
  363. </if>
  364. <if test="prjcType != null and prjcType != ''">PRJC_TYPE
  365. = #{prjcType},
  366. </if>
  367. <if test="cost != null and cost != ''">COST
  368. = #{cost},
  369. </if>
  370. <if test="costYear != null and costYear != ''">COST_YEAR
  371. = #{costYear},
  372. </if>
  373. <if test="mgr != null and mgr != ''">MGR
  374. = #{mgr},
  375. </if>
  376. <if test="owner != null and owner != ''">OWNER
  377. = #{owner},
  378. </if>
  379. <if test="quality != null and quality != ''">QUALITY
  380. = #{quality},
  381. </if>
  382. <if test="design != null and design != ''">DESIGN
  383. = #{design},
  384. </if>
  385. <if test="supervisor != null and supervisor != ''">SUPERVISOR
  386. = #{supervisor},
  387. </if>
  388. <if test="build != null and build != ''">BUILD
  389. = #{build},
  390. </if>
  391. <if test="prjcPers != null and prjcPers != ''">PRJC_PERS
  392. = #{prjcPers},
  393. </if>
  394. <if test="prjcPresTel != null and prjcPresTel != ''">PRJC_PRES_TEL
  395. = #{prjcPresTel},
  396. </if>
  397. <if test="state != null and state != ''">STATE
  398. = #{state},
  399. </if>
  400. <if test="sceneState != null and sceneState != ''">SCENE_STATE
  401. = #{sceneState},
  402. </if>
  403. <if test="tmprState != null and tmprState != ''">TMPR_STATE
  404. = #{tmprState},
  405. </if>
  406. <if test="safState != null and safState != ''">SAF_STATE
  407. = #{safState},
  408. </if>
  409. <if test="pbState != null and pbState != ''">PB_STATE = #{pbState},</if>
  410. <if test="pbTotal != null and pbTotal != ''">PB_TOTAL = #{pbTotal},</if>
  411. <if test="pbScore != null and pbScore != ''">PB_SCORE = #{pbScore},</if>
  412. <if test="standardScore != null and standardScore != ''">STANDARD_SCORE = #{standardScore},</if>
  413. <if test="centerX != null and centerX != ''">CENTER_X
  414. = #{centerX},
  415. </if>
  416. <if test="centerY != null and centerY != ''">CENTER_Y
  417. = #{centerY},
  418. </if>
  419. <if test="gdX != null and gdX != ''">GD_X
  420. = #{gdX},
  421. </if>
  422. <if test="gdY != null and gdY != ''">GD_Y
  423. = #{gdY},
  424. </if>
  425. <if test="note != null and note != ''">NOTE
  426. = #{note},
  427. </if>
  428. <if test="intm != null">INTM
  429. = #{intm},
  430. </if>
  431. <if test="uptm != null">UPTM
  432. = #{uptm},
  433. </if>
  434. <if test="dataStat != null and dataStat != ''">DATA_STAT
  435. = #{dataStat},
  436. </if>
  437. </trim>
  438. <where>ID = #{id}</where>
  439. </update>
  440. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspStstn">
  441. update BIS_INSP_STSTN
  442. <trim prefix="set" suffixOverrides=",">
  443. <if test="sceneScore != null and sceneScore != ''">SCENE_SCORE
  444. = #{sceneScore},
  445. </if>
  446. <if test="safTotal != null and safTotal != ''">SAF_TOTAL
  447. = #{safTotal},
  448. </if>
  449. <if test="tmprTotal != null and tmprTotal != ''">TMPR_TOTAL
  450. = #{tmprTotal},
  451. </if>
  452. <if test="sceneTotal != null and sceneTotal != ''">SCENE_TOTAL
  453. = #{sceneTotal},
  454. </if>
  455. <if test="persId != null and persId != ''">PERS_ID
  456. = #{persId},
  457. </if>
  458. <if test="actualScore != null and actualScore != ''">ACTUAL_SCORE
  459. = #{actualScore},
  460. </if>
  461. <if test="total != null and total != ''">TOTAL
  462. = #{total},
  463. </if>
  464. <if test="safScore != null and safScore != ''">SAF_SCORE
  465. = #{safScore},
  466. </if>
  467. <if test="tmprScore != null and tmprScore != ''">TMPR_SCORE
  468. = #{tmprScore},
  469. </if>
  470. <if test="ststnId != null and ststnId != ''">STSTN_ID
  471. = #{ststnId},
  472. </if>
  473. <if test="objId != null and objId != ''">OBJ_ID
  474. = #{objId},
  475. </if>
  476. <if test="nm != null and nm != ''">NM
  477. = #{nm},
  478. </if>
  479. <if test="adCode != null and adCode != ''">AD_CODE
  480. = #{adCode},
  481. </if>
  482. <if test="adName != null and adName != ''">AD_NAME
  483. = #{adName},
  484. </if>
  485. <if test="loc != null and loc != ''">LOC
  486. = #{loc},
  487. </if>
  488. <if test="prjcType != null and prjcType != ''">PRJC_TYPE
  489. = #{prjcType},
  490. </if>
  491. <if test="cost != null and cost != ''">COST
  492. = #{cost},
  493. </if>
  494. <if test="costYear != null and costYear != ''">COST_YEAR
  495. = #{costYear},
  496. </if>
  497. <if test="mgr != null and mgr != ''">MGR
  498. = #{mgr},
  499. </if>
  500. <if test="owner != null and owner != ''">OWNER
  501. = #{owner},
  502. </if>
  503. <if test="quality != null and quality != ''">QUALITY
  504. = #{quality},
  505. </if>
  506. <if test="design != null and design != ''">DESIGN
  507. = #{design},
  508. </if>
  509. <if test="supervisor != null and supervisor != ''">SUPERVISOR
  510. = #{supervisor},
  511. </if>
  512. <if test="build != null and build != ''">BUILD
  513. = #{build},
  514. </if>
  515. <if test="prjcPers != null and prjcPers != ''">PRJC_PERS
  516. = #{prjcPers},
  517. </if>
  518. <if test="prjcPresTel != null and prjcPresTel != ''">PRJC_PRES_TEL
  519. = #{prjcPresTel},
  520. </if>
  521. <if test="state != null and state != ''">STATE
  522. = #{state},
  523. </if>
  524. <if test="sceneState != null and sceneState != ''">SCENE_STATE
  525. = #{sceneState},
  526. </if>
  527. <if test="tmprState != null and tmprState != ''">TMPR_STATE
  528. = #{tmprState},
  529. </if>
  530. <if test="safState != null and safState != ''">SAF_STATE
  531. = #{safState},
  532. </if>
  533. <if test="pbState != null and pbState != ''">PB_STATE = #{pbState},</if>
  534. <if test="pbTotal != null and pbTotal != ''">PB_TOTAL = #{pbTotal},</if>
  535. <if test="pbScore != null and pbScore != ''">PB_SCORE = #{pbScore},</if>
  536. <if test="standardScore != null and standardScore != ''">STANDARD_SCORE = #{standardScore},</if>
  537. <if test="centerX != null and centerX != ''">CENTER_X
  538. = #{centerX},
  539. </if>
  540. <if test="centerY != null and centerY != ''">CENTER_Y
  541. = #{centerY},
  542. </if>
  543. <if test="gdX != null and gdX != ''">GD_X
  544. = #{gdX},
  545. </if>
  546. <if test="gdY != null and gdY != ''">GD_Y
  547. = #{gdY},
  548. </if>
  549. <if test="note != null and note != ''">NOTE
  550. = #{note},
  551. </if>
  552. <if test="intm != null">INTM
  553. = #{intm},
  554. </if>
  555. <if test="uptm != null">UPTM
  556. = #{uptm},
  557. </if>
  558. <if test="dataStat != null and dataStat != ''">DATA_STAT
  559. = #{dataStat},
  560. </if>
  561. </trim>
  562. <include refid="page_where"/>
  563. </update>
  564. <!-- 其他自定义SQL -->
  565. <select id="findStstnPage" resultType="cn.com.goldenwater.dcproj.dto.BisInspStstnDto">
  566. SELECT * FROM (
  567. select
  568. A.CODE, A.CODE as baseId, A.ID nodeId, A.NM, A.ptype,
  569. ia.pnm groupName, aw.AD_FULL_NAME,
  570. B.ID, B.id as rgstrId,
  571. (case when b.STATE is null then '0' else b.state end) STATE,
  572. B.SCENE_SCORE,
  573. B.SAF_TOTAL,
  574. B.TMPR_TOTAL,
  575. B.SCENE_TOTAL,
  576. B.PERS_ID,
  577. B.ACTUAL_SCORE,
  578. B.TOTAL AS STANDARD_TOTAL,
  579. 100 AS TOTAL,
  580. B.SAF_SCORE,
  581. B.TMPR_SCORE,
  582. B.STSTN_ID,
  583. B.OBJ_ID,
  584. B.AD_CODE,
  585. B.AD_NAME,
  586. B.LOC,
  587. B.PRJC_TYPE,
  588. B.COST,
  589. B.COST_YEAR,
  590. B.MGR,
  591. B.OWNER,
  592. B.QUALITY,
  593. B.DESIGN,
  594. B.SUPERVISOR,
  595. B.BUILD,
  596. B.PRJC_PERS,
  597. B.PRJC_PRES_TEL,
  598. B.SCENE_STATE,
  599. B.TMPR_STATE,
  600. B.SAF_STATE,
  601. B.PB_STATE,
  602. B.PB_TOTAL,
  603. B.PB_SCORE,
  604. NVL(B.STANDARD_SCORE, B.ACTUAL_SCORE) STANDARD_SCORE,
  605. B.CENTER_X,
  606. B.CENTER_Y,
  607. B.GD_X,
  608. B.GD_Y,
  609. B.NOTE,
  610. B.INTM,
  611. B.UPTM
  612. FROM BIS_INSP_ALL_OBJ A
  613. JOIN BIS_INSP_STSTN B ON A.OBJ_ID=B.OBJ_ID
  614. LEFT JOIN BIS_INSP_ALL IA ON A.ID = IA.ID
  615. LEFT JOIN ATT_AD_BASE AW ON B.AD_CODE = AW.AD_CODE
  616. where A.ptype= #{pType}
  617. <if test="adCodes ==null or adCodes ==''">
  618. <choose>
  619. <when test='isAll =="1"'>
  620. </when>
  621. <otherwise>
  622. and
  623. A.Id in (
  624. select distinct id from (
  625. SELECT P.id FROM BIS_INSP_ALL P START WITH P.PID IN (SELECT id FROM BIS_INSP_ALL_RLATION A
  626. WHERE A.PERSID = #{presId} and TYPE = #{pType} and length(id) in (3,6,9))
  627. CONNECT BY P.PID = PRIOR P.ID
  628. union all
  629. SELECT P.id FROM BIS_INSP_ALL P where p.id in (SELECT id FROM BIS_INSP_ALL_RLATION A
  630. WHERE A.PERSID =#{presId} and TYPE = #{pType} and length(id)=12 )
  631. )
  632. )
  633. </otherwise>
  634. </choose>
  635. </if>
  636. <if test="adCodes !=null and adCodes !=''">
  637. and
  638. <foreach item="item" index="index" collection="adCodes.split(',')" open="(" separator="or" close=")">
  639. b.ad_code like concat('${item}','%')
  640. </foreach>
  641. </if>
  642. <if test="province != null and province != ''">and B.AD_CODE LIKE '%' || #{province} || '%' </if>
  643. <if test="tabType =='2'.toString()">
  644. AND IA.ENTM &lt; TO_DATE(#{nowTime},'yyyy-MM-dd')+1
  645. </if>
  646. <if test="tabType =='1'.toString()">
  647. AND IA.ENTM &gt;= TO_DATE(#{nowTime},'yyyy-MM-dd')
  648. </if>
  649. ) A WHERE a.PTYPE=#{pType}
  650. <if test="plnaId !=null and plnaId !=''">and a.nodeId like '${plnaId}%'</if>
  651. <if test="id !=null and id !=''">and a.nodeId like '${id}%'</if>
  652. <if test="state !=null and state !=''">and STATE in (${state})</if>
  653. <if test="rsName !=null and rsName !=''">and a.nm like '%${rsName}%'</if>
  654. <if test="nm !=null and nm !=''">and a.nm like '%${nm}%'</if>
  655. <if test="code !=null and code !=''">and a.code = #{code}</if>
  656. <if test="adName != null and adName != ''">and a.AD_FULL_NAME like '%${adName}%'</if>
  657. <if test="sttm != null and sttm != ''">and a.Intm&gt;= TO_DATE(#{sttm},'YYYY-MM-DD')</if>
  658. <if test="entm != null and entm != ''">and a.Intm &lt; To_DATE(#{entm},'yyyy-MM-dd') + 1</if>
  659. <if test="groupId != null and groupId != ''">and a.nodeId = #{groupId}</if>
  660. <if test="groupIds != null and groupIds.length &gt; 0">
  661. <foreach collection="groupIds" index="index" item="gId" separator=" OR " open="and (" close=")">
  662. a.nodeId LIKE '${gId}%'
  663. </foreach>
  664. </if>
  665. order by nodeId asc
  666. <if test="orderBy != null and orderBy != ''">
  667. ,nlssort(nm,'NLS_SORT=SCHINESE_PINYIN_M')
  668. </if>
  669. </select>
  670. <select id="getListByInspGroupIdObjType" resultType="cn.com.goldenwater.dcproj.model.BisInspStstn"
  671. parameterType="cn.com.goldenwater.dcproj.param.PagePersObjParam">
  672. <!-- 获取督察对象 -->
  673. select
  674. T.AD_CODE, T.AD_NAME, T.CENTER_X, T.CENTER_Y,
  675. T.GD_X, T.GD_Y, T.LOC, T.ID, T.ID AS RGSTR_ID,
  676. C.ID groupId, C.PNM groupName, B.NM
  677. FROM BIS_INSP_STSTN T
  678. LEFT JOIN BIS_INSP_ALL_OBJ B ON T.OBJ_ID = B.OBJ_ID
  679. LEFT JOIN BIS_INSP_ALL C ON B.ID = C.ID
  680. where B.ptype = #{objType}
  681. <if test='isAll == "0"'>and B.ID = #{inspGroupId}</if>
  682. <if test='isAll == "1"'>and B.ID LIKE '${inspGroupId}%'</if>
  683. <if test="adCode != null and adCode != ''">and t.AD_CODE like '${adCode}%'</if>
  684. <if test="wtdstNm != null and wtdstNm != ''">and B.NM like '%${wtdstNm}%'</if>
  685. <choose>
  686. <when test="province != null and province != ''">
  687. and B.AD_CODE LIKE '${province}%'
  688. </when>
  689. <otherwise>
  690. and B.AD_CODE is null
  691. </otherwise>
  692. </choose>
  693. </select>
  694. </mapper>