ddfd3da3f4c704c3d317629fb9b38f4b74c3f9be.svn-base 179 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559
  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.BisInspPblmDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.BisInspPblm" id="bisInspPblmResultMap">
  5. <result property="pblmsTypeId" column="PBLMS_TYPE_ID"/>
  6. <result property="regid" column="REGID"/>
  7. <result property="commonFileIds" column="COMMON_FILE_IDS"/>
  8. <result property="fileNo" column="FILE_NO"/>
  9. <result property="fileNoNumber" column="FILE_NO_NUMBER"/>
  10. <result property="pblmsId" column="PBLMS_ID"/>
  11. <result property="pblmId" column="PBLM_ID"/>
  12. <result property="quote" column="QUOTE"/>
  13. <result property="waterUserId" column="WATER_USER_ID"/>
  14. <result property="objId" column="OBJ_ID"/>
  15. <result property="objType" column="OBJ_TYPE"/>
  16. <result property="inspGroupId" column="INSP_GROUP_ID"/>
  17. <result property="pguid" column="PGUID"/>
  18. <result property="inspPblmType" column="INSP_PBLM_TYPE"/>
  19. <result property="inspPblmCode" column="INSP_PBLM_CODE"/>
  20. <result property="inspPblmName" column="INSP_PBLM_NAME"/>
  21. <result property="inspPblmDesc" column="INSP_PBLM_DESC"/>
  22. <result property="inspAddDesc" column="INSP_ADD_DESC"/>
  23. <result property="pblmLong" column="PBLM_LONG"/>
  24. <result property="pblmLat" column="PBLM_LAT"/>
  25. <result property="ifCasePblm" column="IF_CASE_PBLM"/>
  26. <result property="inspPblmOrgName" column="INSP_PBLM_ORG_NAME"/>
  27. <result property="pblmPersName" column="PBLM_PERS_NAME"/>
  28. <result property="inspPblmCate" column="INSP_PBLM_CATE"/>
  29. <result property="pblmStat" column="PBLM_STAT"/>
  30. <result property="reviOpin" column="REVI_OPIN"/>
  31. <result property="reviConc" column="REVI_CONC"/>
  32. <result property="reviOrgGuid" column="REVI_ORG_GUID"/>
  33. <result property="dataStat" column="DATA_STAT"/>
  34. <result property="collTime" column="COLL_TIME"/>
  35. <result property="villType" column="VILL_TYPE"/>
  36. <result property="recPers" column="REC_PERS"/>
  37. <result property="note" column="NOTE"/>
  38. <result property="persName" column="PERS_NAME"/>
  39. <result property="inspPblmsName" column="insp_pblms_name"/>
  40. <result property="checkPoint" column="check_point"/>
  41. <result property="nm" column="nm"/>
  42. <result property="objNm" column="obj_nm"/>
  43. <result property="cwsName" column="cws_name"/>
  44. <result property="cwsCode" column="CWS_CODE"/>
  45. <result property="villageCode" column="VILLAGE_CODE"/>
  46. <result property="pblmDesc" column="pblm_desc"/>
  47. <result property="state" column="state"/>
  48. <result property="code" column="CODE"/>
  49. <result property="adFullName" column="AD_FULL_NAME"/>
  50. <result property="adCode" column="AD_CODE"/>
  51. <result property="orgNm" column="ORG_NM"/>
  52. <result property="orgId" column="ORG_ID"/>
  53. <result property="rsName" column="rs_name"/>
  54. <result property="hasVedio" column="HAS_VEDIO"/>
  55. <result property="problemType" column="PROBLEM_TYPE"/>
  56. <result property="nature" column="NATURE"/>
  57. <result property="reviOrg" column="revi_org"/>
  58. <result property="qualityTypeId" column="QUALITY_TYPE_ID"/>
  59. <result property="defectTypeId" column="DEFECT_TYPE_ID"/>
  60. <result property="fdbkId" column="FDBK_ID"/>
  61. <result property="unitNm" column="unit_nm"/>
  62. <result property="itemId" column="ITEM_ID"/>
  63. <result property="snNum" column="sn_num"/>
  64. <result property="attach" column="attach"/>
  65. <result property="sheet" column="sheet"/>
  66. <result property="engScal" column="eng_scal"/>
  67. <result property="wagaScal" column="waga_Scal"/>
  68. <result property="gateType" column="gate_type"/>
  69. <result property="sttp" column="sttp"/>
  70. <result property="rePtype" column="re_ptype"/>
  71. <result property="pnm" column="pnm"/>
  72. <result property="oid" column="oid"/>
  73. <result property="uptm" column="UP_TM"/>
  74. <result property="pblmNameBz" column="PBLM_NAME_BZ"/>
  75. <result property="checkPointBz" column="CHECK_POINT_BZ"/>
  76. <result property="checkPoint" column="CHECK_POINT"/>
  77. <result property="snNumBz" column="SN_NUM_BZ"/>
  78. <result property="pblmDescBz" column="PBLM_DESC_BZ"/>
  79. <result property="pblmReason" column="PBLM_REASON"/>
  80. <result property="pblmSggtn" column="PBLM_SGGTN"/>
  81. <result property="gongdiBzId" column="GONGDI_BZ_ID"/>
  82. <result property="objCode" column="OBJ_CODE"/>
  83. <result property="objName" column="OBJ_NAME"/>
  84. <result property="objAdCode" column="OBJ_AD_CODE"/>
  85. <result property="attachBz" column="attach_bz"/>
  86. <result property="wtdstNote" column="WTDST_NOTE"/>
  87. <result property="score" column="SCORE"/>
  88. <result property="provincial" column="PROVINCIAL"/>
  89. <result property="belongOrgId" column="BELONG_ORG_ID"/>
  90. <result property="belongAdCode" column="BELONG_AD_CODE"/>
  91. <result property="baseObjType" column="BASE_OBJ_TYPE"/>
  92. <result property="engrType" column="ENGR_TYPE"/>
  93. </resultMap>
  94. <!-- 这是问题删除表字段 -->
  95. <sql id="table_columns_pblmDelLog">
  96. PBLM_ID,PBLM_NAME_BZ,CHECK_POINT_BZ,SN_NUM_BZ,PBLM_DESC_BZ,
  97. OBJ_ID,
  98. OBJ_TYPE,
  99. INSP_GROUP_ID,
  100. PGUID,
  101. INSP_PBLM_TYPE,
  102. INSP_PBLM_CODE,
  103. INSP_PBLM_NAME,
  104. INSP_PBLM_DESC,
  105. INSP_ADD_DESC,
  106. PBLM_LONG,
  107. PBLM_LAT,
  108. IF_CASE_PBLM,
  109. INSP_PBLM_ORG_NAME,
  110. PBLM_PERS_NAME,
  111. INSP_PBLM_CATE,
  112. PBLM_STAT,
  113. REVI_OPIN,
  114. REVI_CONC,
  115. REVI_ORG_GUID,
  116. DATA_STAT,
  117. COLL_TIME,
  118. REC_PERS,
  119. NOTE,
  120. REGID,
  121. COMMON_FILE_IDS,
  122. FILE_NO,
  123. FILE_NO_NUMBER,
  124. PBLMS_ID,
  125. PBLMS_TYPE_ID,
  126. VILL_TYPE,
  127. CWS_CODE,
  128. VILLAGE_CODE,
  129. PBLM_DEL_ID,
  130. PBLM_DEL_PERS,
  131. PBLM_DEL_PERSNM,
  132. PBLM_DEL_TM,
  133. PBLM_DEL_NOTE,QUOTE,
  134. PROVINCIAL,
  135. BELONG_ORG_ID,
  136. BELONG_AD_CODE
  137. </sql>
  138. <sql id="entity_properties_pblmDelLog">
  139. #{pblmId},#{pblmNameBz},#{checkPointBz},#{snNumBz},#{pblmDescBz},
  140. #{objId},
  141. #{objType},
  142. #{inspGroupId},
  143. #{pguid},
  144. #{inspPblmType},
  145. #{inspPblmCode},
  146. #{inspPblmName},
  147. #{inspPblmDesc},
  148. #{inspAddDesc},
  149. #{pblmLong},
  150. #{pblmLat},
  151. #{ifCasePblm},
  152. #{inspPblmOrgName},
  153. #{pblmPersName},
  154. #{inspPblmCate},
  155. #{pblmStat},
  156. #{reviOpin},
  157. #{reviConc},
  158. #{reviOrgGuid},
  159. #{dataStat},
  160. #{collTime},
  161. #{recPers},
  162. #{note},
  163. #{regid},
  164. #{commonFileIds},
  165. #{fileNo},
  166. #{fileNoNumber},
  167. #{pblmsId},
  168. #{pblmsTypeId},
  169. #{villType},
  170. #{cwsCode},
  171. #{villageCode},
  172. #{pblmDelId},
  173. #{pblmDelPers},
  174. #{pblmDelPersnm},
  175. TO_DATE(#{pblmDelTm},'YYYY-MM-DD HH24:MI:SS'),
  176. #{pblmDelNote},#{quote},#{provincial},#{belongOrgId},#{belongAdCode}
  177. </sql>
  178. <!-- 这是问题表字段 -->
  179. <sql id="table_columns">
  180. attach_Bz,
  181. CWS_CODE,HAS_VEDIO,PROBLEM_TYPE,QUALITY_TYPE_ID,DEFECT_TYPE_ID,FDBK_ID,ITEM_ID,WATER_USER_ID,GONGDI_BZ_ID,
  182. VILLAGE_CODE,
  183. VILL_TYPE,
  184. PBLMS_TYPE_ID,
  185. REGID,
  186. COMMON_FILE_IDS,
  187. FILE_NO,
  188. FILE_NO_NUMBER,
  189. PBLMS_ID,
  190. PBLM_ID,
  191. OBJ_ID,
  192. OBJ_TYPE,
  193. INSP_GROUP_ID,
  194. PGUID,
  195. INSP_PBLM_TYPE,
  196. INSP_PBLM_CODE,
  197. INSP_PBLM_NAME,
  198. INSP_PBLM_DESC,
  199. INSP_ADD_DESC,
  200. PBLM_LONG,
  201. PBLM_LAT,
  202. IF_CASE_PBLM,
  203. INSP_PBLM_ORG_NAME,
  204. PBLM_PERS_NAME,
  205. <if test="inspPblmCate != null and inspPblmCate != ''">INSP_PBLM_CATE,</if>
  206. <if test="relBasis != null and relBasis != ''">REL_BASIS,</if>
  207. <if test="damRegCode != null and damRegCode != ''">DAM_REG_CODE,</if>
  208. PBLM_STAT,
  209. REVI_OPIN,
  210. REVI_CONC,
  211. REVI_ORG_GUID,
  212. DATA_STAT,
  213. COLL_TIME,
  214. REC_PERS,
  215. NOTE,QUOTE,
  216. UP_TM,PBLM_NAME_BZ,CHECK_POINT_BZ,SN_NUM_BZ,PBLM_DESC_BZ,NEW_VILL_NAME,
  217. PBLM_REASON,
  218. PBLM_SGGTN,WTDST_NOTE,
  219. OBJ_CODE,OBJ_NAME,OBJ_AD_CODE,SCORE,
  220. PROVINCIAL,BELONG_ORG_ID, BELONG_AD_CODE
  221. </sql>
  222. <sql id="entity_properties">
  223. #{attachBz},
  224. #{cwsCode},#{hasVedio},#{problemType},#{qualityTypeId},#{defectTypeId},#{fdbkId},#{itemId},#{waterUserId},#{gongdiBzId},
  225. #{villageCode},
  226. #{villType},
  227. #{pblmsTypeId},
  228. #{regid},
  229. #{commonFileIds},
  230. #{fileNo},
  231. #{fileNoNumber},
  232. #{pblmsId},
  233. #{pblmId},
  234. #{objId},
  235. #{objType},
  236. #{inspGroupId},
  237. #{pguid},
  238. #{inspPblmType},
  239. #{inspPblmCode},
  240. #{inspPblmName},
  241. #{inspPblmDesc},
  242. #{inspAddDesc},
  243. #{pblmLong},
  244. #{pblmLat},
  245. #{ifCasePblm},
  246. #{inspPblmOrgName},
  247. #{pblmPersName},
  248. <if test="inspPblmCate != null and inspPblmCate != ''">#{inspPblmCate},</if>
  249. <if test="relBasis != null and relBasis != ''">#{relBasis},</if>
  250. <if test="damRegCode != null and damRegCode != ''">#{damRegCode},</if>
  251. #{pblmStat},
  252. #{reviOpin},
  253. #{reviConc},
  254. #{reviOrgGuid},
  255. #{dataStat},
  256. #{collTime},
  257. #{recPers},
  258. #{note},#{quote},
  259. #{uptm},#{pblmNameBz},#{checkPointBz},#{snNumBz},#{pblmDescBz},#{newVillName},
  260. #{pblmReason},
  261. #{pblmSggtn}, #{wtdstNote},
  262. #{objCode}, #{objName}, #{objAdCode},
  263. #{score},
  264. #{provincial},
  265. #{belongOrgId},
  266. #{belongAdCode}
  267. </sql>
  268. <sql id="page_where">
  269. <trim prefix="where" prefixOverrides="and | or ">
  270. <if test="waterUserId != null and waterUserId != ''">and WATER_USER_ID = #{waterUserId}</if>
  271. <if test="cwsCode != null and cwsCode != ''">and CWS_CODE = #{cwsCode}</if>
  272. <if test="newVillName != null and newVillName != ''">and NEW_VILL_NAME = #{newVillName}</if>
  273. <if test="pblmNameBz != null and pblmNameBz != ''">and PBLM_NAME_BZ = #{pblmNameBz}</if>
  274. <if test="snNumBz != null and snNumBz != ''">and SN_NUM_BZ = #{snNumBz}</if>
  275. <if test="attachBz != null and attachBz != ''">and attach_Bz = #{attachBz}</if>
  276. <if test="gongdiBzId != null and gongdiBzId != ''">and gongdi_Bz_Id = #{gongdiBzId}</if>
  277. <if test="checkPointBz != null and checkPointBz != ''">and CHECK_POINT_BZ = #{checkPointBz}</if>
  278. <if test="pblmDescBz != null and pblmDescBz != ''">and PBLM_DESC_BZ = #{pblmDescBz}</if>
  279. <if test="regid != null and regid != ''">and REGID = #{regid}</if>
  280. <if test="quote != null and quote != ''">and QUOTE = #{quote}</if>
  281. <if test="hasVedio != null and hasVedio != ''">and HAS_VEDIO = #{hasVedio}</if>
  282. <if test="villType != null and villType != ''">and VILL_TYPE = #{villType}</if>
  283. <if test="commonFileIds != null and commonFileIds != ''">and COMMON_FILE_IDS = #{commonFileIds}</if>
  284. <if test="fileNo != null and fileNo != ''">and FILE_NO = #{fileNo}</if>
  285. <if test="fileNoNumber != null and fileNoNumber != ''">and FILE_NO_NUMBER = #{fileNoNumber}</if>
  286. <if test="pblmsId != null and pblmsId != ''">and PBLMS_ID = #{pblmsId}</if>
  287. <if test="pblmId != null and pblmId != ''">and PBLM_ID = #{pblmId}</if>
  288. <if test="problemType != null and problemType != ''">and problem_Type = #{problemType}</if>
  289. <if test="objId != null and objId != ''">and OBJ_ID = #{objId}</if>
  290. <if test="objType != null and objType != ''">and OBJ_TYPE = #{objType}</if>
  291. <if test="inspGroupId != null and inspGroupId != ''">and INSP_GROUP_ID = #{inspGroupId}</if>
  292. <if test="pguid != null and pguid != ''">and PGUID = #{pguid}</if>
  293. <if test="inspPblmType != null and inspPblmType != ''">and INSP_PBLM_TYPE = #{inspPblmType}</if>
  294. <if test="inspPblmCode != null and inspPblmCode != ''">and INSP_PBLM_CODE = #{inspPblmCode}</if>
  295. <if test="inspPblmName != null and inspPblmName != ''">and INSP_PBLM_NAME = #{inspPblmName}</if>
  296. <if test="inspPblmDesc != null and inspPblmDesc != ''">and INSP_PBLM_DESC like '%${inspPblmDesc}%'</if>
  297. <if test="inspAddDesc != null and inspAddDesc != ''">and INSP_ADD_DESC = #{inspAddDesc}</if>
  298. <if test="pblmLong != null and pblmLong != ''">and PBLM_LONG = #{pblmLong}</if>
  299. <if test="pblmLat != null and pblmLat != ''">and PBLM_LAT = #{pblmLat}</if>
  300. <if test="ifCasePblm != null and ifCasePblm != ''">and IF_CASE_PBLM = #{ifCasePblm}</if>
  301. <if test="inspPblmOrgName != null and inspPblmOrgName != ''">and INSP_PBLM_ORG_NAME = #{inspPblmOrgName}
  302. </if>
  303. <if test="pblmPersName != null and pblmPersName != ''">and PBLM_PERS_NAME = #{pblmPersName}</if>
  304. <if test="inspPblmCate != null and inspPblmCate != ''">and INSP_PBLM_CATE = #{inspPblmCate}</if>
  305. <if test="pblmStat != null and pblmStat != ''">and PBLM_STAT = #{pblmStat}</if>
  306. <if test="reviOpin != null and reviOpin != ''">and REVI_OPIN = #{reviOpin}</if>
  307. <if test="reviConc != null and reviConc != ''">and REVI_CONC = #{reviConc}</if>
  308. <if test="reviOrgGuid != null and reviOrgGuid != ''">and REVI_ORG_GUID = #{reviOrgGuid}</if>
  309. <if test="dataStat != null and dataStat != ''">and DATA_STAT = #{dataStat}</if>
  310. <if test="collTime != null">and COLL_TIME = #{collTime}</if>
  311. <if test="recPers != null and recPers != ''">and REC_PERS = #{recPers}</if>
  312. <if test="note != null and note != ''">and NOTE = #{note}</if>
  313. <if test="year != null and year != ''">and TO_CHAR(COLL_TIME,'YYYY') = #{year}</if>
  314. <if test="startTime != null and startTime != ''">and COLL_TIME &gt; TO_DATE(#{startTime},'YYYY-MM-DD
  315. HH24:MI:SS')
  316. </if>
  317. <if test="endTime != null and endTime != ''">and COLL_TIME &lt; TO_DATE(#{endTime},'YYYY-MM-DD
  318. HH24:MI:SS')
  319. </if>
  320. <if test="findTime != null and findTime != ''">and to_char(coll_time,'yyyy-MM-dd')=#{findTime}</if>
  321. <if test="monthTime != null and monthTime != ''">and to_char(coll_time,'yyyy-MM')=#{monthTime}</if>
  322. <if test="objCode != null and objCode != ''">and OBJ_CODE = #{objCode}</if>
  323. <if test="objName != null and objName != ''">and OBJ_NAME = #{objName}</if>
  324. <if test="objAdCode != null and objAdCode != ''">and OBJ_AD_CODE = #{objAdCode}</if>
  325. <if test="wtdstNote != null and wtdstNote != ''">and WTDST_NOTE = #{wtdstNote}</if>
  326. <if test="provincial != null and provincial != ''">and PROVINCIAL = #{provincial}</if>
  327. <if test="belongOrgId != null and belongOrgId != ''">and BELONG_ORG_ID = #{belongOrgId}</if>
  328. <if test="belongAdCode != null and belongAdCode != ''">and BELONG_AD_CODE LIKE CONCAT(#{belongAdCode},'%') </if>
  329. </trim>
  330. </sql>
  331. <select id="getListByMap" resultMap="bisInspPblmResultMap" parameterType="java.util.Map">
  332. select m.* from BIS_INSP_PBLM m where m.obj_type=#{objType} and m.regid=#{regId}
  333. </select>
  334. <select id="get" resultMap="bisInspPblmResultMap" parameterType="String">
  335. select
  336. S.*, S.PBLM_NAME_BZ AS INSP_PBLMS_NAME,
  337. S.CHECK_POINT_BZ AS CHECK_POINT, S.PBLM_DESC_BZ AS PBLM_DESC,
  338. J.NM, B.PERS_NAME, P.ORG_ID, CASE WHEN R.STATE IS NULL THEN '0' ELSE R.STATE END AS STATE
  339. FROM BIS_INSP_PBLM S
  340. LEFT JOIN BIS_INSP_ALL_OBJ J ON S.OBJ_ID=J.OBJ_ID
  341. LEFT JOIN BIS_INSP_RSVR_RGSTR R ON R.OBJ_ID=J.OBJ_ID
  342. LEFT JOIN BIS_INSP_ALL_RLATION_PERS B ON S.REC_PERS = B.GUID
  343. LEFT JOIN OBJ_INSP_PBLMS P ON P.GUID=S.PBLMS_TYPE_ID
  344. where s.PBLM_ID = #{id}
  345. </select>
  346. <select id="getBy" resultMap="bisInspPblmResultMap">
  347. select
  348. <include refid="table_columns"/>
  349. from bis_insp_pblm
  350. <include refid="page_where"/>
  351. </select>
  352. <select id="getCommonSingle" resultMap="bisInspPblmResultMap" parameterType="String">
  353. select w.*,s.insp_pblms_name,s.check_point,s.pblm_desc from (
  354. select e.OBJ_NM as nm,m.*,s.pers_name from view_reg_base e join bis_insp_pblm m
  355. on e.OBJ_ID=m.obj_id
  356. left join bis_insp_all_rlation_pers s
  357. on m.rec_pers=s.guid
  358. where 1=1
  359. <if test="pType !=null and pType !=''">
  360. and m.obj_type=#{pType}
  361. </if>
  362. and m.pblm_id=#{pblmId}
  363. ) w left join obj_insp_pblms s on w.pblms_type_id=s.guid
  364. </select>
  365. <select id="pblmRectPage" parameterType="cn.com.goldenwater.dcproj.param.BisInspVo"
  366. resultType="cn.com.goldenwater.dcproj.param.BisInspVo">
  367. select e.RGSTR_NM as name,e.ad_code,p.rec_pers as pers_id,m.rect_id,m.id,p.*,to_char(p.coll_time,'yyyy-MM-dd')
  368. as insp_pblm_tm
  369. from VIEW_REG_BASE e,bis_insp_pblm p,bis_insp_rect_pblm m
  370. LEFT JOIN BIS_INSP_ALL_OBJ J ON e.obj_id = J.OBJ_ID
  371. LEFT JOIN BIS_INSP_ALL L ON L.ID = J.ID
  372. LEFT JOIN BIS_INSP_ALL_RLATION_PERS R ON P.REC_PERS = R.GUID
  373. where e.obj_id=p.obj_id and p.pblm_id=m.pblm_id and m.data_stat='0'
  374. <include refid="pblmPageSql"/>
  375. </select>
  376. <sql id="pblmPageSql">
  377. <if test="inspPblmCate != null and inspPblmCate != ''">and p.INSP_PBLM_CATE = #{inspPblmCate}</if>
  378. <if test="ifCasePblm != null and ifCasePblm != ''">and p.IF_CASE_PBLM = #{ifCasePblm}</if>
  379. <if test="dataStat != null and dataStat != ''">and p.DATA_STAT = #{dataStat}</if>
  380. <if test="inspPblmName != null and inspPblmName != ''">
  381. and p.INSP_PBLM_NAME like '%${inspPblmName}%'
  382. </if>
  383. <if test="name != null and name != ''">
  384. and p.obj_name like '%${name}%'
  385. </if>
  386. <if test="objName != null and objName != ''">
  387. and p.obj_name like '%${objName}%'
  388. </if>
  389. <if test="adCode != null and adCode != ''">
  390. and p.obj_ad_code like '${adCode}%'
  391. </if>
  392. <if test="objAdCode != null and objAdCode != ''">
  393. and p.obj_ad_code like '${objAdCode}%'
  394. </if>
  395. <!-- 小水电站 通用督查 基础对象code是uuid没有遵循行政区域的编码规则 -->
  396. <if test="province != null and province != ''">
  397. and (p.obj_code like '${province}%' or p.belong_ad_code like '${province}%' )
  398. </if>
  399. <if test="regid != null and regid != ''">and p.regid = #{regid}</if>
  400. <if test="objType != null and objType != ''">and p.obj_type = #{objType}</if>
  401. <if test="startTime != null and startTime != ''">and p.COLL_TIME &gt;= TO_DATE(#{startTime},'YYYY-MM-DD')</if>
  402. <if test="inspPblmTm != null and inspPblmTm != ''">and p.COLL_TIME=TO_DATE(#{inspPblmTm},'YYYY-MM-DD')</if>
  403. <if test="endTime != null and endTime != ''">and p.COLL_TIME &lt; TO_DATE(#{endTime},'YYYY-MM-DD')+1</if>
  404. <if test="pblmStat != null and pblmStat != ''">and p.PBLM_Stat = #{pblmStat}</if>
  405. <if test="hasVedio != null and hasVedio != ''">and p.HAS_VEDIO = #{hasVedio}</if>
  406. <if test="objId != null and objId != ''">and p.OBJ_ID =#{objId}</if>
  407. <if test="provincial != null and provincial != ''">and p.PROVINCIAL =#{provincial}</if>
  408. <if test='belongOrgId != null and belongOrgId != "" '>and p.BELONG_ORG_ID =#{belongOrgId}</if>
  409. <if test='belongAdCode != null and belongAdCode != "" '>and p.BELONG_AD_CODE like '${belongAdCode}%'</if>
  410. <if test="year != null and year != ''">and to_char(p.coll_time,'yyyy')= #{year}</if>
  411. <!--isJoinRec 是否加入到整改 0-未加过 1-加入过-->
  412. <if test="isJoinRec != null and isJoinRec != ''">
  413. <if test="isJoinRec =='0'.toString()">
  414. and p.pblm_id not in (select pblm_id from BIS_INSP_PBLM_PLIST WHERE pblm_id IS NOT NULL)
  415. </if>
  416. <if test="isJoinRec =='1'.toString()">
  417. and p.pblm_id in (select pblm_id from BIS_INSP_PBLM_PLIST WHERE pblm_id IS NOT NULL)
  418. </if>
  419. </if>
  420. <!--isJoinRec 是否加入到整改 0-未加过 1-加入过-->
  421. <if test="orgNm != null and orgNm != ''">and L.PNM like '%${orgNm}%'</if>
  422. <if test="persId != null and persId != ''">and P.REC_PERS = #{persId} </if>
  423. <if test="persName != null and persName != ''">and R.PERS_NAME like '%${persName}%'</if>
  424. <if test="leadDep !=null and leadDep != ''">and L.lead_dep LIKE CONCAT('%', CONCAT(#{leadDep}, '%') ) </if>
  425. order by P.coll_time desc
  426. </sql>
  427. <select id="pblmPage" parameterType="cn.com.goldenwater.dcproj.param.BisInspVo"
  428. resultType="cn.com.goldenwater.dcproj.param.BisInspVo">
  429. SELECT P.OBJ_NAME AS NAME,P.OBJ_AD_CODE AD_CODE,P.REC_PERS AS PERS_ID,P.*,TO_CHAR(P.COLL_TIME,'YYYY-MM-DD') AS INSP_PBLM_TM,B.AD_FULL_NAME
  430. FROM BIS_INSP_PBLM P
  431. JOIN BIS_INSP_ALL_OBJ J ON P.OBJ_ID = J.OBJ_ID
  432. LEFT JOIN BIS_INSP_ALL L ON L.ID = J.ID
  433. LEFT JOIN ATT_AD_BASE B ON P.OBJ_AD_CODE = B.AD_CODE
  434. LEFT JOIN BIS_INSP_ALL_RLATION_PERS R ON P.REC_PERS = R.GUID
  435. WHERE 1 = 1
  436. <include refid="pblmPageSql"/>
  437. </select>
  438. <select id="getOnePblm" resultType="cn.com.goldenwater.dcproj.model.KeyRegPblm" parameterType="java.lang.String">
  439. select CWS_CODE,HAS_VEDIO,PROBLEM_TYPE,QUALITY_TYPE_ID,DEFECT_TYPE_ID,gongdi_Bz_Id,
  440. VILLAGE_CODE,
  441. VILL_TYPE,
  442. PBLMS_TYPE_ID,
  443. REGID,
  444. COMMON_FILE_IDS,
  445. FILE_NO,
  446. FILE_NO_NUMBER,
  447. PBLMS_ID,m.quote,
  448. m.PBLM_ID, m.OBJ_ID, OBJ_TYPE, INSP_GROUP_ID,
  449. PGUID, INSP_PBLM_TYPE, INSP_PBLM_CODE, INSP_PBLM_NAME, INSP_PBLM_DESC, INSP_ADD_DESC, PBLM_LONG, PBLM_LAT,
  450. IF_CASE_PBLM, INSP_PBLM_ORG_NAME,
  451. PBLM_PERS_NAME, INSP_PBLM_CATE, PBLM_STAT, REVI_OPIN, REVI_CONC, REVI_ORG_GUID,
  452. m.DATA_STAT, m.COLL_TIME, m.REC_PERS, m.PROVINCIAL, m.BELONG_ORG_ID, m.BELONG_AD_CODE
  453. ,(select s.attach||'-'||s.sheet from obj_key_pblms s where s.id=QUALITY_TYPE_ID) as attach_qua,
  454. (select s.sn from obj_key_pblms s where s.id=QUALITY_TYPE_ID) as attach_qua_sn,
  455. (select s.attach_name from obj_key_pblms s where s.id=QUALITY_TYPE_ID) as attach_qua_name,
  456. (select s.attach||'-'||s.sheet from obj_key_pblms s where s.id=DEFECT_TYPE_ID) as attach_def,
  457. (select s.sn from obj_key_pblms s where s.id=DEFECT_TYPE_ID) as attach_def_sn,
  458. (select s.attach_name from obj_key_pblms s where s.id=DEFECT_TYPE_ID) as attach_def_name,
  459. (select s.attach||'-'||s.sheet from obj_key_pblms s where s.id=PBLMS_TYPE_ID) as attach_wg,
  460. (select s.sn from obj_key_pblms s where s.id=PBLMS_TYPE_ID) as attach_wg_sn,
  461. (select s.attach_name from obj_key_pblms s where s.id=PBLMS_TYPE_ID) as attach_wg_name,
  462. (select s.attach||'-'||s.sheet from obj_key_pblms s where s.id=PBLMS_ID) as attach_hetong,
  463. (select s.sn from obj_key_pblms s where s.id=PBLMS_ID) as attach_hetong_sn,
  464. (select s.sn from obj_key_pblms s where s.id=gongdi_Bz_Id) as attach_gongdi_sn,
  465. (select s.attach_name from obj_key_pblms s where s.id=gongdi_Bz_Id) as attach_gongdi_name,
  466. (select s.attach||'-'||s.sheet from obj_key_pblms s where s.id=gongdi_Bz_Id) as attach_gongdi,
  467. (select s.attach_name from obj_key_pblms s where s.id=PBLMS_ID) as attach_hetong_name,
  468. k.rect_meas,k.guid,u.nm as unit_Nm,
  469. k.rect_conc,k.note as rectNote,k.org_guid,k.coll_time as rect_time,e.revi_org,u.nm as rect_name
  470. <if test="pType =='7'.toString()">
  471. ,case when mo.lev='1' then mo.nm else '' end as first_Name,case when mo.lev='2' then mo.nm else '' end as
  472. second_Name,case when mo.lev='3' then mo.nm else '' end as third_Name
  473. </if>
  474. ,bi.nm
  475. from bis_insp_pblm m
  476. left join BIS_INSP_KEY_REG_SEC_UNIT u on m.regid=u.id
  477. left join (
  478. select revi_org , org_type from obj_key_pblm_rel l where l.org_type is not null group by revi_org,org_type order
  479. by org_type
  480. ) e on e.org_type=u.nature
  481. left join bis_insp_rect_fdbk k on m.pblm_id=k.pblm_id and k.guid=m.FDBK_ID
  482. <if test="pType =='7'.toString()">
  483. left join ATT_MAMPU_INFO mo on m.regid = mo.id
  484. </if>
  485. <if test="pType=='4'.toString()">
  486. left join bis_insp_key_register_section mo on u.sec_id = mo.id
  487. </if>
  488. left join BIS_INSP_KEY_REGISTER bi on mo.reg_Id=bi.id
  489. where m.PBLM_ID=#{pblmId}
  490. </select>
  491. <select id="findAll" resultMap="bisInspPblmResultMap">
  492. select
  493. <include refid="table_columns"/>
  494. from bis_insp_pblm
  495. </select>
  496. <select id="findList" resultMap="bisInspPblmResultMap">
  497. select
  498. attach_Bz,
  499. CWS_CODE,HAS_VEDIO,PROBLEM_TYPE,QUALITY_TYPE_ID,DEFECT_TYPE_ID,FDBK_ID,ITEM_ID,WATER_USER_ID,GONGDI_BZ_ID,
  500. VILLAGE_CODE,
  501. VILL_TYPE,
  502. PBLMS_TYPE_ID,
  503. REGID,
  504. COMMON_FILE_IDS,
  505. FILE_NO,
  506. FILE_NO_NUMBER,
  507. PBLMS_ID,
  508. PBLM_ID,
  509. OBJ_ID,
  510. OBJ_TYPE,
  511. INSP_GROUP_ID,
  512. PGUID,
  513. INSP_PBLM_TYPE,
  514. INSP_PBLM_CODE,
  515. INSP_PBLM_NAME,
  516. INSP_PBLM_DESC,
  517. INSP_ADD_DESC,
  518. PBLM_LONG,
  519. PBLM_LAT,
  520. IF_CASE_PBLM,
  521. INSP_PBLM_ORG_NAME,
  522. PBLM_PERS_NAME,
  523. INSP_PBLM_CATE,
  524. REL_BASIS,
  525. PBLM_STAT,
  526. REVI_OPIN,
  527. REVI_CONC,
  528. REVI_ORG_GUID,
  529. DATA_STAT,
  530. COLL_TIME,
  531. REC_PERS,
  532. NOTE,QUOTE,
  533. UP_TM,PBLM_NAME_BZ,CHECK_POINT_BZ,SN_NUM_BZ,PBLM_DESC_BZ,NEW_VILL_NAME,
  534. PBLM_REASON,
  535. PBLM_SGGTN,WTDST_NOTE,
  536. OBJ_CODE,OBJ_NAME,OBJ_AD_CODE,PROVINCIAL,BELONG_ORG_ID,BELONG_AD_CODE
  537. from bis_insp_pblm
  538. <include refid="page_where"/>
  539. </select>
  540. <sql id="page_search">
  541. <trim prefix="where" prefixOverrides="and | or ">
  542. <if test="persName != null and persName != ''">and PERS_NAME like '%${persName}%'</if>
  543. <if test="inspPblmCate != null and inspPblmCate != ''">and INSP_PBLM_CATE = #{inspPblmCate}</if>
  544. <if test="ifCasePblm != null and ifCasePblm != ''">and IF_CASE_PBLM = #{ifCasePblm}</if>
  545. <if test="dataStat != null and dataStat != ''">and DATA_STAT = #{dataStat}</if>
  546. <if test="inspPblmName != null and inspPblmName != ''">and INSP_PBLM_NAME like '%${inspPblmName}%'</if>
  547. <if test="pblmDescBz != null and pblmDescBz != ''">and PBLM_DESC_BZ like '%${pblmDescBz}%'</if>
  548. <if test="inspPblmsName != null and inspPblmsName != ''">and INSP_PBLMS_NAME like '%${inspPblmsName}%'</if>
  549. <if test="newVillName != null and newVillName != ''">and NEW_VILL_NAME = #{newVillName}</if>
  550. <if test="regid != null and regid != ''">and regid = #{regid}</if>
  551. <if test="rgstrId != null and rgstrId != ''">and regid = #{rgstrId}</if>
  552. <if test="objType != null and objType != ''">and obj_type = #{objType}</if>
  553. <if test="waterUserId != null and waterUserId != ''">and WATER_USER_ID = #{waterUserId}</if>
  554. <choose>
  555. <when test="villType == '34' ">
  556. AND CWS_CODE IS NULL
  557. </when>
  558. <when test="villType == '33' ">
  559. AND WATER_USER_ID IS NULL
  560. </when>
  561. <when test="villType != null and villType != '' ">and VILL_TYPE in (${villType})</when>
  562. </choose>
  563. <if test="villageCode != null and villageCode != ''">and village_Code = #{villageCode}</if>
  564. <if test="cwsCode != null and cwsCode != ''">and cws_Code = #{cwsCode}</if>
  565. <if test="code != null and code != ''">and CODE = #{code}</if>
  566. <if test="codes != null and codes != ''">and CODE in (${codes})</if>
  567. <if test="hasVedio != null and hasVedio != ''">and HAS_VEDIO = #{hasVedio}</if>
  568. <if test="recPers != null and recPers != ''">and REC_PERS = #{recPers}</if>
  569. <if test="objId != null and objId != ''">and OBJ_ID =#{objId}</if>
  570. <if test="objIdes != null and objIdes != ''">and OBJ_ID in (${objIdes})</if>
  571. <if test="nm != null and nm != ''">and nm like '%${nm}%'</if>
  572. <if test="startTime != null and startTime != ''">and COLL_TIME &gt;= TO_DATE(#{startTime},'YYYY-MM-DD')</if>
  573. <if test="findTime != null and findTime != ''">and COLL_TIME=TO_DATE(#{findTime},'YYYY-MM-DD')</if>
  574. <if test="endTime != null and endTime != ''">and COLL_TIME &lt; TO_DATE(#{endTime},'YYYY-MM-DD')+1</if>
  575. <if test="pblmStat != null and pblmStat != ''">and PBLM_Stat = #{pblmStat}</if>
  576. <if test="srcDesc != null and srcDesc != ''">and srcDesc like '%${srcDesc}%'</if>
  577. <if test="oides != null and oides != ''">and oid in (${oides})</if>
  578. <if test="adCode != null and adCode != ''">and CODE like '${adCode}%'</if>
  579. <if test="engScal != null and engScal != ''">and eng_Scal =#{engScal}</if>
  580. <if test="wagaScal != null and wagaScal != ''">and waga_Scal =#{wagaScal}</if>
  581. <if test="gateType != null and gateType != ''">and gate_Type =#{gateType}</if>
  582. <if test="sttp != null and sttp != ''">and sttp =#{sttp}</if>
  583. <if test="rePtype != null and rePtype != ''">and re_Ptype =#{rePtype}</if>
  584. <if test="pnm != null and pnm != ''">and pnm =#{pnm}</if>
  585. <!--and COLL_TIME &gt;= TO_DATE('2020-01-01','YYYY-MM-DD')-->
  586. </trim>
  587. </sql>
  588. <sql id="orgIdSql">
  589. <choose>
  590. <when test="orgId !=null and orgId !=''">
  591. and ORG_ID=#{orgId}
  592. </when>
  593. <otherwise>
  594. and ORG_ID is null
  595. </otherwise>
  596. </choose>
  597. </sql>
  598. <select id="listOfPage" resultMap="bisInspPblmResultMap"
  599. parameterType="cn.com.goldenwater.dcproj.param.BisInspPblmParam">
  600. SELECT * FROM (
  601. SELECT
  602. P.*, O.NM, O.OBJ_AD_CODE AS AD_CODE,
  603. AAB.AD_NAME, AAB.AD_FULL_NAME, RP.PERS_NAME, A.PNM, T.NAME AS OBJ_TYPE_NAME
  604. FROM BIS_INSP_PBLM P
  605. JOIN BIS_INSP_ALL_OBJ O on P.OBJ_ID = O.OBJ_ID
  606. JOIN (select * FROM ATT_INSP_TYPE where code IN (select INSP_TYPE FROM REL_ORG_INSP_TYPE
  607. <where>
  608. <if test="orgId != null and orgId != '' ">
  609. AND ORG_ID = #{orgId}
  610. </if>
  611. </where>
  612. )) T on P.OBJ_TYPE = T.PTYPE
  613. <!-- JOIN (-->
  614. <!-- <foreach collection="rgsterTable" index="index" item="item">-->
  615. <!-- <if test="index != 0">-->
  616. <!-- UNION ALL-->
  617. <!-- </if>-->
  618. <!-- <choose>-->
  619. <!-- <when test="item == 'BIS_INSP_GRW' ">-->
  620. <!-- SELECT OBJ_ID, INSP_STATE AS "STATE" FROM BIS_INSP_GRW WHERE INSP_STATE = '2'-->
  621. <!-- </when>-->
  622. <!-- <otherwise>-->
  623. <!-- SELECT OBJ_ID, STATE FROM ${item} WHERE STATE = '2'-->
  624. <!-- </otherwise>-->
  625. <!-- </choose>-->
  626. <!-- </foreach>-->
  627. <!-- ) R ON R.OBJ_ID = o.OBJ_ID-->
  628. LEFT JOIN ATT_AD_BASE AAB on O.OBJ_AD_CODE = AAB.AD_CODE
  629. LEFT JOIN BIS_INSP_ALL_RLATION_PERS RP on P.REC_PERS = RP.GUID
  630. LEFT JOIN BIS_INSP_ALL A on A.ID = O.ID
  631. <if test='null != pblmStat and pblmStat != "" and "5" == pblmStat'>
  632. LEFT JOIN BIS_INSP_PBLM_PLIST Pl ON PL.PBLM_ID = P.PBLM_ID and PL.DATA_STAT='0'
  633. </if>
  634. <where>
  635. <if test="orgId != null and orgId != '' ">O.ID LIKE '___${orgId}%'</if>
  636. <if test='null != pblmStat and pblmStat != "" and "5" == pblmStat'>
  637. and PL.PBLM_OUT = '1'
  638. </if>
  639. </where>
  640. ) A
  641. <where>
  642. <if test="depm != null and depm.length > 0 ">
  643. AND OBJ_TYPE IN (SELECT TO_NUMBER(PTYPE) FROM ATT_INSP_TYPE_DUTY where DUTY_DEP IN
  644. <foreach item="item" index="index" collection="depm" open="(" separator="," close=")">
  645. '${item}'
  646. </foreach>
  647. )
  648. </if>
  649. <if test="persName != null and persName != ''">and PERS_NAME like '%${persName}%'</if>
  650. <if test="inspPblmCate != null and inspPblmCate != ''">and INSP_PBLM_CATE = #{inspPblmCate}</if>
  651. <if test="ifCasePblm != null and ifCasePblm != ''">and IF_CASE_PBLM = #{ifCasePblm}</if>
  652. <if test="inspPblmName != null and inspPblmName != ''">and INSP_PBLM_NAME like '%${inspPblmName}%'</if>
  653. <if test="objType != null and objType != ''">and obj_type = #{objType}</if>
  654. <if test="objTypeName != null and objTypeName != ''">and OBJ_TYPE_NAME LIKE '%${objTypeName}%'</if>
  655. <if test="hasVedio != null and hasVedio != ''">and HAS_VEDIO = #{hasVedio}</if>
  656. <if test="objId != null and objId != ''">and OBJ_ID =#{objId}</if>
  657. <if test="nm != null and nm != ''">and nm like '%${nm}%'</if>
  658. <if test="startTime != null and startTime != ''">and COLL_TIME &gt;= TO_DATE(#{startTime},'YYYY-MM-DD')</if>
  659. <if test="endTime != null and endTime != ''">and COLL_TIME &lt; TO_DATE(#{endTime},'YYYY-MM-DD') + 1</if>
  660. <if test="sttm != null and sttm != '' and entm != null and entm != '' ">
  661. AND COLL_TIME &gt;= TO_DATE(#{sttm}, 'YYYY-MM-DD')
  662. AND COLL_TIME &lt; TO_DATE(#{entm}, 'YYYY-MM-DD') + 1
  663. </if>
  664. <if test="adCode != null and adCode != ''">and AD_CODE like '${adCode}%'</if>
  665. <!-- 福建省 福州市排除 平潭县 把平潭县 归属到 平潭综合实验区-->
  666. <if test='adCode != null and adCode == "3501" '>AND SUBSTR(AD_CODE, 0, 6) !='350128'</if>
  667. <if test='adCode != null and adCode == "3510" '>AND SUBSTR(AD_CODE, 0, 6) ='350128'</if>
  668. <if test="pnm != null and pnm != ''">and pnm like '%${pnm}%'</if>
  669. <if test="orgNm != null and orgNm != ''">and pnm like '%${orgNm}%'</if>
  670. <if test="adFullName != null and adFullName != ''">and REPLACE(AD_FULL_NAME, '-', '') LIKE
  671. '%${adFullName}%'
  672. </if>
  673. </where>
  674. </select>
  675. <select id="list" resultMap="bisInspPblmResultMap"
  676. parameterType="cn.com.goldenwater.dcproj.param.BisInspPblmParam">
  677. SELECT
  678. *
  679. FROM BIS_INSP_PBLM
  680. <where>
  681. <if test="inspPblmCate != null and inspPblmCate != ''">and INSP_PBLM_CATE = #{inspPblmCate}</if>
  682. <if test="ifCasePblm != null and ifCasePblm != ''">and IF_CASE_PBLM = #{ifCasePblm}</if>
  683. <if test="inspPblmName != null and inspPblmName != ''">and INSP_PBLM_NAME like '%${inspPblmName}%'</if>
  684. <if test="objType != null and objType != ''">and obj_type = #{objType}</if>
  685. <if test="objTypeName != null and objTypeName != ''">and OBJ_TYPE_NAME LIKE '%${objTypeName}%'</if>
  686. <if test="hasVedio != null and hasVedio != ''">and HAS_VEDIO = #{hasVedio}</if>
  687. <if test="objId != null and objId != ''">and OBJ_ID =#{objId}</if>
  688. <if test="startTime != null and startTime != ''">and COLL_TIME &gt;= TO_DATE(#{startTime},'YYYY-MM-DD')</if>
  689. <if test="endTime != null and endTime != ''">and COLL_TIME &lt; TO_DATE(#{endTime},'YYYY-MM-DD') + 1</if>
  690. <if test="adCode != null and adCode != ''">and AD_CODE like '${adCode}%'</if>
  691. <if test="pnm != null and pnm != ''">and pnm like '%${pnm}%'</if>
  692. <if test="orgNm != null and orgNm != ''">and pnm like '%${orgNm}%'</if>
  693. <if test="regid != null and regid != ''">and REGID like '%${regid}%'</if>
  694. </where>
  695. </select>
  696. <select id="findPlbmList" resultMap="bisInspPblmResultMap"
  697. parameterType="cn.com.goldenwater.dcproj.param.PlbmParam">
  698. select * from (
  699. select w.* from (
  700. select
  701. CASE WHEN P.VILLAGE_CODE IS NOT NULL THEN AD.AD_NAME
  702. WHEN P.OBJ_TYPE='3' THEN H.AD_NM
  703. WHEN P.CWS_CODE IS NOT NULL THEN E.CWS_NAME
  704. ELSE J.NM END AS srcDesc,
  705. e.cws_name,j.code,j.nm,j.id as oid,ad.ad_code,
  706. R.PERS_NAME, P.*,
  707. NVL(P.INSP_PBLM_NAME,P.PBLM_NAME_BZ) AS INSP_PBLMS_NAME, P.PBLM_DESC_BZ AS PBLM_DESC,P.CHECK_POINT_BZ AS CHECK_POINT,
  708. S.ATTACH,S.SN_NUM,S.SHEET,
  709. <if test='villType == "8" or villType=="9" '>u.nm as unit_nm,</if>
  710. <if test='villType=="0" or objType=="1" or objType=="36"'>g.eng_scal,</if>
  711. <if test='villType=="7" or objType=="6"'>wa.eng_scal as waga_Scal,wa.gate_type,</if>
  712. <if test='villType=="5" or objType=="5"'>gr.sttp,</if>
  713. <if test='villType=="8" or villType=="9"'>BA.ptype as re_ptype,</if>
  714. (select l.pnm from bis_insp_all l where l.id=substr(al.id,0,6)) as pnm,
  715. al.sttm, al.entm
  716. from BIS_INSP_PBLM p
  717. join (select * from bis_insp_all_obj o
  718. <where>
  719. <include refid="choseSql"/>
  720. </where>
  721. ) J ON P.OBJ_ID=J.OBJ_ID
  722. LEFT JOIN BIS_INSP_ALL_RLATION_PERS R ON P.REC_PERS=R.GUID
  723. LEFT JOIN OBJ_INSP_PBLMS S ON P.PBLMS_TYPE_ID=S.GUID
  724. LEFT JOIN ATT_CWS_BASE E ON J.CODE=E.CWS_CODE
  725. LEFT JOIN ATT_AD_X_BASE AD ON P.VILLAGE_CODE = AD.AD_CODE
  726. LEFT JOIN BIS_INSP_WTDST_TRACK H ON P.REGID = H.TRACK_ID
  727. <if test='villType=="8"'>left join BIS_INSP_KEY_REG_SEC_UNIT u on p.regid=u.id</if>
  728. <if test='villType=="9"'>left join att_mampu_info u on p.regid=u.id</if>
  729. <if test='villType=="0" or objType=="1" or objType=="36"'>left join bis_insp_rsvr_rgstr g on
  730. j.obj_id=g.obj_id
  731. </if>
  732. <if test='villType=="7" or objType=="6"'>left join att_waga_rgstr wa on j.obj_id=wa.obj_id</if>
  733. <if test='villType=="5" or objType=="5"'>left join BIS_INSP_GRW gr on j.obj_id=gr.obj_id</if>
  734. <if test='villType=="8" or villType=="9"'>left join bis_insp_key_register BA on j.obj_id=BA.obj_id</if>
  735. <choose>
  736. <when test='objType=="17" '>left join BIS_INSP_OPRD_CSTR_PROJ_RGSTR BA on j.obj_id=BA.obj_id</when>
  737. <when test='objType=="18" '>left join ATT_JSKEJIAN_FLKDIS_RGSTR BA on j.obj_id=BA.obj_id</when>
  738. <when test='objType=="19" '>left join ATT_JSKEJIAN_WATER_RGSTR BA on j.obj_id=BA.obj_id</when>
  739. <when test='objType == "20"'>LEFT JOIN ATT_JSKEJIAN_ECOFRD_RGSTR BA on j.obj_id = BA.obj_id</when>
  740. <when test='objType == "22"'>LEFT JOIN BIS_INSP_RSML_RGSTR BA on j.obj_id = BA.obj_id</when>
  741. <when test='objType=="28"'>left join bis_insp_IRR_RGSTR BA on j.obj_id = BA.obj_id</when>
  742. <when test='objType=="62"'>left join BIS_INSP_CDEP_RGSTR BA on j.obj_id = BA.obj_id</when>
  743. <when test='objType=="67"'>left join BIS_INSP_BID_RGSTR BA on j.obj_id = BA.obj_id</when>
  744. <when test='objType=="68"'>left join BIS_INSP_RLRW_RGSTR BA on j.obj_id = BA.obj_id</when>
  745. <when test='objType=="69"'>left join BIS_INSP_DRDMP_RGSTR BA on j.obj_id = BA.obj_id</when>
  746. <when test='objType=="70"'>left join BIS_INSP_GROW_RGSTR BA on j.obj_id = BA.obj_id</when>
  747. <when test='objType=="73"'>left join BIS_INSP_HYST_RGSTR BA on j.obj_id = BA.obj_id</when>
  748. <when test='objType=="98"'>left join BIS_INSP_FUND_RGSTR BA on j.obj_id = BA.obj_id</when>
  749. <when test='objType == "99"'>LEFT JOIN BIS_INSP_KEYSAFQH_REGISTER BA ON BA.OBJ_ID = J.OBJ_ID</when>
  750. <when test='objType == "100"'>LEFT JOIN BIS_INSP_KEYCHKQH_REGISTER BA ON BA.OBJ_ID = J.OBJ_ID</when>
  751. <when test='objType == "101"'>LEFT JOIN BIS_INSP_SVWTQH BA ON BA.OBJ_ID = J.OBJ_ID</when>
  752. <when test='objType == "104"'>LEFT JOIN BIS_INSP_STSTN BA ON BA.OBJ_ID = J.OBJ_ID</when>
  753. <when test='objType == "105"'>LEFT JOIN BIS_INSP_QYMTEN BA ON BA.OBJ_ID = J.OBJ_ID</when>
  754. <when test='objType == "106"'>LEFT JOIN BIS_INSP_RSVRYN_RGSTR BA ON BA.OBJ_ID = J.OBJ_ID</when>
  755. <when test='objType == "108"'>LEFT JOIN BIS_INSP_XJVILL BA ON BA.OBJ_ID = J.OBJ_ID</when>
  756. <when test='objType == "110"'>LEFT JOIN BIS_INSP_FJWTENF BA ON BA.OBJ_ID = J.OBJ_ID</when>
  757. <when test='objType == "112"'>LEFT JOIN BIS_INSP_WIUJS_RGSTR BA ON BA.OBJ_ID = J.OBJ_ID</when>
  758. <when test='objType == "113"'>LEFT JOIN BIS_INSP_SWHSJS BA ON BA.OBJ_ID = J.OBJ_ID</when>
  759. <when test='objType == "115"'>LEFT JOIN BIS_INSP_RSVR_SD BA ON BA.OBJ_ID = J.OBJ_ID</when>
  760. <when test='objType == "116"'>LEFT JOIN BIS_INSP_HYSTP BA ON BA.OBJ_ID = J.OBJ_ID</when>
  761. <when test='objType == "119"'>LEFT JOIN BIS_INSP_FJQA BA ON BA.OBJ_ID = J.OBJ_ID</when>
  762. <when test='objType == "120"'>LEFT JOIN BIS_INSP_JSPWIU BA ON BA.OBJ_ID = J.OBJ_ID</when>
  763. <when test='objType == "126"'>LEFT JOIN BIS_INSP_JSPWIU2024 BA ON BA.OBJ_ID = J.OBJ_ID</when>
  764. <otherwise>LEFT JOIN BIS_INSP_GNRL_RGSTR BA ON BA.OBJ_ID = J.OBJ_ID</otherwise>
  765. </choose>
  766. left join bis_insp_all al on al.id=j.id
  767. ) w
  768. where 1=1
  769. <if test="tabType =='2'.toString()">
  770. and w.entm &lt;to_date(#{nowTime},'yyyy-MM-dd')+1
  771. </if>
  772. <if test="tabType =='1'.toString()">
  773. and w.entm &gt;=to_date(#{nowTime},'yyyy-MM-dd') and w.sttm &lt; to_date(#{nowTime},'yyyy-MM-dd')+1
  774. </if>
  775. <if test="timeType =='1'.toString()">
  776. and w.COLL_TIME >=to_date(#{nowTime},'yyyy-MM-dd')
  777. </if>
  778. <if test="timeType =='2'.toString()">
  779. and w.COLL_TIME &gt;=to_date(#{nowMonth},'yyyy-MM')
  780. </if>
  781. <if test="timeType =='3'.toString()">
  782. and w.COLL_TIME &gt;=to_date(#{nowYear},'yyyy')
  783. </if>
  784. <if test="inspPblmName !=null and inspPblmName !=''">
  785. and w.insp_pblm_name like '%${inspPblmName}%'
  786. </if>
  787. and REGEXP_LIKE(W.OID,'^('|| ( case when(SELECT count(id) from BIS_INSP_ALL_RLATION WHERE PERSID =#{presId}
  788. <include refid="orgIdSql"/>
  789. )>0 then
  790. (SELECT LISTAGG(id, '|') WITHIN GROUP(ORDER BY PERSID) as id FROM BIS_INSP_ALL_RLATION WHERE PERSID =#{presId}
  791. <include refid="orgIdSql"/>
  792. ) else (select 'non' from dual) end) ||')')
  793. ) a
  794. <include refid="page_search"/>
  795. order by
  796. <if test="orderBy !=null and orderBy !=''">
  797. ${orderBy},
  798. </if>
  799. PBLM_ID
  800. </select>
  801. <!--精确获取每一个'+'后的数据-->
  802. <select id="findAddPlusPblm" resultMap="bisInspPblmResultMap">
  803. select j.nm,j.code,m.*,s.insp_pblms_name,s.check_point,r.pers_name from BIS_INSP_RSVR_PBLM p
  804. join bis_insp_pblm m on p.pblm_id=m.pblm_id and m.rec_pers=#{persId}
  805. left join BIS_INSP_ALL_OBJ j on m.obj_id=j.obj_id
  806. left join OBJ_INSP_PBLMS s on m.pblms_type_id=s.guid
  807. left join BIS_INSP_ALL_RLATION_PERS r on m.rec_pers=r.guid
  808. </select>
  809. <!--获取问题与文件关系-->
  810. <select id="findPblmBindFiles" resultType="cn.com.goldenwater.dcproj.model.PblmDoc"
  811. parameterType="cn.com.goldenwater.dcproj.param.DocType">
  812. select
  813. pblm_id,
  814. LISTAGG(f.file_path, ',') WITHIN GROUP(ORDER BY pblm_id) as filePathes,
  815. LISTAGG(f.file_ext, ',') WITHIN GROUP(ORDER BY pblm_id) as fileExtes
  816. from (
  817. select w.* from (
  818. select j.code,j.nm,j.id as oid,j.ptype,p.* from (
  819. select * from BIS_INSP_PBLM where 1=1
  820. <if test="hasVedio != null and hasVedio != ''">and HAS_VEDIO = #{hasVedio}</if>
  821. <if test="startTime != null and startTime != ''">and COLL_TIME &gt;= TO_DATE(#{startTime},'YYYY-MM-DD')</if>
  822. <if test="findTime != null and findTime != ''">and COLL_TIME=TO_DATE(#{findTime},'YYYY-MM-DD')</if>
  823. <if test="endTime != null and endTime != ''">and COLL_TIME &lt;= TO_DATE(#{endTime},'YYYY-MM-DD')+1</if>
  824. <if test="inspPblmCate != null and inspPblmCate != ''">and INSP_PBLM_CATE = #{inspPblmCate}</if>
  825. <if test="ifCasePblm != null and ifCasePblm != ''">and IF_CASE_PBLM = #{ifCasePblm}</if>
  826. <if test="pType != null and pType != ''">and obj_type = #{pType}</if>
  827. <if test="villType != null and villType != ''">and VILL_TYPE = #{villType}</if>
  828. <if test="problemType != null and problemType != ''">and problem_Type = #{problemType}</if>
  829. <if test="pblmIds != null and pblmIds != ''">and pblm_id in (${pblmIds})</if>
  830. ) p
  831. join (
  832. select * from BIS_INSP_ALL_OBJ o where o.ptype=#{pType}
  833. <include refid="choseSql"/>
  834. ) j on p.obj_id=j.obj_id
  835. ) w where
  836. REGEXP_LIKE(
  837. W.OID,'^('||
  838. ( case when(SELECT count(id) from BIS_INSP_ALL_RLATION WHERE PERSID =#{persId}
  839. <include refid="orgIdSql"/>
  840. )>0 then
  841. (SELECT LISTAGG(id, '|') WITHIN GROUP(ORDER BY PERSID) as
  842. id FROM BIS_INSP_ALL_RLATION WHERE PERSID =#{persId}
  843. <include refid="orgIdSql"/>
  844. )
  845. else (select 'non' from dual) end)
  846. ||')')
  847. ) a ,gw_com_file f where a.pblm_id=f.biz_id group by pblm_id
  848. </select>
  849. <!--172工程,该方法需要修改对应的标准库-->
  850. <select id="findKeyRegPlbmList" resultType="cn.com.goldenwater.dcproj.model.KeyRegPblm"
  851. parameterType="cn.com.goldenwater.dcproj.param.KeyRegPatam">
  852. select * from (
  853. select w.* from (
  854. select j.code,j.nm,j.id as oid,j.ptype,r.PERS_NAME,p.*,
  855. u.nature,e.revi_org,l.pnm as org_nm,l.entm,l.sttm,j.id as org_id,u.sec_id,
  856. (select s.attach||'-'||s.sheet from obj_key_pblms s where s.id=QUALITY_TYPE_ID) as attach_qua,
  857. (select s.sn from obj_key_pblms s where s.id=QUALITY_TYPE_ID) as attach_qua_sn,
  858. (select s.attach_name from obj_key_pblms s where s.id=QUALITY_TYPE_ID) as attach_qua_name,
  859. (select s.attach||'-'||s.sheet from obj_key_pblms s where s.id=DEFECT_TYPE_ID) as attach_def,
  860. (select s.sn from obj_key_pblms s where s.id=DEFECT_TYPE_ID) as attach_def_sn,
  861. (select s.attach_name from obj_key_pblms s where s.id=DEFECT_TYPE_ID) as attach_def_name,
  862. (select s.attach||'-'||s.sheet from obj_key_pblms s where s.id=PBLMS_TYPE_ID) as attach_wg,
  863. (select s.sn from obj_key_pblms s where s.id=PBLMS_TYPE_ID) as attach_wg_sn,
  864. (select s.attach_name from obj_key_pblms s where s.id=PBLMS_TYPE_ID) as attach_wg_name,
  865. (select s.attach||'-'||s.sheet from obj_key_pblms s where s.id=PBLMS_ID) as attach_hetong,
  866. (select s.sn from obj_key_pblms s where s.id=PBLMS_ID) as attach_hetong_sn,
  867. (select s.attach_name from obj_key_pblms s where s.id=PBLMS_ID) as attach_hetong_name,
  868. (select s.attach||'-'||s.sheet from obj_key_pblms s where s.id=gongdi_bz_id) as attach_Gongdi,
  869. (select s.sn from obj_key_pblms s where s.id=gongdi_bz_id) as attach_Gongdi_sn,
  870. (select s.attach_name from obj_key_pblms s where s.id=gongdi_bz_id) as attach_Gongdi_name
  871. ,u.nm as unit_nm,
  872. k.rect_meas,k.guid,(case when k.data_stat is null then '0' else k.data_stat end) as check_stat,
  873. k.rect_conc,k.note as rectNote,k.org_guid,k.coll_time as rect_time,case when mo.lev='1' then mo.nm else '' end
  874. as first_Name,case when mo.lev='2' then mo.nm else '' end as second_Name,case when mo.lev='3' then mo.nm else ''
  875. end as third_Name,
  876. s.nm as sec_name
  877. from (select * from BIS_INSP_PBLM pb where pb.obj_type=#{pType}
  878. <if test="inspPblmCate != null and inspPblmCate != ''">and pb.INSP_PBLM_CATE = #{inspPblmCate}</if>
  879. <if test="ifCasePblm != null and ifCasePblm != ''">and pb.IF_CASE_PBLM = #{ifCasePblm}</if>
  880. <if test="hasVedio != null and hasVedio != ''">and pb.HAS_VEDIO = #{hasVedio}</if>
  881. <if test="inspPblmName != null and inspPblmName != ''">and pb.INSP_PBLM_NAME like '%${inspPblmName}%'</if>
  882. <if test="reviConc =='0'.toString()">
  883. <if test="startTime != null and startTime != ''">
  884. AND pb.COLL_TIME &gt;= TO_DATE(#{startTime},'YYYY-MM-DD')
  885. </if>
  886. <if test="findTime != null and findTime != ''">and pb.COLL_TIME=TO_DATE(#{findTime},'YYYY-MM-DD')</if>
  887. <if test="endTime != null and endTime != ''">
  888. AND pb.COLL_TIME &lt;= TO_DATE(#{endTime},'YYYY-MM-DD')+1
  889. </if>
  890. </if>
  891. ) p
  892. join (select * from BIS_INSP_ALL_OBJ o where o.pType=#{pType}
  893. <if test="objId != null and objId != ''">and OBJ_ID = #{objId}</if>
  894. <include refid="choseSql"/>
  895. ) j on p.obj_id=j.obj_id
  896. join BIS_INSP_ALL_RLATION_PERS r on p.rec_pers=r.guid
  897. left join bis_insp_rect_fdbk k on p.pblm_id=k.pblm_id and k.guid=p.FDBK_ID
  898. <choose>
  899. <when test='pType == "99"'>
  900. left join BIS_INSP_KEYSAFQH_REGISTER_UNI u on p.regid=u.id
  901. </when>
  902. <when test='pType == "100"'>
  903. left join BIS_INSP_KEYCHKQH_UNIT u on p.regid=u.id
  904. </when>
  905. <otherwise>
  906. left join BIS_INSP_KEY_REG_SEC_UNIT u on p.regid=u.id
  907. </otherwise>
  908. </choose>
  909. left join (
  910. select revi_org , org_type from obj_key_pblm_rel l where l.org_type is not null group by revi_org,org_type order
  911. by org_type
  912. ) e on e.org_type=u.nature
  913. left join BIS_INSP_ALL l on l.id=j.id
  914. left join ATT_MAMPU_INFO mo on p.regid = mo.id
  915. <choose>
  916. <when test='pType == "99"'>
  917. left join BIS_INSP_KEYSAFQH_REGISTER_SEC s on u.sec_id = s.id
  918. </when>
  919. <when test='pType == "100"'>
  920. left join BIS_INSP_KEYCHKQH_SECTION s on u.sec_id = s.id
  921. </when>
  922. <otherwise>
  923. left join BIS_INSP_KEY_REGISTER_SECTION s on u.sec_id = s.id
  924. </otherwise>
  925. </choose>
  926. ) w where w.ptype=#{pType}
  927. <if test="tabType =='2'.toString()">
  928. and w.entm &lt;to_date(#{nowTime},'yyyy-MM-dd')+1
  929. </if>
  930. <if test="tabType =='1'.toString()">
  931. and w.entm &gt;=to_date(#{nowTime},'yyyy-MM-dd')
  932. </if>
  933. and
  934. REGEXP_LIKE(
  935. W.OID,'^('||
  936. ( case when(SELECT count(id) from BIS_INSP_ALL_RLATION WHERE PERSID =#{persId}
  937. <include refid="orgIdSql"/>
  938. )>0 then
  939. (SELECT LISTAGG(id, '|') WITHIN GROUP(ORDER BY PERSID) as
  940. id FROM BIS_INSP_ALL_RLATION WHERE PERSID =#{persId}
  941. <include refid="orgIdSql"/>
  942. )
  943. else (select 'non' from dual) end)
  944. ||')')
  945. ) a where 1=1
  946. <if test="nm != null and nm != ''">and nm like '%${nm}%'</if>
  947. <if test="orgNm != null and orgNm != ''">and org_nm like '%${orgNm}%'</if>
  948. <if test="problemType != null and problemType != ''">and problem_Type = #{problemType}</if>
  949. <if test="persName != null and persName != ''">and PERS_NAME like '%${persName}%'</if>
  950. <if test="reviConc != null and reviConc != ''">and REVI_CONC = #{reviConc}</if>
  951. <if test="regId != null and regId != ''">and regId= #{regId}</if>
  952. <if test="villType != null and villType != ''">and vill_type = #{villType}</if>
  953. <if test="codes != null and codes != ''">and CODE in (${codes})</if>
  954. <if test="recPers !=null and recPers !=''">and rec_pers=#{recPers}</if>
  955. <if test="rectConc != null and rectConc != ''">and RECT_CONC in (${rectConc})</if>
  956. <if test="orgIds != null and orgIds != ''">and org_id in (${orgIds})</if>
  957. <if test="inspPblmType != null and inspPblmType != ''">and INSP_PBLM_TYPE = #{inspPblmType}</if>
  958. <if test="secId != null and secId != ''">and SEC_ID = #{secId}</if>
  959. <if test="state != null and state != ''">and STATE = #{state}</if>
  960. <if test="reviConc !='0'.toString()">
  961. <if test="startTime != null and startTime != ''">
  962. AND RECT_TIME &gt;= TO_DATE(#{startTime},'YYYY-MM-DD')
  963. </if>
  964. <if test="findTime != null and findTime != ''">and RECT_TIME=TO_DATE(#{findTime},'YYYY-MM-DD')</if>
  965. <if test="endTime != null and endTime != ''">
  966. AND RECT_TIME &lt; TO_DATE(#{endTime},'YYYY-MM-DD')+1
  967. </if>
  968. </if>
  969. <choose>
  970. <when test="orderBy !=null and orderBy !=''">
  971. ${orderBy}
  972. </when>
  973. <otherwise>
  974. order by coll_time desc
  975. </otherwise>
  976. </choose>
  977. </select>
  978. <select id="findJswaPlbmList" parameterType="cn.com.goldenwater.dcproj.param.PrdParam"
  979. resultMap="bisInspPblmResultMap">
  980. select * from (
  981. select w.* from (
  982. select ba.name ,j.code,j.nm,j.id as
  983. oid,j.ptype,r.PERS_NAME,l.sttm,l.entm,p.*,b.ad_full_name,
  984. b.ad_code,l.pnm as org_nm,j.id as org_id
  985. from (select * from BIS_INSP_PBLM pb where pb.obj_type=19
  986. <if test="inspPblmCate != null and inspPblmCate != ''">and pb.INSP_PBLM_CATE = #{inspPblmCate}</if>
  987. <if test="ifCasePblm != null and ifCasePblm != ''">and pb.IF_CASE_PBLM = #{ifCasePblm}</if>
  988. <if test="hasVedio != null and hasVedio != ''">and pb.HAS_VEDIO = #{hasVedio}</if>
  989. <if test="startTime != null and startTime != ''">
  990. AND pb.COLL_TIME &gt;= TO_DATE(#{startTime},'YYYY-MM-DD')
  991. </if>
  992. <if test="findTime != null and findTime != ''">and pb.COLL_TIME=TO_DATE(#{findTime},'YYYY-MM-DD')</if>
  993. <if test="endTime != null and endTime != ''">
  994. AND pb.COLL_TIME &lt; TO_DATE(#{endTime},'YYYY-MM-DD')+1
  995. </if>
  996. <if test="inspPblmName != null and inspPblmName != ''">and pb.INSP_PBLM_NAME like '%${inspPblmName}%'</if>
  997. ) p
  998. left join (select * from BIS_INSP_ALL_OBJ o where o.pType=19
  999. <if test="objId != null and objId != ''">and o.OBJ_ID = #{objId}</if>
  1000. <include refid="choseSql"/>
  1001. ) j on p.obj_id=j.obj_id
  1002. left join BIS_INSP_ALL_RLATION_PERS r on p.rec_pers=r.guid
  1003. left join ATT_JSKEJIAN_WATER_BASE ba on ba.id=j.code
  1004. left join att_ad_x_base b on ba.ad_code=b.ad_code
  1005. left join BIS_INSP_ALL l on l.id=j.id
  1006. ) w where w.pType=19
  1007. <if test="tabType =='2'.toString()">
  1008. and w.entm &lt;to_date(#{nowTime},'yyyy-MM-dd')+1
  1009. </if>
  1010. <if test="tabType =='1'.toString()">
  1011. and w.entm &gt;=to_date(#{nowTime},'yyyy-MM-dd')
  1012. </if>
  1013. and
  1014. REGEXP_LIKE(
  1015. W.OID,'^('||
  1016. ( case when(SELECT count(id) from BIS_INSP_ALL_RLATION WHERE PERSID =#{persId}
  1017. <include refid="orgIdSql"/>
  1018. )>0 then
  1019. (SELECT LISTAGG(id, '|') WITHIN GROUP(ORDER BY PERSID) as
  1020. id FROM BIS_INSP_ALL_RLATION WHERE PERSID =#{persId}
  1021. <include refid="orgIdSql"/>
  1022. )
  1023. else (select 'non' from dual) end)
  1024. ||')')
  1025. ) a where 1=1
  1026. <if test="orgNm != null and orgNm != ''">and org_nm like '%${orgNm}%'</if>
  1027. <if test="name != null and name != ''">and name like '%${name}%'</if>
  1028. <if test="adFullName != null and adFullName != ''">and ad_full_name like '%${adFullName}%'</if>
  1029. <if test="persName != null and persName != ''">and PERS_NAME like '%${persName}%'</if>
  1030. <if test="inspGroupId != null and inspGroupId != ''">and insp_Group_Id = #{inspGroupId}</if>
  1031. <if test="codes != null and codes != ''">and CODE in (${codes})</if>
  1032. <if test="adCodes != null and adCodes != ''">and AD_CODE in (${adCodes})</if>
  1033. <if test="orgIds != null and orgIds != ''">and org_id in (${orgIds})</if>
  1034. <if test="inspPblmType != null and inspPblmType != ''">and INSP_PBLM_TYPE = #{inspPblmType}</if>
  1035. order by ad_code asc,coll_time desc
  1036. </select>
  1037. <select id="findJsflPlbmList" parameterType="cn.com.goldenwater.dcproj.param.PrdParam"
  1038. resultMap="bisInspPblmResultMap">
  1039. select * from (
  1040. select w.* from (
  1041. select ba.name ,j.code,j.nm,j.id as
  1042. oid,j.ptype,r.PERS_NAME,p.*,b.ad_full_name,
  1043. b.ad_code,l.pnm as org_nm,l.sttm,l.entm,j.id as org_id
  1044. from (select * from BIS_INSP_PBLM pb where pb.obj_type=18
  1045. <if test="inspPblmCate != null and inspPblmCate != ''">and pb.INSP_PBLM_CATE = #{inspPblmCate}</if>
  1046. <if test="ifCasePblm != null and ifCasePblm != ''">and pb.IF_CASE_PBLM = #{ifCasePblm}</if>
  1047. <if test="hasVedio != null and hasVedio != ''">and pb.HAS_VEDIO = #{hasVedio}</if>
  1048. <if test="startTime != null and startTime != ''">
  1049. AND pb.COLL_TIME &gt;= TO_DATE(#{startTime},'YYYY-MM-DD')
  1050. </if>
  1051. <if test="findTime != null and findTime != ''">and pb.COLL_TIME=TO_DATE(#{findTime},'YYYY-MM-DD')</if>
  1052. <if test="endTime != null and endTime != ''">
  1053. AND pb.COLL_TIME &lt; TO_DATE(#{endTime},'YYYY-MM-DD')+1
  1054. </if>
  1055. <if test="inspPblmName != null and inspPblmName != ''">and pb.INSP_PBLM_NAME like '%${inspPblmName}%'</if>
  1056. ) p
  1057. left join (select * from BIS_INSP_ALL_OBJ o where o.pType=18
  1058. <if test="objId != null and objId != ''">and o.OBJ_ID = #{objId}</if>
  1059. <include refid="choseSql"/>
  1060. ) j on p.obj_id=j.obj_id
  1061. left join BIS_INSP_ALL_RLATION_PERS r on p.rec_pers=r.guid
  1062. left join ATT_JSKEJIAN_FLKDIS_BASE ba on ba.id=j.code
  1063. left join att_ad_x_base b on ba.ad_code=b.ad_code
  1064. left join BIS_INSP_ALL l on l.id=j.id
  1065. ) w where w.pType=18
  1066. <if test="tabType =='2'.toString()">
  1067. and w.entm &lt;to_date(#{nowTime},'yyyy-MM-dd')+1
  1068. </if>
  1069. <if test="tabType =='1'.toString()">
  1070. and w.entm &gt;=to_date(#{nowTime},'yyyy-MM-dd')
  1071. </if>
  1072. and
  1073. REGEXP_LIKE(
  1074. W.OID,'^('||
  1075. ( case when(SELECT count(id) from BIS_INSP_ALL_RLATION WHERE PERSID =#{persId}
  1076. <include refid="orgIdSql"/>
  1077. )>0 then
  1078. (SELECT LISTAGG(id, '|') WITHIN GROUP(ORDER BY PERSID) as
  1079. id FROM BIS_INSP_ALL_RLATION WHERE PERSID =#{persId}
  1080. <include refid="orgIdSql"/>
  1081. )
  1082. else (select 'non' from dual) end)
  1083. ||')')
  1084. ) a where 1=1
  1085. <if test="orgNm != null and orgNm != ''">and org_nm like '%${orgNm}%'</if>
  1086. <if test="name != null and name != ''">and name like '%${name}%'</if>
  1087. <if test="adFullName != null and adFullName != ''">and ad_full_name like '%${adFullName}%'</if>
  1088. <if test="persName != null and persName != ''">and PERS_NAME like '%${persName}%'</if>
  1089. <if test="inspGroupId != null and inspGroupId != ''">and insp_Group_Id = #{inspGroupId}</if>
  1090. <if test="codes != null and codes != ''">and CODE in (${codes})</if>
  1091. <if test="adCodes != null and adCodes != ''">and AD_CODE in (${adCodes})</if>
  1092. <if test="orgIds != null and orgIds != ''">and org_id in (${orgIds})</if>
  1093. <if test="inspPblmType != null and inspPblmType != ''">and INSP_PBLM_TYPE = #{inspPblmType}</if>
  1094. order by ad_code asc,coll_time desc
  1095. </select>
  1096. <select id="findPrdPlbmList" parameterType="cn.com.goldenwater.dcproj.param.PrdParam"
  1097. resultMap="bisInspPblmResultMap">
  1098. select * from (
  1099. select w.* from (
  1100. select ba.name ,j.code,j.nm,l.sttm,l.entm,j.id as
  1101. oid,j.ptype,r.PERS_NAME,p.*,s.insp_pblms_name,s.check_point,s.attach,s.sheet,s.sn_num,b.ad_full_name,
  1102. b.ad_code,l.pnm as org_nm,j.id as org_id
  1103. from (select * from BIS_INSP_PBLM pb where pb.obj_type=17
  1104. <if test="inspPblmCate != null and inspPblmCate != ''">and pb.INSP_PBLM_CATE = #{inspPblmCate}</if>
  1105. <if test="ifCasePblm != null and ifCasePblm != ''">and pb.IF_CASE_PBLM = #{ifCasePblm}</if>
  1106. <if test="hasVedio != null and hasVedio != ''">and pb.HAS_VEDIO = #{hasVedio}</if>
  1107. <if test="startTime != null and startTime != ''">
  1108. AND pb.COLL_TIME &gt;= TO_DATE(#{startTime},'YYYY-MM-DD')
  1109. </if>
  1110. <if test="findTime != null and findTime != ''">and pb.COLL_TIME=TO_DATE(#{findTime},'YYYY-MM-DD')</if>
  1111. <if test="endTime != null and endTime != ''">
  1112. AND pb.COLL_TIME &lt; TO_DATE(#{endTime},'YYYY-MM-DD')+1
  1113. </if>
  1114. <if test="inspPblmName != null and inspPblmName != ''">and pb.INSP_PBLM_NAME like '%${inspPblmName}%'</if>
  1115. ) p
  1116. left join (select * from BIS_INSP_ALL_OBJ o where o.pType=17
  1117. <if test="objId != null and objId != ''">and o.OBJ_ID = #{objId}</if>
  1118. <include refid="choseSql"/>
  1119. ) j on p.obj_id=j.obj_id
  1120. left join BIS_INSP_ALL_RLATION_PERS r on p.rec_pers=r.guid
  1121. left join OBJ_INSP_PBLMS s on p.pblms_type_id=s.guid
  1122. left join ATT_PRD_CSTR_PROJ_BASE ba on ba.id=j.code
  1123. left join att_ad_x_base b on ba.ad_code=b.ad_code
  1124. left join BIS_INSP_ALL l on l.id=j.id
  1125. ) w where w.pType=17
  1126. <if test="tabType =='2'.toString()">
  1127. and w.entm &lt;to_date(#{nowTime},'yyyy-MM-dd')+1
  1128. </if>
  1129. <if test="tabType =='1'.toString()">
  1130. and w.entm &gt;=to_date(#{nowTime},'yyyy-MM-dd')
  1131. </if>
  1132. and
  1133. REGEXP_LIKE(
  1134. W.OID,'^('||
  1135. ( case when(SELECT count(id) from BIS_INSP_ALL_RLATION WHERE PERSID =#{persId}
  1136. <include refid="orgIdSql"/>
  1137. )>0 then
  1138. (SELECT LISTAGG(id, '|') WITHIN GROUP(ORDER BY PERSID) as
  1139. id FROM BIS_INSP_ALL_RLATION WHERE PERSID =#{persId}
  1140. <include refid="orgIdSql"/>
  1141. )
  1142. else (select 'non' from dual) end)
  1143. ||')')
  1144. ) a where 1=1
  1145. <if test="orgNm != null and orgNm != ''">and org_nm like '%${orgNm}%'</if>
  1146. <if test="name != null and name != ''">and name like '%${name}%'</if>
  1147. <if test="adFullName != null and adFullName != ''">and ad_full_name like '%${adFullName}%'</if>
  1148. <if test="persName != null and persName != ''">and PERS_NAME like '%${persName}%'</if>
  1149. <if test="inspGroupId != null and inspGroupId != ''">and insp_Group_Id = #{inspGroupId}</if>
  1150. <if test="codes != null and codes != ''">and CODE in (${codes})</if>
  1151. <if test="adCodes != null and adCodes != ''">and AD_CODE in (${adCodes})</if>
  1152. <if test="orgIds != null and orgIds != ''">and org_id in (${orgIds})</if>
  1153. <if test="inspPblmType != null and inspPblmType != ''">and INSP_PBLM_TYPE = #{inspPblmType}</if>
  1154. order by ad_code asc,coll_time desc
  1155. </select>
  1156. <select id="findEcofrdPlbmList" parameterType="cn.com.goldenwater.dcproj.param.PrdParam"
  1157. resultMap="bisInspPblmResultMap">
  1158. select * from (
  1159. select w.* from (
  1160. select ba.name ,j.code,j.nm,l.sttm,l.entm,j.id as
  1161. oid,j.ptype,r.PERS_NAME,p.*,s.insp_pblms_name,s.check_point,s.attach,s.sheet,s.sn_num,b.ad_full_name,
  1162. b.ad_code,l.pnm as org_nm,j.id as org_id
  1163. from (select * from BIS_INSP_PBLM pb where pb.obj_type=20
  1164. <if test="inspPblmCate != null and inspPblmCate != ''">and pb.INSP_PBLM_CATE = #{inspPblmCate}</if>
  1165. <if test="ifCasePblm != null and ifCasePblm != ''">and pb.IF_CASE_PBLM = #{ifCasePblm}</if>
  1166. <if test="hasVedio != null and hasVedio != ''">and pb.HAS_VEDIO = #{hasVedio}</if>
  1167. <if test="startTime != null and startTime != ''">
  1168. AND pb.COLL_TIME &gt;= TO_DATE(#{startTime},'YYYY-MM-DD')
  1169. </if>
  1170. <if test="findTime != null and findTime != ''">and pb.COLL_TIME=TO_DATE(#{findTime},'YYYY-MM-DD')</if>
  1171. <if test="endTime != null and endTime != ''">
  1172. AND pb.COLL_TIME &lt; TO_DATE(#{endTime},'YYYY-MM-DD')+1
  1173. </if>
  1174. <if test="inspPblmName != null and inspPblmName != ''">and pb.INSP_PBLM_NAME like '%${inspPblmName}%'</if>
  1175. ) p
  1176. left join (select * from BIS_INSP_ALL_OBJ o where o.pType=20
  1177. <if test="objId != null and objId != ''">and o.OBJ_ID = #{objId}</if>
  1178. <include refid="choseSql"/>
  1179. ) j on p.obj_id=j.obj_id
  1180. left join BIS_INSP_ALL_RLATION_PERS r on p.rec_pers=r.guid
  1181. left join OBJ_INSP_PBLMS s on p.pblms_type_id=s.guid
  1182. left join ATT_PRD_CSTR_PROJ_BASE ba on ba.id=j.code
  1183. left join att_ad_x_base b on ba.ad_code=b.ad_code
  1184. left join BIS_INSP_ALL l on l.id=j.id
  1185. ) w where w.pType=20
  1186. <if test="tabType =='2'.toString()">
  1187. and w.entm &lt;to_date(#{nowTime},'yyyy-MM-dd')+1
  1188. </if>
  1189. <if test="tabType =='1'.toString()">
  1190. and w.entm &gt;=to_date(#{nowTime},'yyyy-MM-dd')
  1191. </if>
  1192. and
  1193. REGEXP_LIKE(
  1194. W.OID,'^('||
  1195. ( case when(SELECT count(id) from BIS_INSP_ALL_RLATION WHERE PERSID =#{persId}
  1196. <include refid="orgIdSql"/>
  1197. )>0 then
  1198. (SELECT LISTAGG(id, '|') WITHIN GROUP(ORDER BY PERSID) as
  1199. id FROM BIS_INSP_ALL_RLATION WHERE PERSID =#{persId}
  1200. <include refid="orgIdSql"/>
  1201. )
  1202. else (select 'non' from dual) end)
  1203. ||')')
  1204. ) a where 1=1
  1205. <if test="orgNm != null and orgNm != ''">and org_nm like '%${orgNm}%'</if>
  1206. <if test="name != null and name != ''">and name like '%${name}%'</if>
  1207. <if test="adFullName != null and adFullName != ''">and ad_full_name like '%${adFullName}%'</if>
  1208. <if test="persName != null and persName != ''">and PERS_NAME like '%${persName}%'</if>
  1209. <if test="inspGroupId != null and inspGroupId != ''">and insp_Group_Id = #{inspGroupId}</if>
  1210. <if test="codes != null and codes != ''">and CODE in (${codes})</if>
  1211. <if test="adCodes != null and adCodes != ''">and AD_CODE in (${adCodes})</if>
  1212. <if test="orgIds != null and orgIds != ''">and org_id in (${orgIds})</if>
  1213. <if test="inspPblmType != null and inspPblmType != ''">and INSP_PBLM_TYPE = #{inspPblmType}</if>
  1214. order by ad_code asc,coll_time desc
  1215. </select>
  1216. <!--水闸问题列表-->
  1217. <select id="findWagaPlbmList" resultMap="bisInspPblmResultMap"
  1218. parameterType="cn.com.goldenwater.dcproj.param.WagaParam">
  1219. select * from (
  1220. select w.* from (
  1221. select ba.gate_name ,l.sttm,l.entm,j.code,j.nm,j.id as
  1222. oid,j.ptype,r.PERS_NAME,p.*,s.insp_pblms_name,s.check_point,s.attach,s.sheet,s.sn_num,b.ad_full_name,
  1223. b.ad_code,l.pnm as org_nm,j.id as org_id
  1224. from (select * from BIS_INSP_PBLM pb where pb.obj_type=6
  1225. <if test="inspPblmCate != null and inspPblmCate != ''">and pb.INSP_PBLM_CATE = #{inspPblmCate}</if>
  1226. <if test="ifCasePblm != null and ifCasePblm != ''">and pb.IF_CASE_PBLM = #{ifCasePblm}</if>
  1227. <if test="hasVedio != null and hasVedio != ''">and pb.HAS_VEDIO = #{hasVedio}</if>
  1228. <if test="startTime != null and startTime != ''">
  1229. AND pb.COLL_TIME &gt;= TO_DATE(#{startTime},'YYYY-MM-DD')
  1230. </if>
  1231. <if test="findTime != null and findTime != ''">and pb.COLL_TIME=TO_DATE(#{findTime},'YYYY-MM-DD')</if>
  1232. <if test="endTime != null and endTime != ''">
  1233. AND pb.COLL_TIME &lt; TO_DATE(#{endTime},'YYYY-MM-DD')+1
  1234. </if>
  1235. <if test="inspPblmName != null and inspPblmName != ''">and pb.INSP_PBLM_NAME like '%${inspPblmName}%'</if>
  1236. ) p
  1237. left join (select * from BIS_INSP_ALL_OBJ o where o.pType=6
  1238. <if test="objId != null and objId != ''">and o.OBJ_ID = #{objId}</if>
  1239. <include refid="choseSql"/>
  1240. ) j on p.obj_id=j.obj_id
  1241. left join BIS_INSP_ALL_RLATION_PERS r on p.rec_pers=r.guid
  1242. left join OBJ_INSP_PBLMS s on p.pblms_type_id=s.guid
  1243. left join att_waga_base ba on ba.obj_code=j.code
  1244. left join att_ad_x_base b on ba.ad_code=b.ad_code
  1245. left join BIS_INSP_ALL l on l.id=j.id
  1246. ) w where w.pType=6
  1247. <if test="tabType =='2'.toString()">
  1248. and w.entm &lt;to_date(#{nowTime},'yyyy-MM-dd')+1
  1249. </if>
  1250. <if test="tabType =='1'.toString()">
  1251. and w.entm &gt;=to_date(#{nowTime},'yyyy-MM-dd')
  1252. </if>
  1253. and
  1254. REGEXP_LIKE(
  1255. W.OID,'^('||
  1256. ( case when(SELECT count(id) from BIS_INSP_ALL_RLATION WHERE PERSID =#{persId}
  1257. <include refid="orgIdSql"/>
  1258. )>0 then
  1259. (SELECT LISTAGG(id, '|') WITHIN GROUP(ORDER BY PERSID) as
  1260. id FROM BIS_INSP_ALL_RLATION WHERE PERSID =#{persId}
  1261. <include refid="orgIdSql"/>
  1262. )
  1263. else (select 'non' from dual) end)
  1264. ||')')
  1265. ) a where 1=1
  1266. <if test="nm != null and nm != ''">and nm like '%${nm}%'</if>
  1267. <if test="orgNm != null and orgNm != ''">and org_nm like '%${orgNm}%'</if>
  1268. <if test="gateName != null and gateName != ''">and gate_name like '%${gateName}%'</if>
  1269. <if test="adFullName != null and adFullName != ''">and ad_full_name like '%${adFullName}%'</if>
  1270. <if test="persName != null and persName != ''">and PERS_NAME like '%${persName}%'</if>
  1271. <if test="inspGroupId != null and inspGroupId != ''">and insp_Group_Id = #{inspGroupId}</if>
  1272. <if test="codes != null and codes != ''">and CODE in (${codes})</if>
  1273. <if test="recPers !=null and recPers !=''">
  1274. and rec_pers=#{recPers}
  1275. </if>
  1276. <if test="adCodes != null and adCodes != ''">and AD_CODE in (${adCodes})</if>
  1277. <if test="orgIds != null and orgIds != ''">and org_id in (${orgIds})</if>
  1278. <if test="state != null and state != ''">and STATE = #{state}</if>
  1279. <if test="inspPblmType != null and inspPblmType != ''">and INSP_PBLM_TYPE = #{inspPblmType}</if>
  1280. order by ad_code asc,coll_time desc
  1281. </select>
  1282. <select id="findReverPlbmList" resultMap="bisInspPblmResultMap"
  1283. parameterType="cn.com.goldenwater.dcproj.param.ReverParam">
  1284. select * from (
  1285. select w.* from (
  1286. select
  1287. J.NM RS_NAME, R.PERS_NAME, B.AD_FULL_NAME,B.AD_CODE,
  1288. J.CODE,J.NM,J.ID AS OID, J.ID AS ORG_ID, J.PTYPE,
  1289. P.*, P.INSP_PBLM_NAME AS INSP_PBLMS_NAME,P.PBLM_DESC_BZ AS PBLM_DESC, P.CHECK_POINT_BZ AS CHECK_POINT,
  1290. S.ATTACH,S.SHEET,S.SN_NUM,S.OLD_ATTACH,S.OLD_SN,
  1291. L.PNM AS ORG_NM, L.STTM,L.ENTM,
  1292. BN.OBJ_TYPE AS BASE_OBJ_TYPE, BN.ENGR_TYPE
  1293. from (select * from BIS_INSP_PBLM pb where pb.obj_type=#{objType}
  1294. <if test="inspPblmCate != null and inspPblmCate != ''">and pb.INSP_PBLM_CATE = #{inspPblmCate}</if>
  1295. <if test="ifCasePblm != null and ifCasePblm != ''">and pb.IF_CASE_PBLM = #{ifCasePblm}</if>
  1296. <if test="hasVedio != null and hasVedio != ''">and pb.HAS_VEDIO = #{hasVedio}</if>
  1297. <if test="startTime != null and startTime != ''">AND pb.COLL_TIME &gt;= TO_DATE(#{startTime},'YYYY-MM-DD')</if>
  1298. <if test="findTime != null and findTime != ''">and pb.COLL_TIME=TO_DATE(#{findTime},'YYYY-MM-DD')</if>
  1299. <if test="endTime != null and endTime != ''">AND pb.COLL_TIME &lt; TO_DATE(#{endTime},'YYYY-MM-DD')+1</if>
  1300. <if test="inspPblmName != null and inspPblmName != ''">and pb.INSP_PBLM_NAME like '%${inspPblmName}%'</if>
  1301. ) p
  1302. join (select * from BIS_INSP_ALL_OBJ o where o.pType=#{objType}
  1303. <if test="objId != null and objId != ''">and o.OBJ_ID = #{objId}</if>
  1304. <include refid="choseSql"/>
  1305. ) J ON P.OBJ_ID=J.OBJ_ID
  1306. LEFT JOIN BIS_INSP_ALL_RLATION_PERS R ON P.REC_PERS=R.GUID
  1307. LEFT JOIN OBJ_INSP_PBLMS S ON P.PBLMS_TYPE_ID=S.GUID
  1308. LEFT JOIN ATT_AD_X_BASE B ON J.OBJ_AD_CODE=B.AD_CODE
  1309. LEFT JOIN BIS_INSP_ALL L ON L.ID=J.ID
  1310. LEFT JOIN BIS_INSP_BASE_NEW BN ON BN.ID=J.CODE
  1311. ) W
  1312. WHERE W.PTYPE = #{objType}
  1313. <if test="tabType =='2'.toString()">
  1314. and w.entm &lt;to_date(#{nowTime},'yyyy-MM-dd')+1
  1315. </if>
  1316. <if test="tabType =='1'.toString()">and w.entm &gt;=to_date(#{nowTime},'yyyy-MM-dd')</if>
  1317. and
  1318. REGEXP_LIKE(
  1319. W.OID,'^('||
  1320. ( case when(SELECT count(id) from BIS_INSP_ALL_RLATION WHERE PERSID =#{persId}
  1321. <include refid="orgIdSql"/>
  1322. )>0 then
  1323. (SELECT LISTAGG(id, '|') WITHIN GROUP(ORDER BY PERSID) as
  1324. id FROM BIS_INSP_ALL_RLATION WHERE PERSID =#{persId}
  1325. <include refid="orgIdSql"/>
  1326. )
  1327. else (select 'non' from dual) end)
  1328. ||')')
  1329. ) a
  1330. <where>
  1331. <if test="nm != null and nm != ''">and nm like '%${nm}%'</if>
  1332. <if test="orgNm != null and orgNm != ''">and org_nm like '%${orgNm}%'</if>
  1333. <if test="rsName != null and rsName != ''">and rs_name like '%${rsName}%'</if>
  1334. <if test="adFullName != null and adFullName != ''">and ad_full_name like '%${adFullName}%'</if>
  1335. <if test="persName != null and persName != ''">and PERS_NAME like '%${persName}%'</if>
  1336. <if test="codes != null and codes != ''">and CODE in (${codes})</if>
  1337. <if test="recPers !=null and recPers !=''">and rec_pers=#{recPers}</if>
  1338. <if test="adCodes != null and adCodes != ''">and AD_CODE in (${adCodes})</if>
  1339. <if test="orgIds != null and orgIds != ''">and org_id in (${orgIds})</if>
  1340. <if test="state != null and state != ''">and STATE = #{state}</if>
  1341. <if test="type != null and type != ''">and BASE_OBJ_TYPE = #{type}</if>
  1342. <if test="inspPblmType != null and inspPblmType != ''">and INSP_PBLM_TYPE = #{inspPblmType}</if>
  1343. </where>
  1344. order by ad_code asc, CODE asc , coll_time desc
  1345. </select>
  1346. <select id="findVillType" resultType="java.lang.String">
  1347. select distinct m.insp_pblm_name from BIS_INSP_PBLM m,bis_insp_all_obj o where m.obj_id=o.obj_id and
  1348. m.obj_type=2
  1349. <include refid="choseSql"/>
  1350. </select>
  1351. <select id="findVillPlbmList" resultMap="bisInspPblmResultMap"
  1352. parameterType="cn.com.goldenwater.dcproj.param.VillParam">
  1353. select * from (
  1354. select w.* from (
  1355. select j.code,j.nm,j.id as
  1356. oid,j.ptype,r.PERS_NAME,p.*,s.insp_pblms_name,s.check_point,s.attach,s.sheet,s.sn_num,b.ad_full_name,b.ad_code,l.pnm
  1357. as org_nm,j.id as org_id
  1358. from (select * from BIS_INSP_PBLM pb where pb.obj_type=2
  1359. <if test="inspPblmCate != null and inspPblmCate != ''">and pb.INSP_PBLM_CATE = #{inspPblmCate}</if>
  1360. <if test="ifCasePblm != null and ifCasePblm != ''">and pb.IF_CASE_PBLM = #{ifCasePblm}</if>
  1361. <if test="hasVedio != null and hasVedio != ''">and pb.HAS_VEDIO = #{hasVedio}</if>
  1362. <if test="startTime != null and startTime != ''">
  1363. AND pb.COLL_TIME &gt;= TO_DATE(#{startTime},'YYYY-MM-DD')
  1364. </if>
  1365. <if test="findTime != null and findTime != ''">and pb.COLL_TIME=TO_DATE(#{findTime},'YYYY-MM-DD')</if>
  1366. <if test="endTime != null and endTime != ''">
  1367. AND pb.COLL_TIME &lt;TO_DATE(#{endTime},'YYYY-MM-DD')+1
  1368. </if>
  1369. <if test="inspPblmName != null and inspPblmName != ''">and pb.INSP_PBLM_NAME like '%${inspPblmName}%'</if>
  1370. <if test="villType != null and villType != '' and villType != '0'.toString()">and pb.vill_Type =#{villType}</if>
  1371. <if test="villageCode != null and villageCode != ''">and pb.village_Code =#{villageCode}</if>
  1372. <if test="cwsCode != null and cwsCode != ''">and pb.cws_code =#{cwsCode}</if>
  1373. <if test="engSurId != null and engSurId != ''">and pb.REGID =#{engSurId}</if>
  1374. ) p
  1375. join (select * from BIS_INSP_ALL_OBJ o where o.pType=2
  1376. <if test="objId != null and objId != ''">and OBJ_ID = #{objId}</if>
  1377. <include refid="choseSql"/>
  1378. ) j on p.obj_id=j.obj_id
  1379. join BIS_INSP_ALL_RLATION_PERS r on p.rec_pers=r.guid
  1380. left join OBJ_INSP_PBLMS s on p.pblms_type_id=s.guid
  1381. left join BIS_INSP_VILL_RGSTR ba on ba.obj_id=j.obj_id
  1382. left join att_ad_x_base b on j.code=b.ad_code
  1383. left join BIS_INSP_ALL l on l.id=j.id
  1384. ) w where w.ptype=2 and
  1385. REGEXP_LIKE(
  1386. W.OID,'^('||
  1387. ( case when(SELECT count(id) from BIS_INSP_ALL_RLATION WHERE PERSID =#{persId}
  1388. <include refid="orgIdSql"/>
  1389. )>0 then
  1390. (SELECT LISTAGG(id, '|') WITHIN GROUP(ORDER BY PERSID) as
  1391. id FROM BIS_INSP_ALL_RLATION WHERE PERSID =#{persId}
  1392. <include refid="orgIdSql"/>
  1393. )
  1394. else (select 'non' from dual) end)
  1395. ||')')
  1396. ) a where 1=1
  1397. <if test="nm != null and nm != ''">and nm like '%${nm}%'</if>
  1398. <if test="orgNm != null and orgNm != ''">and org_nm like '%${orgNm}%'</if>
  1399. <if test="adFullName != null and adFullName != ''">and ad_full_name like '%${adFullName}%'</if>
  1400. <if test="persName != null and persName != ''">and PERS_NAME like '%${persName}%'</if>
  1401. <if test="codes != null and codes != ''">and CODE in (${codes})</if>
  1402. <if test="recPers !=null and recPers !=''">
  1403. and rec_pers=#{recPers}
  1404. </if>
  1405. <if test="adCodes != null and adCodes != ''">and AD_CODE in (${adCodes})</if>
  1406. <if test="orgIds != null and orgIds != ''">and org_id in (${orgIds})</if>
  1407. <if test="inspPblmType != null and inspPblmType != ''">and INSP_PBLM_TYPE = #{inspPblmType}</if>
  1408. order by ad_code asc,coll_time desc
  1409. </select>
  1410. <!--地下水-->
  1411. <select id="findWaterPlbmList" resultMap="bisInspPblmResultMap"
  1412. parameterType="cn.com.goldenwater.dcproj.param.UnderWaterParam">
  1413. select * from (
  1414. select w.* from (
  1415. select j.code,j.nm,j.id as oid,l.sttm,l.entm,j.ptype,r.PERS_NAME,p.*,e.ad_full_name as
  1416. ad_full_name,s.insp_pblms_name,s.check_point,s.attach,s.sheet,s.sn_num,b.stcd as ad_code,l.pnm as org_nm,j.id as
  1417. org_id
  1418. from (select * from BIS_INSP_PBLM pb where pb.obj_type=5
  1419. <if test="inspPblmCate != null and inspPblmCate != ''">and pb.INSP_PBLM_CATE = #{inspPblmCate}</if>
  1420. <if test="ifCasePblm != null and ifCasePblm != ''">and pb.IF_CASE_PBLM = #{ifCasePblm}</if>
  1421. <if test="hasVedio != null and hasVedio != ''">and pb.HAS_VEDIO = #{hasVedio}</if>
  1422. <if test="startTime != null and startTime != ''">
  1423. AND pb.COLL_TIME &gt;= TO_DATE(#{startTime},'YYYY-MM-DD')
  1424. </if>
  1425. <if test="findTime != null and findTime != ''">and pb.COLL_TIME=TO_DATE(#{findTime},'YYYY-MM-DD')</if>
  1426. <if test="endTime != null and endTime != ''">
  1427. AND pb.COLL_TIME &lt;= TO_DATE(#{endTime},'YYYY-MM-DD')+1
  1428. </if>
  1429. <if test="inspPblmName != null and inspPblmName != ''">and pb.INSP_PBLM_NAME like '%${inspPblmName}%'</if>
  1430. ) p
  1431. join (select * from BIS_INSP_ALL_OBJ o where o.pType=5
  1432. <if test="objId != null and objId != ''">and OBJ_ID = #{objId}</if>
  1433. <include refid="choseSql"/>
  1434. ) j on p.obj_id=j.obj_id
  1435. join BIS_INSP_ALL_RLATION_PERS r on p.rec_pers=r.guid
  1436. left join OBJ_INSP_PBLMS s on p.pblms_type_id=s.guid
  1437. left join BIS_INSP_GRW t on t.obj_id=p.obj_id
  1438. left join att_grw_base b on t.stcd=b.stcd and j.code=b.stcd
  1439. left join att_ad_x_base e on b.adcd=e.ad_code
  1440. left join BIS_INSP_ALL l on l.id=j.id
  1441. ) w where w.ptype='5'
  1442. <if test="tabType =='2'.toString()">
  1443. and w.entm &lt;to_date(#{nowTime},'yyyy-MM-dd')+1
  1444. </if>
  1445. <if test="tabType =='1'.toString()">
  1446. and w.entm &gt;=to_date(#{nowTime},'yyyy-MM-dd')
  1447. </if>
  1448. and
  1449. REGEXP_LIKE(
  1450. W.OID,'^('||
  1451. ( case when(SELECT count(id) from BIS_INSP_ALL_RLATION WHERE PERSID =#{persId}
  1452. <include refid="orgIdSql"/>
  1453. )>0 then
  1454. (SELECT LISTAGG(id, '|') WITHIN GROUP(ORDER BY PERSID) as
  1455. id FROM BIS_INSP_ALL_RLATION WHERE PERSID =#{persId}
  1456. <include refid="orgIdSql"/>
  1457. )
  1458. else (select 'non' from dual) end)
  1459. ||')')
  1460. ) a where 1=1
  1461. <if test="persName != null and persName != ''">and PERS_NAME like '%${persName}%'</if>
  1462. <if test="orgNm != null and orgNm != ''">and org_nm like '%${orgNm}%'</if>
  1463. <if test="codes != null and codes != ''">and CODE in (${codes})</if>
  1464. <if test="adCodes != null and adCodes != ''">and AD_CODE in (${adCodes})</if>
  1465. <if test="orgIds != null and orgIds != ''">and org_id in (${orgIds})</if>
  1466. <if test="recPers !=null and recPers !=''">
  1467. and rec_pers=#{recPers}
  1468. </if>
  1469. <if test="nm != null and nm != ''">and nm like '%${nm}%'</if>
  1470. <if test="adFullName != null and adFullName != ''">and ad_full_name like '%${adFullName}%'</if>
  1471. order by ad_code asc,coll_time desc
  1472. </select>
  1473. <select id="findTrackPlbmList" resultMap="bisInspPblmResultMap"
  1474. parameterType="cn.com.goldenwater.dcproj.param.TrackParam">
  1475. select * from (
  1476. select w.* from (
  1477. select j.code,j.nm,j.id as oid,j.ptype,l.sttm,l.entm,r.PERS_NAME,p.*,
  1478. b.ad_full_name,s.insp_pblms_name,s.pblm_desc,s.check_point,s.attach,s.sheet,s.sn_num,b.ad_code,l.pnm
  1479. as org_nm,j.id as org_id
  1480. from (select * from BIS_INSP_PBLM pb where pb.obj_type = 3
  1481. <if test="inspPblmCate != null and inspPblmCate != ''">and pb.INSP_PBLM_CATE = #{inspPblmCate}</if>
  1482. <if test="ifCasePblm != null and ifCasePblm != ''">and pb.IF_CASE_PBLM = #{ifCasePblm}</if>
  1483. <if test="hasVedio != null and hasVedio != ''">and pb.HAS_VEDIO = #{hasVedio}</if>
  1484. <if test="startTime != null and startTime != ''">AND pb.COLL_TIME &gt;= TO_DATE(#{startTime},'YYYY-MM-DD')</if>
  1485. <if test="findTime != null and findTime != ''">and pb.COLL_TIME=TO_DATE(#{findTime},'YYYY-MM-DD')</if>
  1486. <if test="endTime != null and endTime != ''">AND pb.COLL_TIME &lt; TO_DATE(#{endTime},'YYYY-MM-DD')+1</if>
  1487. <if test="inspPblmName != null and inspPblmName != ''">and pb.INSP_PBLM_NAME like '%${inspPblmName}%'</if>
  1488. ) p
  1489. join (select * from BIS_INSP_ALL_OBJ o where o.pType=3
  1490. <if test="objId != null and objId != ''">and OBJ_ID = #{objId}</if>
  1491. <include refid="choseSql"/>
  1492. ) j on p.obj_id=j.obj_id
  1493. join BIS_INSP_ALL_RLATION_PERS r on p.rec_pers=r.guid
  1494. left join OBJ_INSP_PBLMS s on p.pblms_type_id=s.guid
  1495. left join BIS_INSP_WTDST t on t.wtdst_id = j.code
  1496. left join att_ad_x_base b on t.loc_ad=b.ad_code
  1497. left join BIS_INSP_ALL l on l.id=j.id
  1498. ) w where w.ptype=3
  1499. <if test="tabType =='2'.toString()">
  1500. and w.entm &lt;to_date(#{nowTime},'yyyy-MM-dd')+1
  1501. </if>
  1502. <if test="tabType =='1'.toString()">
  1503. and w.entm &gt;=to_date(#{nowTime},'yyyy-MM-dd')
  1504. </if>
  1505. and
  1506. REGEXP_LIKE(
  1507. W.OID,'^('||
  1508. ( case when(SELECT count(id) from BIS_INSP_ALL_RLATION WHERE PERSID =#{persId}
  1509. <include refid="orgIdSql"/>
  1510. )>0 then
  1511. (SELECT LISTAGG(id, '|') WITHIN GROUP(ORDER BY PERSID) as
  1512. id FROM BIS_INSP_ALL_RLATION WHERE PERSID =#{persId}
  1513. <include refid="orgIdSql"/>
  1514. )
  1515. else (select 'non' from dual) end)
  1516. ||')')
  1517. ) a where 1=1
  1518. <if test="persName != null and persName != ''">and PERS_NAME like '%${persName}%'</if>
  1519. <if test="orgNm != null and orgNm != ''">and org_nm like '%${orgNm}%'</if>
  1520. <if test="codes != null and codes != ''">and CODE in (${codes})</if>
  1521. <if test="adCodes != null and adCodes != ''">and AD_CODE in (${adCodes})</if>
  1522. <if test="orgIds != null and orgIds != ''">and org_id in (${orgIds})</if>
  1523. <if test="recPers !=null and recPers !=''">
  1524. and rec_pers=#{recPers}
  1525. </if>
  1526. <if test="inspPblmType != null and inspPblmType != ''">and INSP_PBLM_TYPE = #{inspPblmType}</if>
  1527. <if test="nm != null and nm != ''">and nm like '%${nm}%'</if>
  1528. <if test="adFullName != null and adFullName != ''">and ad_full_name like '%${adFullName}%'</if>
  1529. order by ad_code asc,coll_time desc
  1530. </select>
  1531. <!---->
  1532. <select id="findKeyRegPblmPage" resultType="cn.com.goldenwater.dcproj.dto.PblmRetCount"
  1533. parameterType="cn.com.goldenwater.dcproj.param.CountParam">
  1534. select e.nm as rs_name ,dd.code from ATT_EMPWTPRJ_BASE e,(
  1535. select distinct w.code from (
  1536. select j.id as oid,j.ptype,j.code,p.insp_pblm_cate,r.org_id from BIS_INSP_PBLM p
  1537. join (select * from bis_insp_all_obj o where o.ptype=#{pType}
  1538. <include refid="choseSql"/>
  1539. ) j on p.obj_id=j.obj_id
  1540. join BIS_INSP_ALL_RLATION_PERS r on p.rec_pers=r.guid
  1541. ) w where w.ptype=#{pType}
  1542. <if test="persId != null and persId != ''">
  1543. and
  1544. REGEXP_LIKE(
  1545. W.OID,'^('||
  1546. ( case when(SELECT count(id) from BIS_INSP_ALL_RLATION WHERE PERSID =#{persId}
  1547. <include refid="orgIdSql"/>
  1548. )>0 then
  1549. (SELECT LISTAGG(id, '|') WITHIN GROUP(ORDER BY PERSID) as
  1550. id FROM BIS_INSP_ALL_RLATION WHERE PERSID =#{persId}
  1551. <include refid="orgIdSql"/>
  1552. )
  1553. else (select 'non' from dual) end)
  1554. ||')')
  1555. </if>
  1556. ) dd where e.id=dd.code
  1557. </select>
  1558. <!--分页查询小水闸-->
  1559. <select id="findWagaPblmPage" resultType="cn.com.goldenwater.dcproj.dto.PblmRetCount"
  1560. parameterType="cn.com.goldenwater.dcproj.param.CountParam">
  1561. select e.gate_name as rs_name ,dd.code,e.eng_scal from att_waga_base e,(
  1562. select distinct w.code from (
  1563. select j.id as oid,j.ptype,j.code,p.insp_pblm_cate,j.org_id from bis_insp_pblm p
  1564. join (
  1565. select * from bis_insp_all_obj o where o.pType=#{pType}
  1566. <include refid="choseSql"/>
  1567. ) j on p.obj_id=j.obj_id
  1568. join BIS_INSP_ALL_RLATION_PERS r on p.rec_pers=r.guid
  1569. ) w where w.ptype=#{pType}
  1570. and
  1571. REGEXP_LIKE(
  1572. W.OID,'^('||
  1573. ( case when(SELECT count(id) from BIS_INSP_ALL_RLATION WHERE PERSID =#{persId}
  1574. <include refid="orgIdSql"/>
  1575. )>0 then
  1576. (SELECT LISTAGG(id, '|') WITHIN GROUP(ORDER BY PERSID) as
  1577. id FROM BIS_INSP_ALL_RLATION WHERE PERSID =#{persId}
  1578. <include refid="orgIdSql"/>
  1579. )
  1580. else (select 'non' from dual) end)
  1581. ||')') ) dd where e.obj_code=dd.code
  1582. </select>
  1583. <!--分页查询小水库-->
  1584. <select id="findReverPblmPage" resultType="cn.com.goldenwater.dcproj.dto.PblmRetCount"
  1585. parameterType="cn.com.goldenwater.dcproj.param.CountParam">
  1586. select e.rs_name,dd.code,(case to_char(e.eng_scal) when '1' then '大(1)型' when '2' then '大(2)型' when '3' then
  1587. '中型' when '4' then '小(1)型' when '5' then '小(2)型' end ) as eng_scal from att_rs_base e,(
  1588. select distinct w.code from (
  1589. select j.id as oid,j.ptype,j.code,p.insp_pblm_cate,j.org_id from
  1590. bis_insp_pblm p
  1591. join (select * from bis_insp_all_obj o where o.ptype=#{pType}
  1592. <include refid="choseSql"/>
  1593. ) j on p.obj_id=j.obj_id
  1594. join BIS_INSP_ALL_RLATION_PERS r on p.rec_pers=r.guid
  1595. ) w where w.ptype=#{pType}
  1596. and
  1597. REGEXP_LIKE(
  1598. W.OID,'^('||
  1599. ( case when(SELECT count(id) from BIS_INSP_ALL_RLATION WHERE PERSID =#{persId}
  1600. <include refid="orgIdSql"/>
  1601. )>0 then
  1602. (SELECT LISTAGG(id, '|') WITHIN GROUP(ORDER BY PERSID) as
  1603. id FROM BIS_INSP_ALL_RLATION WHERE PERSID =#{persId}
  1604. <include refid="orgIdSql"/>
  1605. )
  1606. else (select 'non' from dual) end)
  1607. ||')') ) dd where e.rs_code=dd.code
  1608. </select>
  1609. <!--问题总计-->
  1610. <select id="totalCount" resultType="cn.com.goldenwater.dcproj.dto.CateTotal" parameterType="java.lang.String">
  1611. select count(code) as total,(case insp_pblm_cate when '0' then '一般' when '1' then '较重' when '2' then '严重' when
  1612. '3' then '特别严重' end) as cate from (
  1613. select j.id as oid,j.ptype,j.code,p.insp_pblm_cate,j.ORG_ID from BIS_INSP_PBLM p
  1614. join (select * from bis_insp_all_obj o where o.ptype=#{pType}
  1615. <include refid="choseSql"/>
  1616. ) j on p.obj_id=j.obj_id
  1617. join BIS_INSP_ALL_RLATION_PERS r on p.rec_pers=r.guid
  1618. ) w where w.ptype=#{pType}
  1619. <if test="persId !=null and persId !=''">
  1620. and
  1621. REGEXP_LIKE(
  1622. W.OID,'^('||
  1623. ( case when(SELECT count(id) from BIS_INSP_ALL_RLATION WHERE PERSID =#{persId}
  1624. <include refid="orgIdSql"/>
  1625. )>0 then
  1626. (SELECT LISTAGG(id, '|') WITHIN GROUP(ORDER BY PERSID) as
  1627. id FROM BIS_INSP_ALL_RLATION WHERE PERSID =#{persId}
  1628. <include refid="orgIdSql"/>
  1629. )
  1630. else (select 'non' from dual) end)
  1631. ||')')
  1632. </if>
  1633. and insp_pblm_cate is not null group by insp_pblm_cate order by insp_pblm_cate
  1634. </select>
  1635. <select id="countKeyReg" resultType="cn.com.goldenwater.dcproj.dto.PblmCount" parameterType="java.lang.String">
  1636. select dd.*,b.nm as rs_name from ATT_EMPWTPRJ_BASE b , (
  1637. select a.code,count(a.code) as sub,insp_pblm_cate,count(insp_pblm_cate) as total from (
  1638. select w.* from (
  1639. select j.id as oid,j.ptype,j.code,p.insp_pblm_cate,j.org_id from bis_insp_pblm p
  1640. join (select * from bis_insp_all_obj o where o.pType=#{pType}
  1641. <include refid="choseSql"/>
  1642. ) j on p.obj_id=j.obj_id
  1643. join BIS_INSP_ALL_RLATION_PERS r on p.rec_pers=r.guid
  1644. ) w where w.ptype=#{pType} and w.code in(${codes})
  1645. <if test="persId !=null and persId !=''">
  1646. and
  1647. REGEXP_LIKE(
  1648. W.OID,'^('||
  1649. ( case when(SELECT count(id) from BIS_INSP_ALL_RLATION WHERE PERSID =#{persId}
  1650. <include refid="orgIdSql"/>
  1651. )>0 then
  1652. (SELECT LISTAGG(id, '|') WITHIN GROUP(ORDER BY PERSID) as
  1653. id FROM BIS_INSP_ALL_RLATION WHERE PERSID =#{persId}
  1654. <include refid="orgIdSql"/>
  1655. )
  1656. else (select 'non' from dual) end)
  1657. ||')')
  1658. </if>
  1659. ) a where a.insp_pblm_cate is not null group by a.code,a.insp_pblm_cate order by a.code ) dd where b.id=dd.code
  1660. </select>
  1661. <!--小水库水闸问题统计-->
  1662. <select id="countWaga" resultType="cn.com.goldenwater.dcproj.dto.PblmCount" parameterType="java.lang.String">
  1663. select dd.*,b.gate_name as rs_name,b.eng_scal from att_waga_base b , (
  1664. select a.code,count(a.code) as sub,insp_pblm_cate,count(insp_pblm_cate) as total from (
  1665. select w.* from (
  1666. select j.id as oid,j.ptype,j.code,p.insp_pblm_cate,p.BELONG_ORG_ID from BIS_INSP_PBLM p
  1667. join (select * from bis_insp_all_obj o where o.pType=6
  1668. <include refid="choseSql"/>
  1669. ) j on p.obj_id=j.obj_id
  1670. join BIS_INSP_ALL_RLATION_PERS r on p.rec_pers=r.guid
  1671. ) w where w.ptype=6 and w.code in(${codes})
  1672. and
  1673. REGEXP_LIKE(
  1674. W.OID,'^('||
  1675. ( case when(SELECT count(id) from BIS_INSP_ALL_RLATION WHERE PERSID =#{persId}
  1676. <include refid="orgIdSql"/>
  1677. )>0 then
  1678. (SELECT LISTAGG(id, '|') WITHIN GROUP(ORDER BY PERSID) as
  1679. id FROM BIS_INSP_ALL_RLATION WHERE PERSID =#{persId}
  1680. <include refid="orgIdSql"/>
  1681. )
  1682. else (select 'non' from dual) end)
  1683. ||')')
  1684. ) a where a.insp_pblm_cate is not null group by a.code,a.insp_pblm_cate order by a.code ) dd where
  1685. b.obj_code=dd.code
  1686. </select>
  1687. <!--小水库问题统计-->
  1688. <select id="countRever" resultType="cn.com.goldenwater.dcproj.dto.PblmCount" parameterType="java.lang.String">
  1689. select dd.*,b.rs_name,b.eng_scal from att_rs_base b,(
  1690. select a.code,count(a.code) as sub,insp_pblm_cate,count(insp_pblm_cate) as total from (
  1691. select w.* from (
  1692. select j.id as oid,j.ptype,j.code,p.insp_pblm_cate,j.ORG_ID from BIS_INSP_PBLM p
  1693. join (select * from bis_insp_all_obj o where o.ptype=#{pType}
  1694. <include refid="choseSql"/>
  1695. ) j on p.obj_id=j.obj_id
  1696. join BIS_INSP_ALL_RLATION_PERS r on p.rec_pers=r.guid
  1697. ) w where w.ptype=#{pType} and w.code in(${codes})
  1698. and
  1699. REGEXP_LIKE(
  1700. W.OID,'^('||
  1701. ( case when(SELECT count(id) from BIS_INSP_ALL_RLATION WHERE PERSID =#{persId}
  1702. <include refid="orgIdSql"/>
  1703. )>0 then
  1704. (SELECT LISTAGG(id, '|') WITHIN GROUP(ORDER BY PERSID) as
  1705. id FROM BIS_INSP_ALL_RLATION WHERE PERSID =#{persId}
  1706. <include refid="orgIdSql"/>
  1707. )
  1708. else (select 'non' from dual) end)
  1709. ||')')
  1710. ) a where a.insp_pblm_cate is not null group by a.code,a.insp_pblm_cate order by a.code ) dd where
  1711. b.rs_code=dd.code
  1712. </select>
  1713. <!--人饮统计问题分页-->
  1714. <select id="findVillPblmPage" resultType="cn.com.goldenwater.dcproj.dto.VillCount"
  1715. parameterType="cn.com.goldenwater.dcproj.param.CountParam">
  1716. select dd.*,b.ad_full_name from att_ad_x_base b ,(
  1717. select code,count(pblm_id) as total from (
  1718. select j.code,j.nm,j.id as oid,j.ptype,p.vill_type,b.ad_full_name,p.pblm_id,j.org_id from BIS_INSP_PBLM p
  1719. join (select * from bis_insp_all_obj o where o.ptype=2
  1720. <include refid="choseSql"/>
  1721. ) j on p.obj_id=j.obj_id
  1722. left join att_ad_x_base b on j.code=b.ad_code
  1723. ) w where w.ptype=2
  1724. and
  1725. REGEXP_LIKE(
  1726. W.OID,'^('||
  1727. ( case when(SELECT count(id) from BIS_INSP_ALL_RLATION WHERE PERSID =#{persId}
  1728. <include refid="orgIdSql"/>
  1729. )>0 then
  1730. (SELECT LISTAGG(id, '|') WITHIN GROUP(ORDER BY PERSID) as
  1731. id FROM BIS_INSP_ALL_RLATION WHERE PERSID =#{persId}
  1732. <include refid="orgIdSql"/>
  1733. )
  1734. else (select 'non' from dual) end)
  1735. ||')') and vill_type is not null group by w.code ) dd where b.ad_code=dd.code order by dd.code
  1736. </select>
  1737. <select id="countVill" resultType="cn.com.goldenwater.dcproj.dto.VillTypeCount" parameterType="java.lang.String">
  1738. select count(code) as total,code,insp_Pblm_Name from (
  1739. select j.code,j.nm,j.id as oid,j.ptype,p.vill_type,j.org_id,(case p.vill_type when '1' then '行政村' when '2' then
  1740. '水源地' when '3' then '饮水工程' else '责任落实' end) insp_Pblm_Name
  1741. from BIS_INSP_PBLM p
  1742. join (select * from bis_insp_all_obj o where o.ptype=2
  1743. <include refid="choseSql"/>
  1744. ) j on p.obj_id=j.obj_id
  1745. left join att_ad_x_base b on j.code=b.ad_code
  1746. ) w where w.ptype=2 and w.code in (${codes})
  1747. and
  1748. REGEXP_LIKE(
  1749. W.OID,'^('||
  1750. ( case when(SELECT count(id) from BIS_INSP_ALL_RLATION WHERE PERSID =#{persId}
  1751. <include refid="orgIdSql"/>
  1752. )>0 then
  1753. (SELECT LISTAGG(id, '|') WITHIN GROUP(ORDER BY PERSID) as
  1754. id FROM BIS_INSP_ALL_RLATION WHERE PERSID =#{persId}
  1755. <include refid="orgIdSql"/>
  1756. )
  1757. else (select 'non' from dual) end)
  1758. ||')') and w.vill_type is not null group by code,insp_Pblm_Name
  1759. </select>
  1760. <!--人饮问题统计-->
  1761. <select id="totalCountVill" parameterType="java.lang.String"
  1762. resultType="cn.com.goldenwater.dcproj.dto.VillTypeCount">
  1763. select count(code) as total,insp_Pblm_Name from (
  1764. select j.code,j.nm,j.id as oid,j.ptype,p.vill_type,j.org_id,(case p.vill_type when '1' then '行政村' when '2' then
  1765. '水源地' when '3' then '饮水工程' else '责任落实' end) insp_Pblm_Name
  1766. from BIS_INSP_PBLM p
  1767. join (select * from bis_insp_all_obj o where o.ptype=2
  1768. <include refid="choseSql"/>
  1769. ) j on p.obj_id=j.obj_id
  1770. left join att_ad_x_base b on j.code=b.ad_code
  1771. ) w where w.ptype=2
  1772. and
  1773. REGEXP_LIKE(
  1774. W.OID,'^('||
  1775. ( case when(SELECT count(id) from BIS_INSP_ALL_RLATION WHERE PERSID =#{persId}
  1776. <include refid="orgIdSql"/>
  1777. )>0 then
  1778. (SELECT LISTAGG(id, '|') WITHIN GROUP(ORDER BY PERSID) as
  1779. id FROM BIS_INSP_ALL_RLATION WHERE PERSID =#{persId}
  1780. <include refid="orgIdSql"/>
  1781. )
  1782. else (select 'non' from dual) end)
  1783. ||')') and w.vill_type is not null group by insp_Pblm_Name
  1784. </select>
  1785. <!--获取用户可查询问题范围-->
  1786. <select id="findPblmByPersId" parameterType="java.lang.String" resultType="cn.com.goldenwater.dcproj.dto.PblmRole">
  1787. select distinct name, id,length,case when perType is null then '0' else perType end perType from (
  1788. SELECT length(B.ID) as length,substr(B.id,0,3) as id,e.name as name,o.permission as perType
  1789. FROM (
  1790. select * from BIS_INSP_ALL_RLATION r where
  1791. <choose>
  1792. <when test="province !=null and province !=''">
  1793. r.ad_code =#{province}
  1794. </when>
  1795. <otherwise>
  1796. r.ad_code is null
  1797. </otherwise>
  1798. </choose>
  1799. ) B join BIS_INSP_ALL_RLATION_PERS o on b.persid=o.guid
  1800. join att_insp_type e on substr(B.id,0,3)=e.code
  1801. WHERE B.PERSID =#{persId} ) w order by w.id asc
  1802. </select>
  1803. <!--根据督查组查询统计问题-->
  1804. <select id="getAreaOrgIdsNew" resultType="java.lang.String" parameterType="java.lang.String">
  1805. SELECT LISTAGG(A.id, ',') WITHIN GROUP(ORDER BY A.id) as id
  1806. FROM BIS_INSP_ALL A
  1807. join BIS_INSP_ALL_RLATION B ON A.ID = B.ID
  1808. join Bis_insp_all_obj o on A.id=o.id
  1809. WHERE B.PERSID =#{persId} AND A.ID LIKE #{areaId}
  1810. <include refid="choseSql"/>
  1811. </select>
  1812. <!--获取数据-->
  1813. <select id="findKeyRegBYAreaId" parameterType="java.lang.String"
  1814. resultType="cn.com.goldenwater.dcproj.model.KeyRegCount">
  1815. select count(insp_pblm_cate) as total,insp_pblm_cate,ad_full_name from (
  1816. select j.id as oid,j.ptype,j.code,p.insp_pblm_cate,
  1817. (select e.ad_full_name from att_ad_x_base e where e.ad_code=concat(substr(se.ad_code,0,2),'0000000000')) as
  1818. ad_full_name from BIS_INSP_PBLM p
  1819. join (select * from BIS_INSP_ALL_OBJ o where o.ptype=#{pType}
  1820. <include refid="choseSql"/>
  1821. ) j on p.obj_id=j.obj_id
  1822. left join att_empwtprj_base ba on j.code=ba.id
  1823. left join att_ad_x_base se on ba.ad_code=se.ad_code
  1824. ) w where w.ptype=#{pType} group by insp_pblm_cate,ad_full_name
  1825. </select>
  1826. <!--根据督查组查人饮问题县统计-->
  1827. <select id="findVillPblmBYAreaId" parameterType="java.lang.String"
  1828. resultType="cn.com.goldenwater.dcproj.dto.VillCount">
  1829. select count(code) as countyNum,ad_full_name from (
  1830. select distinct code,ad_full_name from (
  1831. select j.code,j.nm,j.id as oid,j.ptype,p.vill_type,
  1832. (select e.ad_full_name from att_ad_x_base e where e.ad_code=concat(substr(b.ad_code,0,2),'0000000000')) as
  1833. ad_full_name,p.pblm_id from BIS_INSP_PBLM p
  1834. join (select * from BIS_INSP_ALL_OBJ o where o.ptype=2
  1835. <include refid="choseSql"/>
  1836. ) j on p.obj_id=j.obj_id
  1837. left join att_ad_x_base b on j.code=b.ad_code
  1838. ) w where w.ptype=2
  1839. <if test="areaId !=null and areaId !='' ">
  1840. and w.oid in (${areaId})
  1841. </if>
  1842. and vill_type is not null ) dd group by ad_full_name
  1843. </select>
  1844. <select id="countVillPblmByArea" parameterType="java.lang.String"
  1845. resultType="cn.com.goldenwater.dcproj.dto.VillTypeCount">
  1846. select count(ad_full_name) as total,ad_full_name,insp_Pblm_Name from (
  1847. select j.nm,j.id as oid,j.ptype,p.vill_type,substr(b.ad_full_name,0,INSTR(b.ad_full_name, '-', 1, 1)-1) as
  1848. ad_full_name,
  1849. (case p.vill_type when '1' then '行政村' when '2' then '水源地' when '3' then '饮水工程' else '责任落实' end) insp_Pblm_Name
  1850. from BIS_INSP_PBLM p
  1851. join (select * from BIS_INSP_ALL_OBJ o where o.ptype=2
  1852. <include refid="choseSql"/>
  1853. ) j on p.obj_id=j.obj_id
  1854. left join att_ad_x_base b on j.code=b.ad_code
  1855. ) w where w.ptype=2
  1856. <if test="areaId !=null and areaId !='' ">
  1857. and w.oid in (${areaId})
  1858. </if>
  1859. and w.vill_type is not null group by ad_full_name,insp_Pblm_Name
  1860. </select>
  1861. <!--根据督查组查询水闸问题-->
  1862. <select id="findWagaPblmBYAreaId" parameterType="java.lang.String"
  1863. resultType="cn.com.goldenwater.dcproj.model.WagaTotal">
  1864. select count(obj_code) as sub,ad_full_name as nm from (
  1865. select w.obj_code,ad_full_name from (
  1866. select t.obj_code,j.code,j.nm,j.id as oid,j.ptype,p.vill_type,p.insp_pblm_name,
  1867. (select e.ad_full_name from att_ad_x_base e where e.ad_code=concat(substr(b.ad_code,0,2),'0000000000')) as
  1868. ad_full_name,p.pblm_id from BIS_INSP_PBLM p
  1869. join (select * from BIS_INSP_ALL_OBJ o where o.ptype=6
  1870. <include refid="choseSql"/>
  1871. ) j on p.obj_id=j.obj_id
  1872. left join att_waga_base t on t.obj_code=j.code
  1873. left join att_ad_x_base b on t.ad_code=b.ad_code
  1874. ) w where w.ptype=6
  1875. <if test="areaId !=null and areaId !='' ">
  1876. and w.oid in (${areaId})
  1877. </if>
  1878. and vill_type is not null and insp_pblm_name is not null ) dd where ad_full_name is not null group by
  1879. ad_full_name
  1880. </select>
  1881. <!--水闸问题根据类型统计-->
  1882. <select id="countWagaPblmByType" parameterType="java.lang.String"
  1883. resultType="cn.com.goldenwater.dcproj.model.WagaType">
  1884. select count(ad_full_name) as total,ad_full_name as nm,eng_scal from (
  1885. select w.ad_full_name,w.eng_scal from (
  1886. select t.obj_code,t.eng_scal,j.code,j.nm,j.id as oid,j.ptype,p.vill_type,p.insp_pblm_name,
  1887. (select e.ad_full_name from att_ad_x_base e where e.ad_code=concat(substr(b.ad_code,0,2),'0000000000')) as
  1888. ad_full_name,
  1889. p.pblm_id from BIS_INSP_PBLM p
  1890. join (select * from BIS_INSP_ALL_OBJ o where o.ptype=6
  1891. <include refid="choseSql"/>
  1892. ) j on p.obj_id=j.obj_id
  1893. left join att_waga_base t on t.obj_code=j.code
  1894. left join att_ad_x_base b on t.ad_code=b.ad_code
  1895. ) w where w.ptype=6
  1896. <if test="areaId !=null and areaId !='' ">
  1897. and w.oid in (${areaId})
  1898. </if>
  1899. and vill_type is not null and insp_pblm_name is not null ) dd group by ad_full_name,eng_scal
  1900. </select>
  1901. <select id="countWagaPblmByCate" parameterType="java.lang.String"
  1902. resultType="cn.com.goldenwater.dcproj.model.WagaType">
  1903. select count(ad_full_name) as total,ad_full_name as nm,insp_pblm_cate as cate from (
  1904. select w.ad_full_name,w.insp_pblm_cate from (
  1905. select t.obj_code,t.eng_scal,j.code,j.nm,j.id as
  1906. oid,j.ptype,p.vill_type,p.insp_pblm_cate,p.insp_pblm_name,p.pblm_id ,
  1907. (select e.ad_full_name from att_ad_x_base e where e.ad_code=concat(substr(b.ad_code,0,2),'0000000000')) as
  1908. ad_full_name
  1909. from BIS_INSP_PBLM p
  1910. join (select * from BIS_INSP_ALL_OBJ o where o.ptype=6
  1911. <include refid="choseSql"/>
  1912. ) j on p.obj_id=j.obj_id
  1913. left join att_waga_base t on t.obj_code=j.code
  1914. left join att_ad_x_base b on t.ad_code=b.ad_code
  1915. ) w where w.ptype=6
  1916. <if test="areaId !=null and areaId !='' ">
  1917. and w.oid in (${areaId})
  1918. </if>
  1919. and vill_type is not null and insp_pblm_name is not null ) dd group by ad_full_name,insp_pblm_cate
  1920. </select>
  1921. <!--根据督查组查询水毁问题-->
  1922. <select id="findTrackPblmBYAreaId" parameterType="java.lang.String"
  1923. resultType="cn.com.goldenwater.dcproj.dto.TrackCount">
  1924. select count(wtdst_id) as project_Nm,ad_full_name as nm from (
  1925. select distinct w.wtdst_id,ad_full_name from (
  1926. select t.wtdst_id,j.code,j.nm,j.id as oid,j.ptype,p.vill_type,p.insp_pblm_name,
  1927. (select e.ad_full_name from att_ad_x_base e where e.ad_code=concat(substr(b.ad_code,0,2),'0000000000')) as
  1928. ad_full_name,p.pblm_id from BIS_INSP_PBLM p
  1929. join (select * from BIS_INSP_ALL_OBJ o where o.ptype=3
  1930. <include refid="choseSql"/>
  1931. ) j on p.obj_id=j.obj_id
  1932. left join bis_insp_wtdst t on t.wtdst_id=j.code
  1933. left join att_ad_x_base b on t.loc_ad=b.ad_code
  1934. ) w where w.ptype=3
  1935. <if test="areaId !=null and areaId !='' ">
  1936. and w.oid in (${areaId})
  1937. </if>
  1938. and vill_type is not null and insp_pblm_name is not null ) dd where ad_full_name is not null group by
  1939. ad_full_name
  1940. </select>
  1941. <select id="countTrackPblmByArea" parameterType="java.lang.String"
  1942. resultType="cn.com.goldenwater.dcproj.dto.TrackTypeCount">
  1943. select insp_pblm_name,ad_full_name as nm,count(insp_pblm_name) as total from (
  1944. select t.wtdst_id,j.code,j.nm,j.id as oid,j.ptype,p.vill_type,p.insp_pblm_name,
  1945. (select e.ad_full_name from att_ad_x_base e where e.ad_code=concat(substr(b.ad_code,0,2),'0000000000')) as
  1946. ad_full_name,p.pblm_id from BIS_INSP_PBLM p
  1947. join (select * from BIS_INSP_ALL_OBJ o where o.ptype=3
  1948. <include refid="choseSql"/>
  1949. ) j on p.obj_id=j.obj_id
  1950. left join bis_insp_wtdst t on t.wtdst_id=j.code
  1951. left join att_ad_x_base b on t.loc_ad=b.ad_code
  1952. ) w where w.ptype=3
  1953. <if test="areaId !=null and areaId !='' ">
  1954. and w.oid in (${areaId})
  1955. </if>
  1956. and vill_type is not null and insp_pblm_name is not null group by ad_full_name,insp_pblm_name
  1957. </select>
  1958. <!--水毁工程和问题总计查询-->
  1959. <select id="findTrackPblmPage" resultType="cn.com.goldenwater.dcproj.dto.TrackCount"
  1960. parameterType="cn.com.goldenwater.dcproj.param.CountParam">
  1961. select dd.*,k.nm from BIS_INSP_ALL_OBJ k,(
  1962. select obj_id,count(insp_pblm_cate) as total from (
  1963. select w.* from (
  1964. select j.nm,j.id as oid,j.obj_id,j.ptype,p.insp_pblm_name,p.insp_pblm_cate from BIS_INSP_PBLM p
  1965. join (select * from BIS_INSP_ALL_OBJ o where o.ptype=3
  1966. <include refid="choseSql"/>
  1967. ) j on p.obj_id=j.obj_id
  1968. ) w where w.ptype=3 and
  1969. REGEXP_LIKE(
  1970. W.OID,'^('||
  1971. ( case when(SELECT count(id) from BIS_INSP_ALL_RLATION WHERE PERSID =#{persId}
  1972. <include refid="orgIdSql"/>
  1973. )>0 then
  1974. (SELECT LISTAGG(id, '|') WITHIN GROUP(ORDER BY PERSID) as
  1975. id FROM BIS_INSP_ALL_RLATION WHERE PERSID =#{persId}
  1976. <include refid="orgIdSql"/>
  1977. )
  1978. else (select 'non' from dual) end)
  1979. ||')') and w.insp_pblm_name is not null and w.insp_pblm_cate is not null
  1980. ) a group by obj_id ) dd where k.obj_id=dd.obj_id order by total
  1981. </select>
  1982. <!--水毁根据督查问题类型统计-->
  1983. <select id="countTrack" parameterType="java.lang.String" resultType="cn.com.goldenwater.dcproj.dto.TrackTypeCount">
  1984. select obj_id,count(insp_pblm_cate) as total,insp_pblm_name from (
  1985. select w.* from (
  1986. select j.nm,j.id as oid,j.obj_id,j.ptype,p.insp_pblm_name,p.insp_pblm_cate from BIS_INSP_PBLM p
  1987. join (select * from BIS_INSP_ALL_OBJ o where o.ptype=3
  1988. <include refid="choseSql"/>
  1989. ) j on p.obj_id=j.obj_id
  1990. ) w where w.ptype=3 and obj_id in (${objIds}) and
  1991. REGEXP_LIKE(
  1992. W.OID,'^('||
  1993. ( case when(SELECT count(id) from BIS_INSP_ALL_RLATION WHERE PERSID =#{persId}
  1994. <include refid="orgIdSql"/>
  1995. )>0 then
  1996. (SELECT LISTAGG(id, '|') WITHIN GROUP(ORDER BY PERSID) as
  1997. id FROM BIS_INSP_ALL_RLATION WHERE PERSID =#{persId}
  1998. <include refid="orgIdSql"/>
  1999. )
  2000. else (select 'non' from dual) end)
  2001. ||')') and w.insp_pblm_name is not null and w.insp_pblm_cate is not null
  2002. ) a group by obj_id,insp_pblm_name
  2003. </select>
  2004. <!--水毁问题分类合计-->
  2005. <select id="totalCountTrack" parameterType="java.lang.String"
  2006. resultType="cn.com.goldenwater.dcproj.dto.TrackTypeCount">
  2007. select insp_pblm_name,count(insp_pblm_cate) as total from (
  2008. select j.nm,j.id as oid,j.obj_id,j.ptype,p.insp_pblm_name,p.insp_pblm_cate from BIS_INSP_PBLM p
  2009. join (select * from BIS_INSP_ALL_OBJ o where o.ptype=3
  2010. <include refid="choseSql"/>
  2011. ) j on p.obj_id=j.obj_id
  2012. ) w where w.ptype=3 and
  2013. REGEXP_LIKE(
  2014. W.OID,'^('||
  2015. ( case when(SELECT count(id) from BIS_INSP_ALL_RLATION WHERE PERSID =#{persId}
  2016. <include refid="orgIdSql"/>
  2017. )>0 then
  2018. (SELECT LISTAGG(id, '|') WITHIN GROUP(ORDER BY PERSID) as
  2019. id FROM BIS_INSP_ALL_RLATION WHERE PERSID =#{persId}
  2020. <include refid="orgIdSql"/>
  2021. )
  2022. else (select 'non' from dual) end)
  2023. ||')') and w.insp_pblm_name is not null and w.insp_pblm_cate is not null group by insp_pblm_name
  2024. </select>
  2025. <select id="countByType" resultType="cn.com.goldenwater.dcproj.dto.CountType" parameterType="java.util.Map">
  2026. select count(w.pblm_id) as count,(case obj_type when '1' then '小水库' when '3' then '水毁' when '5' then '地下水' end )
  2027. as name from (
  2028. select j.code,j.nm,j.id as oid,r.PERS_NAME,p.* from BIS_INSP_PBLM p
  2029. join (select * from BIS_INSP_ALL_OBJ o where 1=1
  2030. <include refid="choseSql"/>
  2031. ) j on p.obj_id=j.obj_id
  2032. join BIS_INSP_ALL_RLATION_PERS r on p.rec_pers=r.guid
  2033. ) w
  2034. where 1=1
  2035. <trim prefix="and" prefixOverrides="and | or ">
  2036. <if test="adCode != null and adCode != '' and adCode != 'null'">and w.CODE like '${adCode}%'</if>
  2037. </trim>
  2038. and REGEXP_LIKE(
  2039. W.oid,'^('||
  2040. ( case when(SELECT count(id) from BIS_INSP_ALL_RLATION WHERE PERSID =#{presId}
  2041. <include refid="orgIdSql"/>
  2042. )>0 then
  2043. (SELECT LISTAGG(id, '|') WITHIN GROUP(ORDER BY PERSID) as
  2044. id FROM BIS_INSP_ALL_RLATION WHERE PERSID =#{presId}
  2045. <include refid="orgIdSql"/>
  2046. )
  2047. else (select 'non' from dual) end)
  2048. ||')') and obj_type in (1,3,5) group by obj_type
  2049. union all
  2050. select count(w.pblm_id) as count,'行政村' as name from (
  2051. select j.code,j.nm,j.id as oid,r.PERS_NAME,p.* from BIS_INSP_PBLM p
  2052. join BIS_INSP_ALL_OBJ j on p.obj_id=j.obj_id
  2053. join BIS_INSP_ALL_RLATION_PERS r on p.rec_pers=r.guid
  2054. ) w
  2055. where 1=1
  2056. <trim prefix="and" prefixOverrides="and | or ">
  2057. <if test="adCode != null and adCode != '' and adCode != 'null'">and w.CODE like '${adCode}%'</if>
  2058. </trim>
  2059. and REGEXP_LIKE(
  2060. W.oid,'^('||
  2061. ( case when(SELECT count(id) from BIS_INSP_ALL_RLATION WHERE PERSID =#{presId}
  2062. <include refid="orgIdSql"/>
  2063. )>0 then
  2064. (SELECT LISTAGG(id, '|') WITHIN GROUP(ORDER BY PERSID) as
  2065. id FROM BIS_INSP_ALL_RLATION WHERE PERSID =#{presId}
  2066. <include refid="orgIdSql"/>
  2067. )
  2068. else (select 'non' from dual) end)
  2069. ||')') and obj_type=2 and w.village_code is not null
  2070. union all
  2071. select count(w.pblm_id) as count,'饮水工程' as name from (
  2072. select j.code,j.nm,j.id as oid,r.PERS_NAME,p.* from BIS_INSP_PBLM p
  2073. join BIS_INSP_ALL_OBJ j on p.obj_id=j.obj_id
  2074. join BIS_INSP_ALL_RLATION_PERS r on p.rec_pers=r.guid
  2075. ) w
  2076. where 1=1
  2077. <trim prefix="and" prefixOverrides="and | or ">
  2078. <if test="adCode != null and adCode != '' and adCode != 'null'">and w.CODE like '${adCode}%'</if>
  2079. </trim>
  2080. and REGEXP_LIKE(
  2081. W.oid,'^('||
  2082. ( case when(SELECT count(id) from BIS_INSP_ALL_RLATION WHERE PERSID =#{presId}
  2083. <include refid="orgIdSql"/>
  2084. )>0 then
  2085. (SELECT LISTAGG(id, '|') WITHIN GROUP(ORDER BY PERSID) as
  2086. id FROM BIS_INSP_ALL_RLATION WHERE PERSID =#{presId}
  2087. <include refid="orgIdSql"/>
  2088. )
  2089. else (select 'non' from dual) end)
  2090. ||')') and obj_type=2 and w.cws_code is not null
  2091. union all
  2092. select count(w.pblm_id) as count,'水源地' as name from (
  2093. select j.code,j.nm,j.id as oid,r.PERS_NAME,p.* from BIS_INSP_PBLM p
  2094. join BIS_INSP_ALL_OBJ j on p.obj_id=j.obj_id
  2095. join BIS_INSP_ALL_RLATION_PERS r on p.rec_pers=r.guid
  2096. ) w
  2097. where 1=1
  2098. <trim prefix="and" prefixOverrides="and | or ">
  2099. <if test="adCode != null and adCode != '' and adCode != 'null'">and w.CODE like '${adCode}%'</if>
  2100. </trim>
  2101. and REGEXP_LIKE(
  2102. W.oid,'^('||
  2103. ( case when(SELECT count(id) from BIS_INSP_ALL_RLATION WHERE PERSID =#{presId}
  2104. <include refid="orgIdSql"/>
  2105. )>0 then
  2106. (SELECT LISTAGG(id, '|') WITHIN GROUP(ORDER BY PERSID) as
  2107. id FROM BIS_INSP_ALL_RLATION WHERE PERSID =#{presId}
  2108. <include refid="orgIdSql"/>
  2109. )
  2110. else (select 'non' from dual) end)
  2111. ||')') and obj_type=2 and w.cws_code is null and w.village_code is null
  2112. </select>
  2113. <select id="selectCount" resultType="int">
  2114. select count(m.PBLM_ID) from bis_insp_pblm m,bis_insp_all_obj j
  2115. where m.obj_id=j.obj_id
  2116. <if test="startTime != null and startTime != ''">and m.COLL_TIME &gt; TO_DATE(#{startTime},'YYYY-MM-DD
  2117. HH24:MI:SS')
  2118. </if>
  2119. <if test="endTime != null and endTime != ''">and m.COLL_TIME &lt; TO_DATE(#{endTime},'YYYY-MM-DD HH24:MI:SS')
  2120. </if>
  2121. <if test="findTime != null and findTime != ''">and to_char(m.coll_time,'yyyy-MM-dd')=#{findTime}</if>
  2122. <if test="monthTime != null and monthTime != ''">and to_char(m.coll_time,'yyyy-MM')=#{monthTime}</if>
  2123. <if test="regid != null and regid != ''">and M.REGID = #{regid}</if>
  2124. <if test="objId != null and objId != ''">and M.OBJ_ID = #{objId}</if>
  2125. <if test="orgId != null and orgId != ''">and J.ORG_ID = #{orgId}</if>
  2126. <choose>
  2127. <when test="province != null and province != ''">
  2128. and j.ad_code = '${province}'
  2129. </when>
  2130. <otherwise>
  2131. and j.ad_code is null
  2132. </otherwise>
  2133. </choose>
  2134. </select>
  2135. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.BisInspPblm">
  2136. insert into bis_insp_pblm(
  2137. <include refid="table_columns"/>
  2138. )
  2139. values (
  2140. <include refid="entity_properties"/>
  2141. )
  2142. </insert>
  2143. <delete id="delete" parameterType="java.lang.String">
  2144. delete from bis_insp_pblm where PBLM_ID = #{id}
  2145. </delete>
  2146. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspPblm">
  2147. delete from bis_insp_pblm
  2148. <include refid="page_where"/>
  2149. </delete>
  2150. <update id="deleteInFlag" parameterType="java.lang.String">
  2151. update bis_insp_pblm set flag_valid = 0 where PBLM_ID = #{id}
  2152. </update>
  2153. <update id="deletePblmByTypeId" parameterType="cn.com.goldenwater.dcproj.model.BisInspPblm">
  2154. delete from bis_insp_pblm
  2155. where obj_type = #{objType}
  2156. and PBLMS_TYPE_ID in (${pblmsTypeId})
  2157. <if test="objType == '1'">
  2158. and obj_id in (select obj_id from bis_insp_rsvr_rgstr where rgstr_id = #{rgstrId})
  2159. </if>
  2160. </update>
  2161. <update id="updatePblmStatus" parameterType="cn.com.goldenwater.dcproj.model.BisInspPblm">
  2162. update bis_insp_pblm set pblmStat=#{pblmStat} where regid=#{regid}
  2163. </update>
  2164. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.BisInspPblm">
  2165. update bis_insp_pblm
  2166. <trim prefix="set" suffixOverrides=",">
  2167. <if test="newVillName != null and newVillName != ''">NEW_VILL_NAME = #{newVillName},</if>
  2168. <if test="pblmNameBz != null and pblmNameBz != ''">PBLM_NAME_BZ = #{pblmNameBz},</if>
  2169. <if test="snNumBz != null and snNumBz != ''">SN_NUM_BZ = #{snNumBz},</if>
  2170. <if test="checkPointBz != null and checkPointBz != ''">CHECK_POINT_BZ = #{checkPointBz},</if>
  2171. <if test="pblmDescBz != null and pblmDescBz != ''">PBLM_DESC_BZ = #{pblmDescBz},</if>
  2172. <if test="regid != null and regid != ''">REGID = #{regid},</if>
  2173. <if test="attachBz != null and attachBz != ''">attach_Bz = #{attachBz},</if>
  2174. <if test="quote != null and quote != ''">QUOTE = #{quote},</if>
  2175. <if test="commonFileIds != null and commonFileIds != ''">COMMON_FILE_IDS = #{commonFileIds},</if>
  2176. <if test="fileNo != null and fileNo != ''">FILE_NO = #{fileNo},</if>
  2177. <if test="fileNoNumber != null and fileNoNumber != ''">FILE_NO_NUMBER = #{fileNoNumber},</if>
  2178. <if test="pblmsId != null and pblmsId != '0'.toString()">PBLMS_ID = #{pblmsId},</if>
  2179. <if test="pblmsTypeId != null and pblmsTypeId != '0'.toString()">PBLMS_TYPE_ID = #{pblmsTypeId},</if>
  2180. <if test="pblmsId == '0'.toString()">PBLMS_ID ='',</if>
  2181. <if test="pblmsTypeId == '0'.toString()">PBLMS_TYPE_ID ='',</if>
  2182. <if test="objId != null and objId != ''">OBJ_ID = #{objId},</if>
  2183. <if test="objType != null and objType != ''">OBJ_TYPE = #{objType},</if>
  2184. <if test="waterUserId != null and waterUserId != ''">water_User_Id = #{waterUserId},</if>
  2185. <if test="inspGroupId != null and inspGroupId != ''">INSP_GROUP_ID = #{inspGroupId},</if>
  2186. <if test="pguid != null and pguid != ''">PGUID = #{pguid},</if>
  2187. <if test="inspPblmType != null and inspPblmType != ''">INSP_PBLM_TYPE = #{inspPblmType},</if>
  2188. <if test="inspPblmCode != null and inspPblmCode != ''">INSP_PBLM_CODE = #{inspPblmCode},</if>
  2189. <if test="inspPblmName != null and inspPblmName != ''">INSP_PBLM_NAME = #{inspPblmName},</if>
  2190. <if test="inspPblmDesc != null and inspPblmDesc != ''">INSP_PBLM_DESC = #{inspPblmDesc},</if>
  2191. <if test="inspAddDesc != null and inspAddDesc != ''">INSP_ADD_DESC = #{inspAddDesc},</if>
  2192. <if test="pblmLong != null and pblmLong != ''">PBLM_LONG = #{pblmLong},</if>
  2193. <if test="pblmLat != null and pblmLat != ''">PBLM_LAT = #{pblmLat},</if>
  2194. <if test="ifCasePblm != null and ifCasePblm != ''">IF_CASE_PBLM = #{ifCasePblm},</if>
  2195. <if test="inspPblmOrgName != null and inspPblmOrgName != ''">INSP_PBLM_ORG_NAME = #{inspPblmOrgName},</if>
  2196. <if test="pblmPersName != null and pblmPersName != ''">PBLM_PERS_NAME = #{pblmPersName},</if>
  2197. <if test="inspPblmCate != null and inspPblmCate != ''">INSP_PBLM_CATE = #{inspPblmCate},</if>
  2198. <if test="relBasis != null and relBasis != ''">REL_BASIS = #{relBasis},</if>
  2199. <if test="pblmStat != null and pblmStat != ''">PBLM_STAT = #{pblmStat},</if>
  2200. <if test="reviOpin != null and reviOpin != ''">REVI_OPIN = #{reviOpin},</if>
  2201. <if test="reviConc != null and reviConc != ''">REVI_CONC = #{reviConc},</if>
  2202. <if test="villageCode != null and villageCode != ''">village_Code = #{villageCode},</if>
  2203. <if test="cwsCode != null and cwsCode != ''">cws_Code = #{cwsCode},</if>
  2204. <if test="reviOrgGuid != null and reviOrgGuid != ''">REVI_ORG_GUID = #{reviOrgGuid},</if>
  2205. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  2206. <if test="collTime != null">COLL_TIME = #{collTime},</if>
  2207. <if test="recPers != null and recPers != ''">REC_PERS = #{recPers},</if>
  2208. <if test="note != null and note != ''">NOTE = #{note},</if>
  2209. <if test="hasVedio != null and hasVedio != ''">HAS_VEDIO = #{hasVedio},</if>
  2210. <if test="problemType != null and problemType != ''">problem_Type = #{problemType},</if>
  2211. <if test="villType != null and villType != ''">VILL_TYPE = #{villType},</if>
  2212. <if test="defectTypeId != null and defectTypeId != '0'.toString()">DEFECT_TYPE_ID = #{defectTypeId},</if>
  2213. <if test="qualityTypeId != null and qualityTypeId != '0'.toString()">QUALITY_TYPE_ID = #{qualityTypeId},
  2214. </if>
  2215. <if test="defectTypeId == '0'.toString()">DEFECT_TYPE_ID ='',</if>
  2216. <if test="qualityTypeId == '0'.toString()">QUALITY_TYPE_ID ='',</if>
  2217. <if test="gongdiBzId != null and gongdiBzId != '0'.toString()">gongdi_Bz_Id = #{gongdiBzId},</if>
  2218. <if test="gongdiBzId == '0'.toString()">gongdi_Bz_Id ='',</if>
  2219. <if test="fdbkId != null and fdbkId != ''">FDBK_ID = #{fdbkId},</if>
  2220. <if test="itemId != null and itemId != ''">item_Id = #{itemId},</if>
  2221. <if test="uptm != null">UP_TM = #{uptm},</if>
  2222. <if test="pblmReason != null and pblmReason != ''">PBLM_REASON = #{pblmReason},</if>
  2223. <if test="pblmSggtn != null and pblmSggtn != ''">PBLM_SGGTN = #{pblmSggtn},</if>
  2224. <if test="objCode != null and objCode != ''">OBJ_CODE = #{objCode},</if>
  2225. <if test="objName != null and objName != ''">OBJ_NAME = #{objName},</if>
  2226. <if test="objAdCode != null and objAdCode != ''">OBJ_AD_CODE = #{objAdCode},</if>
  2227. <if test="wtdstNote != null and wtdstNote != ''">WTDST_NOTE = #{wtdstNote},</if>
  2228. <if test="state != null and state != ''">STATE = #{state},</if>
  2229. <if test="score != null and score != ''">SCORE = #{score},</if>
  2230. <if test="damRegCode != null and damRegCode != ''">DAM_REG_CODE = #{damRegCode},</if>
  2231. </trim>
  2232. <where>PBLM_ID = #{pblmId}</where>
  2233. </update>
  2234. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspPblm">
  2235. update bis_insp_pblm
  2236. <trim prefix="set" suffixOverrides=",">
  2237. <if test="newVillName != null and newVillName != ''">NEW_VILL_NAME = #{newVillName},</if>
  2238. <if test="pblmNameBz != null and pblmNameBz != ''">PBLM_NAME_BZ = #{pblmNameBz},</if>
  2239. <if test="snNumBz != null and snNumBz != ''">SN_NUM_BZ = #{snNumBz},</if>
  2240. <if test="checkPointBz != null and checkPointBz != ''">CHECK_POINT_BZ = #{checkPointBz},</if>
  2241. <if test="pblmDescBz != null and pblmDescBz != ''">PBLM_DESC_BZ = #{pblmDescBz},</if>
  2242. <if test="regid != null and regid != ''">REGID = #{regid},</if>
  2243. <if test="attachBz != null and attachBz != ''">attach_Bz = #{attachBz},</if>
  2244. <if test="commonFileIds != null and commonFileIds != ''">COMMON_FILE_IDS = #{commonFileIds},</if>
  2245. <if test="fileNo != null and fileNo != ''">FILE_NO = #{fileNo},</if>
  2246. <if test="fileNoNumber != null and fileNoNumber != ''">FILE_NO_NUMBER = #{fileNoNumber},</if>
  2247. <if test="pblmsId != null and pblmsId != ''">PBLMS_ID = #{pblmsId},</if>
  2248. <if test="pblmId != null and pblmId != ''">PBLM_ID = #{pblmId},</if>
  2249. <if test="waterUserId != null and waterUserId != ''">water_User_Id = #{waterUserId},</if>
  2250. <if test="objId != null and objId != ''">OBJ_ID = #{objId},</if>
  2251. <if test="objType != null and objType != ''">OBJ_TYPE = #{objType},</if>
  2252. <if test="inspGroupId != null and inspGroupId != ''">INSP_GROUP_ID = #{inspGroupId},</if>
  2253. <if test="pguid != null and pguid != ''">PGUID = #{pguid},</if>
  2254. <if test="itemId != null and itemId != ''">item_Id = #{itemId},</if>
  2255. <if test="inspPblmType != null and inspPblmType != ''">INSP_PBLM_TYPE = #{inspPblmType},</if>
  2256. <if test="inspPblmCode != null and inspPblmCode != ''">INSP_PBLM_CODE = #{inspPblmCode},</if>
  2257. <if test="inspPblmName != null and inspPblmName != ''">INSP_PBLM_NAME = #{inspPblmName},</if>
  2258. <if test="inspPblmDesc != null and inspPblmDesc != ''">INSP_PBLM_DESC = #{inspPblmDesc},</if>
  2259. <if test="inspAddDesc != null and inspAddDesc != ''">INSP_ADD_DESC = #{inspAddDesc},</if>
  2260. <if test="pblmLong != null and pblmLong != ''">PBLM_LONG = #{pblmLong},</if>
  2261. <if test="pblmLat != null and pblmLat != ''">PBLM_LAT = #{pblmLat},</if>
  2262. <if test="ifCasePblm != null and ifCasePblm != ''">IF_CASE_PBLM = #{ifCasePblm},</if>
  2263. <if test="inspPblmOrgName != null and inspPblmOrgName != ''">INSP_PBLM_ORG_NAME = #{inspPblmOrgName},</if>
  2264. <if test="pblmPersName != null and pblmPersName != ''">PBLM_PERS_NAME = #{pblmPersName},</if>
  2265. <if test="inspPblmCate != null and inspPblmCate != ''">INSP_PBLM_CATE = #{inspPblmCate},</if>
  2266. <if test="pblmStat != null and pblmStat != ''">PBLM_STAT = #{pblmStat},</if>
  2267. <if test="reviOpin != null and reviOpin != ''">REVI_OPIN = #{reviOpin},</if>
  2268. <if test="reviConc != null and reviConc != ''">REVI_CONC = #{reviConc},</if>
  2269. <if test="reviOrgGuid != null and reviOrgGuid != ''">REVI_ORG_GUID = #{reviOrgGuid},</if>
  2270. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  2271. <if test="fdbkId != null and fdbkId != ''">FDBK_ID = #{fdbkId},</if>
  2272. <if test="collTime != null">COLL_TIME = #{collTime},</if>
  2273. <if test="villageCode != null and villageCode != ''">village_Code = #{villageCode},</if>
  2274. <if test="problemType != null and problemType != ''">problem_Type = #{problemType},</if>
  2275. <if test="cwsCode != null and cwsCode != ''">cws_Code = #{cwsCode},</if>
  2276. <if test="recPers != null and recPers != ''">REC_PERS = #{recPers},</if>
  2277. <if test="note != null and note != ''">NOTE = #{note},</if>
  2278. <if test="villType != null and villType != ''">VILL_TYPE = #{villType},</if>
  2279. <if test="hasVedio != null and hasVedio != ''">HAS_VEDIO = #{hasVedio},</if>
  2280. <if test="defectTypeId != null and defectTypeId != ''">DEFECT_TYPE_ID = #{defectTypeId},</if>
  2281. <if test="qualityTypeId != null and qualityTypeId != ''">QUALITY_TYPE_ID = #{qualityTypeId},</if>
  2282. <if test="gongdiBzId != null and gongdiBzId != '0'.toString()">gongdi_Bz_Id = #{gongdiBzId},</if>
  2283. <if test="gongdiBzId == '0'.toString()">gongdi_Bz_Id ='',</if>
  2284. <if test="uptm != null">UP_TM = #{uptm},</if>
  2285. <if test="pblmReason != null and pblmReason != ''">PBLM_REASON = #{pblmReason},</if>
  2286. <if test="pblmSggtn != null and pblmSggtn != ''">PBLM_SGGTN = #{pblmSggtn},</if>
  2287. <if test="objCode != null and objCode != ''">OBJ_CODE = #{objCode},</if>
  2288. <if test="objName != null and objName != ''">OBJ_NAME = #{objName},</if>
  2289. <if test="objAdCode != null and objAdCode != ''">OBJ_AD_CODE = #{objAdCode},</if>
  2290. <if test="wtdstNote != null and wtdstNote != ''">WTDST_NOTE = #{wtdstNote},</if>
  2291. </trim>
  2292. <include refid="page_where"/>
  2293. </update>
  2294. <!-- 其他自定义SQL -->
  2295. <select id="getBisInspPblmById" resultType="cn.com.goldenwater.dcproj.model.BisInspPblmDelLog">
  2296. select t.pblm_id,t.PBLM_NAME_BZ,t.CHECK_POINT_BZ,t.SN_NUM_BZ,t.PBLM_DESC_BZ,
  2297. t.obj_id,
  2298. t.obj_type,
  2299. t.quote,
  2300. t.insp_group_id,
  2301. t.pguid,
  2302. t.insp_pblm_type,
  2303. t.insp_pblm_code,
  2304. t.insp_pblm_name,
  2305. t.insp_pblm_desc,
  2306. t.insp_add_desc,
  2307. t.pblm_long,
  2308. t.pblm_lat,
  2309. t.if_case_pblm,
  2310. t.insp_pblm_org_name,
  2311. t.pblm_pers_name,
  2312. t.insp_pblm_cate,
  2313. t.pblm_stat,
  2314. t.revi_opin,
  2315. t.revi_conc,
  2316. t.revi_org_guid,
  2317. t.data_stat,
  2318. to_char(t.coll_time,'YYYY-MM-DD HH24:MI:SS') coll_time,
  2319. t.rec_pers,
  2320. t.note,
  2321. t.regid,
  2322. t.common_file_ids,
  2323. t.file_no,
  2324. t.file_no_number,
  2325. t.pblms_id,
  2326. t.pblms_type_id,
  2327. t.vill_type,
  2328. t.cws_code,
  2329. t.WTDST_NOTE,
  2330. t.village_code from BIS_INSP_PBLM t WHERE t.pblm_id = #{pblmId}
  2331. </select>
  2332. <insert id="insertPblmDelLog" parameterType="cn.com.goldenwater.dcproj.model.BisInspPblmDelLog">
  2333. insert into BIS_INSP_PBLM_DEL_LOG(
  2334. <include refid="table_columns_pblmDelLog"/>
  2335. )
  2336. values (
  2337. <include refid="entity_properties_pblmDelLog"/>
  2338. )
  2339. </insert>
  2340. <sql id="choseSql">
  2341. <choose>
  2342. <when test="province != null and province !=''">
  2343. and o.ad_code = '${province}'
  2344. </when>
  2345. </choose>
  2346. </sql>
  2347. <select id="countPblmIncByDay" parameterType="cn.com.goldenwater.dcproj.param.IndexPblmParam"
  2348. resultType="cn.com.goldenwater.dcproj.dto.CountTime">
  2349. select LTRIM(to_char(TO_DATE(f.dat,'yyyy-mm-dd'),'dd'),'0') as name,f.value from (
  2350. select c.dat,nvl(d.value,0) as value from (
  2351. select to_char(to_date(#{seltime},'yyyy-mm-dd')+level-1,'yyyy-mm-dd') as dat
  2352. from dual
  2353. connect by level &lt;=to_date(#{ettm},'yyyy-mm-dd')-to_date(#{seltime},'yyyy-mm-dd')+1
  2354. ) c left join (
  2355. select to_char(w.COLL_TIME,'yyyy-MM-dd') AS NAME,count(1)as value from (
  2356. <trim>
  2357. <include refid="lyzSql"/>
  2358. </trim>
  2359. ) w where 1=1
  2360. <if test="sttm != null and sttm != ''">and w.coll_time&gt;= TO_DATE(#{sttm},'YYYY-MM-DD')</if>
  2361. <if test="ettm != null and ettm != ''">and to_char(w.coll_time,'yyyy-MM-dd') &lt;= #{ettm}</if>
  2362. <if test="orgIds != null and orgIds != ''">
  2363. and substr(w.id,4,3) in (${orgIds})
  2364. </if>
  2365. <if test="adCode != null and adCode != ''">and substr(w.id,4,3) in (${orgIds})and w.AD_CODE like
  2366. CONCAT(#{adCode}, '%')
  2367. </if>
  2368. <if test="type != null and type != ''">and w.obj_type in (${type})</if>
  2369. group by to_char(w.COLL_TIME,'yyyy-MM-dd')
  2370. ) d on c.dat = d.name
  2371. order by c.dat
  2372. ) f
  2373. </select>
  2374. <select id="countPblmTotalByDay" parameterType="cn.com.goldenwater.dcproj.param.IndexPblmParam"
  2375. resultType="cn.com.goldenwater.dcproj.dto.CountTime">
  2376. select LTRIM(to_char(TO_DATE(f.dat,'yyyy-mm-dd'),'dd'),'0') as name,f.value from (
  2377. select x.dat,sum(x.value) over(order by x.dat) as value from (
  2378. select c.dat,nvl(d.value,0) as value from (
  2379. select to_char(to_date(#{sttm},'yyyy-mm-dd')+level-1,'yyyy-mm-dd') as dat
  2380. from dual
  2381. connect by level &lt;=to_date(#{ettm},'yyyy-mm-dd')-to_date(#{sttm},'yyyy-mm-dd')+1
  2382. ) c left join (
  2383. select to_char(w.COLL_TIME,'yyyy-MM-dd') AS NAME,count(1)as value from (
  2384. <trim>
  2385. <include refid="lyzSql"/>
  2386. </trim>
  2387. ) w where 1=1
  2388. <if test="sttm != null and sttm != ''">and w.coll_time&gt;= TO_DATE(#{sttm},'YYYY-MM-DD')</if>
  2389. <if test="ettm != null and ettm != ''">and to_char(w.coll_time,'yyyy-MM-dd') &lt;= #{ettm}</if>
  2390. <if test="orgIds != null and orgIds != ''">
  2391. and substr(w.id,4,3) in (${orgIds})
  2392. </if>
  2393. <if test="adCode != null and adCode != ''">and substr(w.id,4,3) in (${orgIds})and w.AD_CODE like
  2394. CONCAT(#{adCode}, '%')
  2395. </if>
  2396. <if test="type != null and type != ''">and w.obj_type in (${type})</if>
  2397. group by to_char(w.COLL_TIME,'yyyy-MM-dd')
  2398. ) d on c.dat = d.name
  2399. order by c.dat
  2400. )x
  2401. ) f
  2402. </select>
  2403. <select id="countPblmIncByWeek" parameterType="cn.com.goldenwater.dcproj.param.IndexPblmParam"
  2404. resultType="cn.com.goldenwater.dcproj.dto.CountTime">
  2405. select to_char(w.COLL_TIME,'iw') AS NAME,count(1)as value from (
  2406. <trim>
  2407. <include refid="lyzSql"/>
  2408. </trim>
  2409. ) w where 1=1
  2410. <if test="sttm != null and sttm != ''">and w.coll_time&gt;= TO_DATE(#{sttm},'YYYY-MM-DD')</if>
  2411. <if test="stime != null and stime != ''">and w.coll_time&lt;= TO_DATE(#{stime},'YYYY-MM-DD')</if>
  2412. <if test="orgIds != null and orgIds != ''">
  2413. and substr(w.id,4,3) in (${orgIds})
  2414. </if>
  2415. <if test="adCode != null and adCode != ''">and w.AD_CODE like CONCAT(#{adCode}, '%')</if>
  2416. <if test="type != null and type != ''">and w.obj_type in (${type})</if>
  2417. group by to_char(w.COLL_TIME,'iw')
  2418. order by name
  2419. </select>
  2420. <select id="countPblmTotalByWeek" parameterType="cn.com.goldenwater.dcproj.param.IndexPblmParam"
  2421. resultType="cn.com.goldenwater.dcproj.dto.CountTime">
  2422. select c.name,sum(c.value) over(order by c.name) as value from (
  2423. select to_char(w.COLL_TIME,'w') AS NAME,count(1)as value from (
  2424. <trim>
  2425. <include refid="lyzSql"/>
  2426. </trim>
  2427. ) w where 1=1
  2428. <if test="stime != null and stime != ''">and to_char(w.coll_time,'yyyy-MM') =
  2429. to_char(TO_DATE(#{stime},'yyyy-MM-dd'),'yyyy-MM')
  2430. </if>
  2431. <if test="orgIds != null and orgIds != ''">
  2432. and substr(w.id,4,3) in (${orgIds})
  2433. </if>
  2434. <if test="adCode != null and adCode != ''">and w.AD_CODE like CONCAT(#{adCode}, '%')</if>
  2435. <if test="type != null and type != ''">and w.obj_type in (${type})</if>
  2436. group by to_char(w.COLL_TIME,'w')
  2437. order by name
  2438. ) c
  2439. </select>
  2440. <select id="countPblmIncByMonth" parameterType="cn.com.goldenwater.dcproj.param.IndexPblmParam"
  2441. resultType="cn.com.goldenwater.dcproj.dto.CountTime">
  2442. select LTRIM(to_char(to_date(f.name,'yyyy-MM'),'MM'),'0') as name, f.value as value from (
  2443. select to_char(to_date(m.monthlist,'yyyy-MM'),'yyyy-MM') as name,nvl(d.value,0) as value from (
  2444. SELECT TO_CHAR(ADD_MONTHS(to_date(to_char(to_date(#{seltime}, 'yyyy-MM-dd'),'yyyy-MM'),'yyyy-MM'), ROWNUM - 1),
  2445. 'yyyy-MM') as monthlist
  2446. FROM DUAL
  2447. CONNECT BY ROWNUM &lt;=
  2448. months_between(to_date(to_char(to_date(#{ettm}, 'yyyy-MM-dd'),'yyyy-MM'), 'yyyy-MM'),
  2449. to_date(to_char(to_date(#{seltime}, 'yyyy-MM-dd'),'yyyy-MM'),'yyyy-MM')) + 1
  2450. ) m left join (
  2451. select to_char(COLL_TIME,'yyyy-MM') as name,count(*) as value from (
  2452. <trim>
  2453. <include refid="lyzSql"/>
  2454. </trim>
  2455. ) w where 1=1
  2456. <if test="sttm != null and sttm != ''">and w.coll_time &gt;= TO_DATE(#{sttm},'YYYY-MM-DD')</if>
  2457. <if test="ettm != null and ettm != ''">and to_char(w.coll_time,'yyyy-MM') &lt;=
  2458. to_char(TO_DATE(#{ettm},'yyyy-MM-dd'),'yyyy-MM')
  2459. </if>
  2460. <if test="orgIds != null and orgIds != ''">
  2461. and substr(w.id,4,3) in (${orgIds})
  2462. </if>
  2463. <if test="adCode != null and adCode != ''">and w.AD_CODE like CONCAT(#{adCode}, '%')</if>
  2464. <if test="type != null and type != ''">and w.obj_type in (${type})</if>
  2465. group by to_char(COLL_TIME,'yyyy-MM')
  2466. ) d on m.monthlist = d.name
  2467. order by m.monthlist
  2468. ) f
  2469. </select>
  2470. <select id="countPblmTotalByMonth" parameterType="cn.com.goldenwater.dcproj.param.IndexPblmParam"
  2471. resultType="cn.com.goldenwater.dcproj.dto.CountTime">
  2472. select LTRIM(to_char(to_date(f.name,'yyyy-MM'),'MM'),'0') as name, f.value as value from (
  2473. select c.name,sum(c.value) over(order by c.name) as value from (
  2474. select to_char(to_date(m.monthlist,'yyyy-MM'),'yyyy-MM') as name,nvl(d.value,0) as value from (
  2475. SELECT TO_CHAR(ADD_MONTHS(to_date(to_char(to_date(#{sttm}, 'yyyy-MM-dd'),'yyyy-MM'),'yyyy-MM'), ROWNUM - 1),
  2476. 'yyyy-MM') as monthlist
  2477. FROM DUAL
  2478. CONNECT BY ROWNUM &lt;=
  2479. months_between(to_date(to_char(to_date(#{stime}, 'yyyy-MM-dd'),'yyyy-MM'), 'yyyy-MM'),
  2480. to_date(to_char(to_date(#{sttm}, 'yyyy-MM-dd'),'yyyy-MM'),'yyyy-MM')) + 1
  2481. ) m left join (
  2482. select to_char(COLL_TIME,'yyyy-MM') as name,count(*) as value from (
  2483. <trim>
  2484. <include refid="lyzSql"/>
  2485. </trim>
  2486. ) w where 1=1
  2487. <if test="sttm != null and sttm != ''">and w.coll_time&lt;= TO_DATE(#{stime},'YYYY-MM-DD')</if>
  2488. <if test="stime != null and stime != ''">and to_char(w.coll_time,'yyyy-MM') &gt;=
  2489. to_char(TO_DATE(#{sttm},'yyyy-MM-dd'),'yyyy-MM')
  2490. </if>
  2491. <if test="orgIds != null and orgIds != ''">
  2492. and substr(w.id,4,3) in (${orgIds})
  2493. </if>
  2494. <if test="adCode != null and adCode != ''">and w.AD_CODE like CONCAT(#{adCode}, '%')</if>
  2495. <if test="type != null and type != ''">and w.obj_type in (${type})</if>
  2496. group by to_char(COLL_TIME,'yyyy-MM')
  2497. ) d on m.monthlist = d.name
  2498. ) c ) f
  2499. </select>
  2500. <select id="countPblmByTime" parameterType="cn.com.goldenwater.dcproj.param.IndexPblmParam" resultType="Integer">
  2501. select count(*) from (
  2502. <trim>
  2503. <include refid="lyzSql"/>
  2504. </trim>
  2505. ) w where 1=1 and w.id is not null
  2506. <if test="sttm != null and sttm != ''">and w.coll_time&gt;= TO_DATE(#{sttm},'YYYY-MM-DD')</if>
  2507. <if test="ettm != null and ettm != ''">and w.coll_time &lt; TO_DATE(#{ettm},'YYYY-MM-DD')+1</if>
  2508. <if test="orgIds != null and orgIds != ''">
  2509. and substr(w.id,4,3) in (${orgIds})
  2510. </if>
  2511. <if test="adCode != null and adCode != ''">and w.AD_CODE like CONCAT(#{adCode}, '%')</if>
  2512. <if test="type != null and type != ''">and w.obj_type in (${type})</if>
  2513. </select>
  2514. <sql id="provinceSql">
  2515. <choose>
  2516. <when test="province !=null and province !=''">
  2517. and o.ad_code =#{province}
  2518. </when>
  2519. <otherwise>
  2520. and o.ad_code is null
  2521. </otherwise>
  2522. </choose>
  2523. </sql>
  2524. <sql id="lyzSql">
  2525. select OB.ADM_DIV AS AD_CODE,t.coll_time AS COLL_TIME,o.ID AS ID,t.obj_type from BIS_INSP_PBLM t
  2526. left join bis_insp_all_obj o
  2527. on t.obj_id = o.obj_id
  2528. left join ATT_RS_BASE OB ON O.CODE = OB.RS_CODE where t.obj_type = 1
  2529. <if test="quote !=null and quote !=''">
  2530. and t.quote=#{quote}
  2531. </if>
  2532. <include refid="provinceSql"/>
  2533. union all
  2534. select o.code AS AD_CODE,t.coll_time AS COLL_TIME,o.ID AS ID,t.obj_type from BIS_INSP_PBLM t
  2535. left join bis_insp_all_obj o
  2536. on t.obj_id = o.obj_id where t.obj_type = 2
  2537. <if test="quote !=null and quote !=''">
  2538. and t.quote=#{quote}
  2539. </if>
  2540. <include refid="provinceSql"/>
  2541. union all
  2542. select OB.LOC_AD AS AD_CODE,t.coll_time AS COLL_TIME,o.ID AS ID,t.obj_type
  2543. from BIS_INSP_PBLM t
  2544. left join bis_insp_all_obj o
  2545. on t.obj_id = o.obj_id
  2546. left join BIS_INSP_WTDST OB ON O.CODE = OB.WTDST_ID where t.obj_type = 3
  2547. <if test="quote !=null and quote !=''">
  2548. and t.quote=#{quote}
  2549. </if>
  2550. <include refid="provinceSql"/>
  2551. union all
  2552. select OB.AD_CODE AS AD_CODE ,t.coll_time AS COLL_TIME,o.ID AS ID ,t.obj_type
  2553. from BIS_INSP_PBLM t
  2554. left join bis_insp_all_obj o
  2555. on t.obj_id = o.obj_id
  2556. left join ATT_EMPWTPRJ_BASE OB ON O.CODE = OB.ID where t.obj_type = 4
  2557. <if test="quote !=null and quote !=''">
  2558. and t.quote=#{quote}
  2559. </if>
  2560. <include refid="provinceSql"/>
  2561. union all
  2562. select OB.ADCD AS AD_CODE,t.coll_time AS COLL_TIME,o.ID AS ID,t.obj_type
  2563. from BIS_INSP_PBLM t
  2564. left join bis_insp_all_obj o
  2565. on t.obj_id = o.obj_id
  2566. left join ATT_GRW_BASE OB ON O.CODE = OB.STCD where t.obj_type = 5
  2567. <if test="quote !=null and quote !=''">
  2568. and t.quote=#{quote}
  2569. </if>
  2570. <include refid="provinceSql"/>
  2571. union all
  2572. select OB.AD_CODE AS AD_CODE,t.coll_time AS COLL_TIME,o.ID AS ID,t.obj_type
  2573. from BIS_INSP_PBLM t
  2574. left join bis_insp_all_obj o
  2575. on t.obj_id = o.obj_id
  2576. left join ATT_WAGA_BASE OB ON O.CODE = OB.OBJ_CODE where t.obj_type = 6
  2577. <if test="quote !=null and quote !=''">
  2578. and t.quote=#{quote}
  2579. </if>
  2580. <include refid="provinceSql"/>
  2581. union all
  2582. select OB.AD_CODE AS AD_CODE,t.coll_time AS COLL_TIME,o.ID AS ID,t.obj_type
  2583. from BIS_INSP_PBLM t
  2584. left join bis_insp_all_obj o
  2585. on t.obj_id = o.obj_id
  2586. left join ATT_EMPWTPRJ_BASE OB ON O.CODE = OB.ID where t.obj_type = 7
  2587. <if test="quote !=null and quote !=''">
  2588. and t.quote=#{quote}
  2589. </if>
  2590. <include refid="provinceSql"/>
  2591. union all
  2592. select OB.AD_CODE AS AD_CODE,t.intm AS COLL_TIME,o.ID AS ID,t.obj_type
  2593. from tac_pblm_info t
  2594. left join bis_insp_all_obj o
  2595. on t.obj_id = o.obj_id
  2596. left join tac_att_pawp_base OB ON O.CODE = OB.ID where t.obj_type = 8
  2597. union all
  2598. select OB.AD_CODE AS AD_CODE,t.coll_time AS COLL_TIME,o.ID AS ID,t.obj_type
  2599. from BIS_INSP_PBLM t
  2600. left join bis_insp_all_obj o
  2601. on t.obj_id = o.obj_id
  2602. left join att_fsc_base OB ON O.CODE = OB.ID where t.obj_type = 9
  2603. <if test="quote !=null and quote !=''">
  2604. and t.quote=#{quote}
  2605. </if>
  2606. <include refid="provinceSql"/>
  2607. union all
  2608. select OB.AD_CODE AS AD_CODE,t.coll_time AS COLL_TIME,o.ID AS ID,t.obj_type
  2609. from BIS_INSP_PBLM t
  2610. left join bis_insp_all_obj o
  2611. on t.obj_id = o.obj_id
  2612. left join att_other_base OB ON O.CODE = OB.ID where t.obj_type = 10
  2613. <if test="quote !=null and quote !=''">
  2614. and t.quote=#{quote}
  2615. </if>
  2616. <include refid="provinceSql"/>
  2617. union all
  2618. select OB.ADM_DIV AS AD_CODE,t.coll_time AS COLL_TIME,o.ID AS ID,t.obj_type
  2619. from BIS_INSP_PBLM t
  2620. left join bis_insp_all_obj o
  2621. on t.obj_id = o.obj_id
  2622. left join ATT_RS_BASE OB ON o.CODE = OB.RS_CODE where t.obj_type = 22
  2623. <if test="quote !=null and quote !=''">
  2624. and t.quote=#{quote}
  2625. </if>
  2626. <include refid="provinceSql"/>
  2627. </sql>
  2628. <select id="findSdPblmList" parameterType="cn.com.goldenwater.dcproj.param.SdPblmParam"
  2629. resultMap="bisInspPblmResultMap">
  2630. select w.* from (
  2631. select ba.sd_name as rs_name,l.entm,l.sttm,j.code,j.nm,j.id as
  2632. oid,j.ptype,r.PERS_NAME,p.*,s.insp_pblms_name,s.check_point,s.attach,s.sheet,s.sn_num,b.ad_full_name,b.ad_code,l.pnm
  2633. as org_nm,j.id as org_id from (
  2634. select * from BIS_INSP_PBLM pb where pb.obj_type=#{pType}
  2635. <if test="ifCasePblm != null and ifCasePblm != ''">and pb.IF_CASE_PBLM = #{ifCasePblm}</if>
  2636. <if test="hasVedio != null and hasVedio != ''">and pb.HAS_VEDIO = #{hasVedio}</if>
  2637. <if test="startTime != null and startTime != ''">
  2638. AND pb.COLL_TIME &gt;= TO_DATE(#{startTime},'YYYY-MM-DD')
  2639. </if>
  2640. <if test="quote !=null and quote !=''">
  2641. and pb.quote=#{quote}
  2642. </if>
  2643. <if test="findTime != null and findTime != ''">and pb.COLL_TIME=TO_DATE(#{findTime},'YYYY-MM-DD')</if>
  2644. <if test="reviConc != null and reviConc != ''">and pb.revi_conc = #{reviConc}</if>
  2645. <if test="inspPblmCate != null and inspPblmCate != ''">and pb.INSP_PBLM_CATE = #{inspPblmCate}</if>
  2646. <if test="endTime != null and endTime != ''">
  2647. AND pb.COLL_TIME &lt; TO_DATE(#{endTime},'YYYY-MM-DD')+1
  2648. </if>
  2649. <if test="inspPblmName != null and inspPblmName != ''">and pb.INSP_PBLM_NAME like '%${inspPblmName}%'</if>
  2650. <if test="objId != null and objId != ''">and pb.obj_Id = #{objId}</if>
  2651. ) p left join (select * from bis_insp_all_obj bj where bj.ptype = #{pType}) j on p.obj_id = j.obj_id
  2652. join BIS_INSP_ALL_RLATION_PERS r on p.rec_pers=r.guid
  2653. left join bis_insp_rect_fdbk k on p.pblm_id=k.pblm_id and k.guid=p.FDBK_ID
  2654. left join BIS_INSP_SD_RGSTR ba on ba.obj_id=j.obj_id
  2655. left join att_ad_x_base b on ba.ad_code=b.ad_code
  2656. left join OBJ_INSP_PBLMS s on p.pblms_type_id=s.guid
  2657. left join BIS_INSP_ALL l on l.id=j.id
  2658. ) w where w.ptype=#{pType}
  2659. <if test="tabType =='2'.toString()">
  2660. and w.entm &lt;to_date(#{nowTime},'yyyy-MM-dd')+1
  2661. </if>
  2662. <if test="tabType =='1'.toString()">
  2663. and w.entm &gt;=to_date(#{nowTime},'yyyy-MM-dd')
  2664. </if>
  2665. and
  2666. REGEXP_LIKE(
  2667. W.OID,'^('||
  2668. ( case when(SELECT count(id) from BIS_INSP_ALL_RLATION WHERE PERSID =#{persId}
  2669. <include refid="orgIdSql"/>
  2670. )>0 then
  2671. (SELECT LISTAGG(id, '|') WITHIN GROUP(ORDER BY PERSID) as
  2672. id FROM BIS_INSP_ALL_RLATION WHERE PERSID =#{persId}
  2673. <include refid="orgIdSql"/>
  2674. )
  2675. else (select 'non' from dual) end)
  2676. ||')')
  2677. <if test="nm != null and nm != ''">and w.nm like '%${nm}%'</if>
  2678. <if test="orgNm != null and orgNm != ''">and w.org_nm like '%${orgNm}%'</if>
  2679. <if test="sdName != null and sdName != ''">and w.rs_name like '%${sdName}%'</if>
  2680. <if test="adFullName != null and adFullName != ''">and w.ad_full_name like '%${adFullName}%'</if>
  2681. <if test="persName != null and persName != ''">and w.PERS_NAME like '%${persName}%'</if>
  2682. <if test="codes != null and codes != ''">and w.CODE in (${codes})</if>
  2683. <if test="recPers !=null and recPers !=''">
  2684. and w.rec_pers=#{recPers}
  2685. </if>
  2686. <if test="adCodes != null and adCodes != ''">and w.AD_CODE in (${adCodes})</if>
  2687. <if test="orgIds != null and orgIds != ''">and w.org_id in (${orgIds})</if>
  2688. <if test="inspPblmType != null and inspPblmType != ''">and w.INSP_PBLM_TYPE = #{inspPblmType}</if>
  2689. order by w.ad_code asc,w.coll_time desc
  2690. </select>
  2691. <select id="findSdPblmPage" resultType="cn.com.goldenwater.dcproj.dto.PblmRetCount"
  2692. parameterType="cn.com.goldenwater.dcproj.param.CountParam">
  2693. select e.sd_name as rsName,dd.code,e.SD_TYPE as eng_scal from att_sd_base e,(
  2694. select distinct w.code from (
  2695. select j.id as oid,j.ptype,j.code,p.insp_pblm_cate from BIS_INSP_PBLM p
  2696. join (select * from BIS_INSP_ALL_OBJ o where 1=1
  2697. <include refid="choseSql"/>
  2698. ) j on p.obj_id=j.obj_id
  2699. join BIS_INSP_ALL_RLATION_PERS r on p.rec_pers=r.guid
  2700. ) w where w.ptype=#{pType} and
  2701. REGEXP_LIKE(
  2702. W.OID,'^('||
  2703. ( case when(SELECT count(id) from BIS_INSP_ALL_RLATION WHERE PERSID =#{persId}
  2704. <include refid="orgIdSql"/>
  2705. )>0 then
  2706. (SELECT LISTAGG(id, '|') WITHIN GROUP(ORDER BY PERSID) as
  2707. id FROM BIS_INSP_ALL_RLATION WHERE PERSID =#{persId}
  2708. <include refid="orgIdSql"/>
  2709. )
  2710. else (select 'non' from dual) end)
  2711. ||')') ) dd where e.sd_code=dd.code
  2712. </select>
  2713. <select id="findSwhsPblmPage" resultType="cn.com.goldenwater.dcproj.dto.PblmRetCount"
  2714. parameterType="cn.com.goldenwater.dcproj.param.CountParam">
  2715. select e.swhs_name as rsName,dd.code,e.WAIN_WASO_TYPE as eng_scal from att_swhs_base e,(
  2716. select distinct w.code from (
  2717. select j.id as oid,j.ptype,j.code,p.insp_pblm_cate from BIS_INSP_PBLM p
  2718. join (select * from BIS_INSP_ALL_OBJ o where o.ptype=#{pType}
  2719. <include refid="choseSql"/>
  2720. ) j on p.obj_id=j.obj_id
  2721. join BIS_INSP_ALL_RLATION_PERS r on p.rec_pers=r.guid
  2722. ) w where w.ptype=#{pType} and
  2723. REGEXP_LIKE(
  2724. W.OID,'^('||
  2725. ( case when(SELECT count(id) from BIS_INSP_ALL_RLATION WHERE PERSID =#{persId}
  2726. <include refid="orgIdSql"/>
  2727. )>0 then
  2728. (SELECT LISTAGG(id, '|') WITHIN GROUP(ORDER BY PERSID) as
  2729. id FROM BIS_INSP_ALL_RLATION WHERE PERSID =#{persId}
  2730. <include refid="orgIdSql"/>
  2731. )
  2732. else (select 'non' from dual) end)
  2733. ||')') ) dd where e.swhs_code=dd.code
  2734. </select>
  2735. <select id="findJswaPblmPage" resultType="cn.com.goldenwater.dcproj.dto.PblmRetCount"
  2736. parameterType="cn.com.goldenwater.dcproj.param.CountParam">
  2737. select e.name as rsName,dd.code,'' as eng_scal from ATT_JSKEJIAN_WATER_BASE e,(
  2738. select distinct w.code from (
  2739. select j.id as oid,j.ptype,j.code,p.insp_pblm_cate from BIS_INSP_PBLM p
  2740. join (select * from BIS_INSP_ALL_OBJ o where o.ptype=#{pType}
  2741. <include refid="choseSql"/>
  2742. ) j on p.obj_id=j.obj_id
  2743. join BIS_INSP_ALL_RLATION_PERS r on p.rec_pers=r.guid
  2744. ) w where w.ptype=#{pType} and
  2745. REGEXP_LIKE(
  2746. W.OID,'^('||
  2747. ( case when(SELECT count(id) from BIS_INSP_ALL_RLATION WHERE PERSID =#{persId}
  2748. <include refid="orgIdSql"/>
  2749. )>0 then
  2750. (SELECT LISTAGG(id, '|') WITHIN GROUP(ORDER BY PERSID) as
  2751. id FROM BIS_INSP_ALL_RLATION WHERE PERSID =#{persId}
  2752. <include refid="orgIdSql"/>
  2753. )
  2754. else (select 'non' from dual) end)
  2755. ||')') ) dd where e.id=dd.code
  2756. </select>
  2757. <select id="findJsflPblmPage" resultType="cn.com.goldenwater.dcproj.dto.PblmRetCount"
  2758. parameterType="cn.com.goldenwater.dcproj.param.CountParam">
  2759. select e.name as rsName,dd.code,'' as eng_scal from ATT_JSKEJIAN_FLKDIS_BASE e,(
  2760. select distinct w.code from (
  2761. select j.id as oid,j.ptype,j.code,p.insp_pblm_cate from BIS_INSP_PBLM p
  2762. join (select * from BIS_INSP_ALL_OBJ o where o.ptype=#{pType}
  2763. <include refid="choseSql"/>
  2764. ) j on p.obj_id=j.obj_id
  2765. join BIS_INSP_ALL_RLATION_PERS r on p.rec_pers=r.guid
  2766. ) w where w.ptype=#{pType} and
  2767. REGEXP_LIKE(
  2768. W.OID,'^('||
  2769. ( case when(SELECT count(id) from BIS_INSP_ALL_RLATION WHERE PERSID =#{persId}
  2770. <include refid="orgIdSql"/>
  2771. )>0 then
  2772. (SELECT LISTAGG(id, '|') WITHIN GROUP(ORDER BY PERSID) as
  2773. id FROM BIS_INSP_ALL_RLATION WHERE PERSID =#{persId}
  2774. <include refid="orgIdSql"/>
  2775. )
  2776. else (select 'non' from dual) end)
  2777. ||')') ) dd where e.id=dd.code
  2778. </select>
  2779. <select id="findPrdPblmPage" resultType="cn.com.goldenwater.dcproj.dto.PblmRetCount"
  2780. parameterType="cn.com.goldenwater.dcproj.param.CountParam">
  2781. select e.name as rsName,dd.code,'' as eng_scal from ATT_PRD_CSTR_PROJ_BASE e,(
  2782. select distinct w.code from (
  2783. select j.id as oid,j.ptype,j.code,p.insp_pblm_cate from BIS_INSP_PBLM p
  2784. join (select * from BIS_INSP_ALL_OBJ o where o.ptype=#{pType}
  2785. <include refid="choseSql"/>
  2786. ) j on p.obj_id=j.obj_id
  2787. join BIS_INSP_ALL_RLATION_PERS r on p.rec_pers=r.guid
  2788. ) w where w.ptype=#{pType} and
  2789. REGEXP_LIKE(
  2790. W.OID,'^('||
  2791. ( case when(SELECT count(id) from BIS_INSP_ALL_RLATION WHERE PERSID =#{persId}
  2792. <include refid="orgIdSql"/>
  2793. )>0 then
  2794. (SELECT LISTAGG(id, '|') WITHIN GROUP(ORDER BY PERSID) as
  2795. id FROM BIS_INSP_ALL_RLATION WHERE PERSID =#{persId}
  2796. <include refid="orgIdSql"/>
  2797. )
  2798. else (select 'non' from dual) end)
  2799. ||')') ) dd where e.id=dd.code
  2800. </select>
  2801. <select id="findWiuPblmPage" resultType="cn.com.goldenwater.dcproj.dto.PblmRetCount"
  2802. parameterType="cn.com.goldenwater.dcproj.param.CountParam">
  2803. select e.wiu_name as rsName,dd.code,'' as eng_scal from att_wiu_base e,(
  2804. select distinct w.code from (
  2805. select j.id as oid,j.ptype,j.code,p.insp_pblm_cate from BIS_INSP_PBLM p
  2806. join (select * from BIS_INSP_ALL_OBJ o where o.ptype=#{pType}
  2807. <include refid="choseSql"/>
  2808. ) j on p.obj_id=j.obj_id
  2809. join BIS_INSP_ALL_RLATION_PERS r on p.rec_pers=r.guid
  2810. ) w where w.ptype=#{pType} and
  2811. REGEXP_LIKE(
  2812. W.OID,'^('||
  2813. ( case when(SELECT count(id) from BIS_INSP_ALL_RLATION WHERE PERSID =#{persId}
  2814. <include refid="orgIdSql"/>
  2815. )>0 then
  2816. (SELECT LISTAGG(id, '|') WITHIN GROUP(ORDER BY PERSID) as
  2817. id FROM BIS_INSP_ALL_RLATION WHERE PERSID =#{persId}
  2818. <include refid="orgIdSql"/>
  2819. )
  2820. else (select 'non' from dual) end)
  2821. ||')') ) dd where e.id=dd.code
  2822. </select>
  2823. <select id="countSd" resultType="cn.com.goldenwater.dcproj.dto.PblmCount" parameterType="java.lang.String">
  2824. select dd.*,b.SD_NAME as rs_name from ATT_SD_BASE b , (
  2825. select a.code,count(a.code) as sub,insp_pblm_cate,count(insp_pblm_cate) as total from (
  2826. select w.* from (
  2827. select j.id as oid,j.ptype,j.code,p.insp_pblm_cate from BIS_INSP_PBLM p
  2828. join (select * from BIS_INSP_ALL_OBJ o where o.ptype=#{pType}
  2829. <include refid="choseSql"/>
  2830. ) j on p.obj_id=j.obj_id
  2831. join BIS_INSP_ALL_RLATION_PERS r on p.rec_pers=r.guid
  2832. ) w where w.ptype=#{pType} and w.code in(${codes})
  2833. <if test="persId !=null and persId !=''">
  2834. and
  2835. REGEXP_LIKE(
  2836. W.OID,'^('||
  2837. ( case when(SELECT count(id) from BIS_INSP_ALL_RLATION WHERE PERSID =#{persId}
  2838. <include refid="orgIdSql"/>
  2839. )>0 then
  2840. (SELECT LISTAGG(id, '|') WITHIN GROUP(ORDER BY PERSID) as
  2841. id FROM BIS_INSP_ALL_RLATION WHERE PERSID =#{persId}
  2842. <include refid="orgIdSql"/>
  2843. )
  2844. else (select 'non' from dual) end)
  2845. ||')')
  2846. </if>
  2847. ) a where a.insp_pblm_cate is not null group by a.code,a.insp_pblm_cate order by a.code ) dd where
  2848. b.SD_CODE=dd.code
  2849. </select>
  2850. <select id="findPblmList" resultType="cn.com.goldenwater.dcproj.model.BisInspPblm"
  2851. parameterType="cn.com.goldenwater.dcproj.param.PblmParam">
  2852. SELECT DISTINCT W.* FROM (
  2853. SELECT
  2854. J.ID AS OID, J.ID AS ORG_ID,J.CODE, J.NM, J.NM AS RS_NAME, J.PTYPE,
  2855. R.PERS_NAME,
  2856. P.*, NVL(P.INSP_PBLM_NAME,P.PBLM_NAME_BZ) AS INSP_PBLMS_NAME,P.CHECK_POINT_BZ AS CHECK_POINT,
  2857. P.PBLM_DESC_BZ AS PBLM_DESC,
  2858. S.ATTACH,S.SHEET,S.SN_NUM,
  2859. B.AD_FULL_NAME AS LOC,B.AD_FULL_NAME,B.AD_CODE,
  2860. <if test='pType == "78"'>BAU.SEC_ID, BAU.ID AS UNIT_ID, BAU.NM AS UNIT_NM ,</if>
  2861. L.PNM AS ORG_NM
  2862. from (
  2863. select * from BIS_INSP_PBLM pb
  2864. <where>
  2865. <if test="ifCasePblm != null and ifCasePblm != ''">and pb.IF_CASE_PBLM = #{ifCasePblm}</if>
  2866. <if test="hasVedio != null and hasVedio != ''">and pb.HAS_VEDIO = #{hasVedio}</if>
  2867. <if test="startTime != null and startTime != ''">AND pb.COLL_TIME &gt;= TO_DATE(#{startTime},'YYYY-MM-DD')</if>
  2868. <if test="quote !=null and quote !=''">and pb.quote=#{quote}</if>
  2869. <if test="findTime != null and findTime != ''">and pb.COLL_TIME=TO_DATE(#{findTime},'YYYY-MM-DD')</if>
  2870. <if test="reviConc != null and reviConc != ''">and pb.revi_conc = #{reviConc}</if>
  2871. <if test="inspPblmCate != null and inspPblmCate != ''">and pb.INSP_PBLM_CATE = #{inspPblmCate}</if>
  2872. <if test="endTime != null and endTime != ''">AND pb.COLL_TIME &lt; TO_DATE(#{endTime},'YYYY-MM-DD')+1</if>
  2873. <if test="inspPblmName != null and inspPblmName != ''">and pb.INSP_PBLM_NAME like '%${inspPblmName}%'</if>
  2874. <if test="objId != null and objId != ''">and pb.OBJ_ID = #{objId}</if>
  2875. <if test="regid != null and regid != ''">and pb.regid = #{regid}</if>
  2876. <if test="cwsCode != null and cwsCode != ''">and pb.CWS_CODE = #{cwsCode}</if>
  2877. </where>
  2878. ) p
  2879. JOIN (SELECT * FROM BIS_INSP_ALL_OBJ O WHERE O.PTYPE=#{pType}<include refid="choseSql"/>) J ON P.OBJ_ID =
  2880. J.OBJ_ID
  2881. LEFT JOIN BIS_INSP_ALL_RLATION_PERS R ON P.REC_PERS = R.GUID
  2882. <choose>
  2883. <when test='pType == "3"'>
  2884. left join BIS_INSP_WTDST_TRACK ba on ba.obj_id=j.obj_id
  2885. </when>
  2886. <when test='pType == "4"'>
  2887. left join BIS_INSP_KEY_REGISTER ba on ba.obj_id=j.obj_id
  2888. </when>
  2889. <when test='pType == "7"'>
  2890. left join BIS_INSP_KEY_REGISTER ba on ba.obj_id=j.obj_id
  2891. </when>
  2892. <when test='pType == "11"'>
  2893. left join BIS_INSP_SD_RGSTR ba on ba.obj_id=j.obj_id
  2894. </when>
  2895. <when test='pType == "12"'>
  2896. left join bis_insp_wiu_rgstr ba on ba.obj_id=j.obj_id
  2897. </when>
  2898. <when test='pType == "13"'>
  2899. left join bis_insp_swhs_rgstr ba on ba.obj_id=j.obj_id
  2900. </when>
  2901. <when test='pType == "14"'>
  2902. LEFT JOIN BIS_INSP_WINT_RGSTR ba on ba.obj_id = j.obj_id
  2903. </when>
  2904. <when test='pType == "15"'>
  2905. LEFT JOIN BIS_INSP_SVWT_AREA_RGSTR ba on ba.obj_id = j.obj_id
  2906. </when>
  2907. <when test='pType == "16"'>
  2908. LEFT JOIN BIS_INSP_SVWT_WUNT_RGSTR ba on ba.obj_id = j.obj_id
  2909. </when>
  2910. <when test='pType == "17"'>
  2911. LEFT JOIN BIS_INSP_OPRD_CSTR_PROJ_RGSTR ba on ba.obj_id = j.obj_id
  2912. </when>
  2913. <when test='pType == "18"'>
  2914. LEFT JOIN ATT_JSKEJIAN_FLKDIS_RGSTR ba on ba.obj_id = j.obj_id
  2915. </when>
  2916. <when test='pType == "19"'>
  2917. LEFT JOIN ATT_JSKEJIAN_WATER_RGSTR ba on ba.obj_id = j.obj_id
  2918. </when>
  2919. <when test='pType == "20"'>
  2920. LEFT JOIN ATT_JSKEJIAN_ECOFRD_RGSTR ba on ba.obj_id = j.obj_id
  2921. </when>
  2922. <when test='pType == "22"'>
  2923. LEFT JOIN BIS_INSP_RSML_RGSTR ba on ba.obj_id = j.obj_id
  2924. </when>
  2925. <when test='pType == "24"'>
  2926. LEFT JOIN bis_insp_stnd_rgstr ba on ba.obj_id = j.obj_id
  2927. </when>
  2928. <when test='pType == "41"'>
  2929. LEFT JOIN bis_zhejiang_vill_rgstr ba on ba.obj_id = j.obj_id
  2930. </when>
  2931. <when test='pType == "42"'>
  2932. LEFT JOIN BIS_ZHEJIANG_JG_RGSTR ba on ba.obj_id = j.obj_id
  2933. </when>
  2934. <when test='pType == "26"'>
  2935. LEFT JOIN BIS_INSP_RSFCO_RGSTR ba on ba.obj_id = j.obj_id
  2936. </when>
  2937. <when test='pType == "25"'>
  2938. LEFT JOIN BIS_NEW_VILL_RGSTR ba on ba.obj_id = j.obj_id
  2939. </when>
  2940. <when test='pType == "27"'>
  2941. LEFT JOIN BIS_INSP_MFDP_RGSTR ba on ba.obj_id = j.obj_id
  2942. </when>
  2943. <when test='pType == "28"'>
  2944. LEFT JOIN BIS_INSP_IRR_RGSTR ba on ba.obj_id = j.obj_id
  2945. </when>
  2946. <when test='pType == "29"'>
  2947. LEFT JOIN BIS_INSP_WAGA_SAP_RGSTR ba on ba.obj_id = j.obj_id
  2948. </when>
  2949. <when test='pType == "30"'>
  2950. LEFT JOIN (select t.*,'' as ad_code from BIS_INSP_EFP_RGSTR t) ba on ba.obj_id = j.obj_id
  2951. </when>
  2952. <when test='pType == "31"'>
  2953. LEFT JOIN BIS_INSP_WINTU_RGSTR ba on ba.obj_id = j.obj_id
  2954. </when>
  2955. <when test='pType == "32"'>
  2956. LEFT JOIN BIS_INSP_WRM_RGSTR ba on ba.obj_id = j.obj_id
  2957. </when>
  2958. <when test='pType == "33"'>
  2959. LEFT JOIN BIS_INSP_WTUNT_RGSTR ba on ba.obj_id = j.obj_id
  2960. </when>
  2961. <when test='pType == "34"'>
  2962. LEFT JOIN BIS_INSP_rssfdr_RGSTR ba on ba.obj_id = j.obj_id
  2963. </when>
  2964. <when test='pType == "35"'>
  2965. LEFT JOIN BIS_INSP_samrmp_RGSTR ba on ba.obj_id = j.obj_id
  2966. </when>
  2967. <when test='pType == "37"'>
  2968. LEFT JOIN BIS_RDWSP_RGSTR ba on ba.obj_id = j.obj_id
  2969. </when>
  2970. <when test='pType == "53"'>
  2971. LEFT JOIN BIS_INSP_WRWS_RGSTR BA ON BA.OBJ_ID = J.OBJ_ID
  2972. </when>
  2973. <when test='pType == "54"'>
  2974. LEFT JOIN BIS_INSP_WTCRR_RGSTR BA ON BA.OBJ_ID = J.OBJ_ID
  2975. </when>
  2976. <when test='pType == "55"'>
  2977. LEFT JOIN BIS_INSP_WTGT_RGSTR BA ON BA.OBJ_ID = J.OBJ_ID
  2978. </when>
  2979. <when test='pType == "56"'>
  2980. LEFT JOIN BIS_INSP_WRWX_RGSTR BA ON BA.OBJ_ID = J.OBJ_ID
  2981. </when>
  2982. <when test='pType == "57"'>
  2983. LEFT JOIN BIS_INSP_WTGTH_RGSTR BA ON BA.OBJ_ID = J.OBJ_ID
  2984. </when>
  2985. <when test='pType == "62"'>
  2986. LEFT JOIN BIS_INSP_CDEP_RGSTR BA ON BA.OBJ_ID = J.OBJ_ID
  2987. </when>
  2988. <when test='pType == "67"'>
  2989. LEFT JOIN BIS_INSP_BID_RGSTR BA ON BA.OBJ_ID = J.OBJ_ID
  2990. </when>
  2991. <when test='pType == "68"'>
  2992. LEFT JOIN BIS_INSP_RLRW_RGSTR BA ON BA.OBJ_ID = J.OBJ_ID
  2993. </when>
  2994. <when test='pType == "69"'>
  2995. LEFT JOIN BIS_INSP_DRDMP_RGSTR BA ON BA.OBJ_ID = J.OBJ_ID
  2996. </when>
  2997. <when test='pType == "70"'>
  2998. LEFT JOIN BIS_INSP_GROW_RGSTR BA ON BA.OBJ_ID = J.OBJ_ID
  2999. </when>
  3000. <when test='pType == "71"'>
  3001. LEFT JOIN BIS_INSP_VILLQH_RGSTR BA ON BA.OBJ_ID = J.OBJ_ID
  3002. </when>
  3003. <when test='pType == "72"'>LEFT JOIN BIS_INSP_WIUQH_RGSTR BA ON BA.OBJ_ID = J.OBJ_ID</when>
  3004. <when test='pType == "73"'>LEFT JOIN BIS_INSP_HYST_RGSTR BA ON BA.OBJ_ID = J.OBJ_ID</when>
  3005. <when test='pType == "74"'>LEFT JOIN BIS_INSP_SAFETY_RGSTR BA ON BA.OBJ_ID = J.OBJ_ID</when>
  3006. <when test='pType == "75"'>LEFT JOIN BIS_INSP_YNDRDMP_RGSTR BA ON BA.OBJ_ID = J.OBJ_ID</when>
  3007. <when test='pType == "76"'>LEFT JOIN BIS_INSP_DPGM_RGSTR BA ON BA.OBJ_ID = J.OBJ_ID</when>
  3008. <when test='pType == "77"'>LEFT JOIN BIS_INSP_RVGM_RGSTR BA ON BA.OBJ_ID = J.OBJ_ID</when>
  3009. <when test='pType == "78"'>
  3010. LEFT JOIN BIS_INSP_WTPRJ_REGISTER BA ON BA.OBJ_ID = J.OBJ_ID
  3011. LEFT JOIN BIS_INSP_WTPRJ_UNIT BAU ON P.regid = BAU.ID
  3012. </when>
  3013. <when test='pType == "79"'>LEFT JOIN BIS_INSP_VILLGD BA ON BA.OBJ_ID = J.OBJ_ID</when>
  3014. <when test='pType == "80"'>LEFT JOIN BIS_INSP_RSLKBK_RGSTR BA ON BA.OBJ_ID = J.OBJ_ID</when>
  3015. <when test='pType == "81"'>LEFT JOIN BIS_INSP_WAGAJS_BDG BA ON BA.OBJ_ID = J.OBJ_ID</when>
  3016. <when test='pType == "82"'>LEFT JOIN BIS_INSP_WTGOV_RGSTR BA ON BA.OBJ_ID = J.OBJ_ID</when>
  3017. <when test='pType == "83"'>LEFT JOIN BIS_INSP_CHMCLS_RGSTR BA ON BA.OBJ_ID = J.OBJ_ID</when>
  3018. <when test='pType == "84"'>LEFT JOIN BIS_INSP_RSSFGD_RGSTR BA ON BA.OBJ_ID = J.OBJ_ID</when>
  3019. <when test='pType == "89"'>LEFT JOIN BIS_INSP_UNWT_RGSTR BA ON BA.OBJ_ID = J.OBJ_ID</when>
  3020. <when test='pType == "91"'>LEFT JOIN BIS_INSP_PRDQH_RGSTR BA ON BA.OBJ_ID = J.OBJ_ID</when>
  3021. <when test='pType == "93"'>LEFT JOIN BIS_INSP_FLOODQH BA ON BA.OBJ_ID = J.OBJ_ID</when>
  3022. <when test='pType == "94"'>LEFT JOIN BIS_INSP_MFDPQH_RGSTR BA ON BA.OBJ_ID = J.OBJ_ID</when>
  3023. <when test='pType == "95"'>LEFT JOIN BIS_INSP_DSTFLDQH BA ON BA.OBJ_ID = J.OBJ_ID</when>
  3024. <when test='pType == "96"'>LEFT JOIN BIS_INSP_RSFCOQH_RGSTR BA ON BA.OBJ_ID = J.OBJ_ID</when>
  3025. <when test='pType == "97"'>LEFT JOIN BIS_INSP_VILL2021_RGSTR BA ON BA.OBJ_ID = J.OBJ_ID</when>
  3026. <when test='pType == "98"'>LEFT JOIN BIS_INSP_FUND_RGSTR BA ON BA.OBJ_ID = J.OBJ_ID</when>
  3027. <when test='pType == "99"'>LEFT JOIN BIS_INSP_KEYSAFQH_REGISTER BA ON BA.OBJ_ID = J.OBJ_ID</when>
  3028. <when test='pType == "100"'>LEFT JOIN BIS_INSP_KEYCHKQH_REGISTER BA ON BA.OBJ_ID = J.OBJ_ID</when>
  3029. <when test='pType == "101"'>LEFT JOIN BIS_INSP_SVWTQH BA ON BA.OBJ_ID = J.OBJ_ID</when>
  3030. <when test='pType == "104"'>LEFT JOIN BIS_INSP_STSTN BA ON BA.OBJ_ID = J.OBJ_ID</when>
  3031. <when test='pType == "105"'>LEFT JOIN BIS_INSP_QYMTEN BA ON BA.OBJ_ID = J.OBJ_ID</when>
  3032. <when test='pType == "106"'>LEFT JOIN BIS_INSP_RSVRYN_RGSTR BA ON BA.OBJ_ID = J.OBJ_ID</when>
  3033. <when test='pType == "108"'>LEFT JOIN BIS_INSP_XJVILL BA ON BA.OBJ_ID = J.OBJ_ID</when>
  3034. <when test='pType == "110"'>LEFT JOIN BIS_INSP_FJWTENF BA ON BA.OBJ_ID = J.OBJ_ID</when>
  3035. <when test='pType == "112"'>LEFT JOIN BIS_INSP_WIUJS_RGSTR BA ON BA.OBJ_ID = J.OBJ_ID</when>
  3036. <when test='pType == "113"'>LEFT JOIN BIS_INSP_SWHSJS BA ON BA.OBJ_ID = J.OBJ_ID</when>
  3037. <when test='pType == "115"'>LEFT JOIN BIS_INSP_RSVR_SD BA ON BA.OBJ_ID = J.OBJ_ID</when>
  3038. <when test='pType == "116"'>LEFT JOIN BIS_INSP_HYSTP BA ON BA.OBJ_ID = J.OBJ_ID</when>
  3039. <when test='pType == "117"'>LEFT JOIN BIS_INSP_RDWPGD_RGSTR BA ON BA.OBJ_ID = J.OBJ_ID</when>
  3040. <when test='pType == "119"'>LEFT JOIN BIS_INSP_FJQA BA ON BA.OBJ_ID = J.OBJ_ID</when>
  3041. <when test='pType == "120"'>LEFT JOIN BIS_INSP_JSPWIU BA ON BA.OBJ_ID = J.OBJ_ID</when>
  3042. <when test='pType == "126"'>LEFT JOIN BIS_INSP_JSPWIU2024 BA ON BA.OBJ_ID = J.OBJ_ID</when>
  3043. <otherwise>LEFT JOIN BIS_INSP_GNRL_RGSTR BA ON BA.OBJ_ID = J.OBJ_ID</otherwise>
  3044. </choose>
  3045. LEFT JOIN ATT_AD_X_BASE B ON BA.AD_CODE = B.AD_CODE
  3046. LEFT JOIN OBJ_INSP_PBLMS S ON P.PBLMS_TYPE_ID = S.GUID
  3047. LEFT JOIN BIS_INSP_ALL L ON L.ID = J.ID
  3048. where 1=1
  3049. <if test="tabType =='2'.toString()">
  3050. AND L.ENTM &lt; TO_DATE(#{nowTime},'yyyy-MM-dd')+1
  3051. </if>
  3052. <if test="tabType =='1'.toString()">
  3053. AND L.ENTM &gt;= TO_DATE(#{nowTime},'yyyy-MM-dd')
  3054. </if>
  3055. ) w
  3056. WHERE REGEXP_LIKE(
  3057. W.OID,'^('||
  3058. ( case when(SELECT count(id) from BIS_INSP_ALL_RLATION WHERE PERSID = #{persId}
  3059. <include refid="orgIdSql"/>
  3060. <choose>
  3061. <when test="pType.length() == 1">
  3062. and id like concat('00','${pType}%')
  3063. </when>
  3064. <when test="pType.length() == 2">
  3065. and id like concat('0','${pType}%')
  3066. </when>
  3067. <otherwise>
  3068. and id like '${pType}%'
  3069. </otherwise>
  3070. </choose>
  3071. )>0 then
  3072. (SELECT LISTAGG(id, '|') WITHIN GROUP(ORDER BY PERSID) as id FROM BIS_INSP_ALL_RLATION WHERE PERSID =#{persId}
  3073. <include refid="orgIdSql"/>
  3074. <choose>
  3075. <when test="pType.length() == 1">
  3076. and id like concat('00','${pType}%')
  3077. </when>
  3078. <when test="pType.length() == 2">
  3079. and id like concat('0','${pType}%')
  3080. </when>
  3081. <otherwise>
  3082. and id like '${pType}%'
  3083. </otherwise>
  3084. </choose>
  3085. )
  3086. else (select 'non' from dual) end) ||')')
  3087. <if test="nm != null and nm != ''">and w.nm like '%${nm}%'</if>
  3088. <if test="newVillName != null and newVillName != ''">and w.NEW_VILL_NAME like '%${newVillName}%'</if>
  3089. <if test="orgNm != null and orgNm != ''">and w.org_nm like '%${orgNm}%'</if>
  3090. <if test="adFullName != null and adFullName != ''">and w.ad_full_name like '%${adFullName}%'</if>
  3091. <if test="persName != null and persName != ''">and w.PERS_NAME like '%${persName}%'</if>
  3092. <if test="codes != null and codes != ''">and w.CODE in (${codes})</if>
  3093. <if test="recPers !=null and recPers !=''">and w.rec_pers=#{recPers}</if>
  3094. <if test="adCodes != null and adCodes != ''">and w.AD_CODE in (${adCodes})</if>
  3095. <!-- 福建省 综合展示 lxf -->
  3096. <if test="adCode != null and adCode != ''">and w.AD_CODE like '${adCode}%'</if>
  3097. <if test="orgIds != null and orgIds != ''">and w.org_id in (${orgIds})</if>
  3098. <if test="inspPblmType != null and inspPblmType != ''">and w.INSP_PBLM_TYPE = #{inspPblmType}</if>
  3099. <if test="bplmsTypeId != null and bplmsTypeId != ''">and w.PBLMS_TYPE_ID = #{bplmsTypeId}</if>
  3100. <if test="secId != null and secId != ''">and w.SEC_ID = #{secId}</if>
  3101. <if test="inspPblmsName != null and inspPblmsName != ''">and w.INSP_PBLMS_NAME Like '%${inspPblmsName}%'</if>
  3102. <if test="checkPoint != null and checkPoint != ''">and w.CHECK_POINT_BZ Like '%${checkPoint}%'</if>
  3103. <if test="state != null and state != ''">and w.STATE = #{state}</if>
  3104. order by w.ad_code asc, w.code asc, w.coll_time desc
  3105. </select>
  3106. <select id="countSwhs" resultType="cn.com.goldenwater.dcproj.dto.PblmCount" parameterType="java.lang.String">
  3107. select dd.*,b.SWHS_NAME as rs_name from ATT_SWHS_BASE b , (
  3108. select a.code,count(a.code) as sub,insp_pblm_cate,count(insp_pblm_cate) as total from (
  3109. select w.* from (
  3110. select j.id as oid,j.ptype,j.code,p.insp_pblm_cate from BIS_INSP_PBLM p
  3111. join (select * from BIS_INSP_ALL_OBJ o where o.ptype=#{pType}
  3112. <include refid="choseSql"/>
  3113. ) j on p.obj_id=j.obj_id
  3114. join BIS_INSP_ALL_RLATION_PERS r on p.rec_pers=r.guid
  3115. ) w where w.ptype=#{pType} and w.code in(${codes})
  3116. <if test="persId !=null and persId !=''">
  3117. and
  3118. REGEXP_LIKE(
  3119. W.OID,'^('||
  3120. ( case when(SELECT count(id) from BIS_INSP_ALL_RLATION WHERE PERSID =#{persId}
  3121. <include refid="orgIdSql"/>
  3122. )>0 then
  3123. (SELECT LISTAGG(id, '|') WITHIN GROUP(ORDER BY PERSID) as
  3124. id FROM BIS_INSP_ALL_RLATION WHERE PERSID =#{persId}
  3125. <include refid="orgIdSql"/>
  3126. )
  3127. else (select 'non' from dual) end)
  3128. ||')')
  3129. </if>
  3130. ) a where a.insp_pblm_cate is not null group by a.code,a.insp_pblm_cate order by a.code ) dd where b.ID=dd.code
  3131. </select>
  3132. <select id="countJsfl" resultType="cn.com.goldenwater.dcproj.dto.PblmCount" parameterType="java.lang.String">
  3133. select dd.*,b.name as rs_name from ATT_JSKEJIAN_FLKDIS_BASE b , (
  3134. select a.code,count(a.code) as sub,insp_pblm_cate,count(insp_pblm_cate) as total from (
  3135. select w.* from (
  3136. select j.id as oid,j.ptype,j.code,p.insp_pblm_cate from BIS_INSP_PBLM p
  3137. join (select * from BIS_INSP_ALL_OBJ o where o.ptype=#{pType}
  3138. <include refid="choseSql"/>
  3139. ) j on p.obj_id=j.obj_id
  3140. join BIS_INSP_ALL_RLATION_PERS r on p.rec_pers=r.guid
  3141. ) w where w.ptype=#{pType} and w.code in(${codes})
  3142. <if test="persId !=null and persId !=''">
  3143. and
  3144. REGEXP_LIKE(
  3145. W.OID,'^('||
  3146. ( case when(SELECT count(id) from BIS_INSP_ALL_RLATION WHERE PERSID =#{persId}
  3147. <include refid="orgIdSql"/>
  3148. )>0 then
  3149. (SELECT LISTAGG(id, '|') WITHIN GROUP(ORDER BY PERSID) as
  3150. id FROM BIS_INSP_ALL_RLATION WHERE PERSID =#{persId}
  3151. <include refid="orgIdSql"/>
  3152. )
  3153. else (select 'non' from dual) end)
  3154. ||')')
  3155. </if>
  3156. ) a where a.insp_pblm_cate is not null group by a.code,a.insp_pblm_cate order by a.code ) dd where b.ID=dd.code
  3157. </select>
  3158. <select id="countJswa" resultType="cn.com.goldenwater.dcproj.dto.PblmCount" parameterType="java.lang.String">
  3159. select dd.*,b.name as rs_name from ATT_JSKEJIAN_WATER_BASE b , (
  3160. select a.code,count(a.code) as sub,insp_pblm_cate,count(insp_pblm_cate) as total from (
  3161. select w.* from (
  3162. select j.id as oid,j.ptype,j.code,p.insp_pblm_cate from BIS_INSP_PBLM p
  3163. join (select * from BIS_INSP_ALL_OBJ o where o.ptype=#{pType}
  3164. <include refid="choseSql"/>
  3165. ) j on p.obj_id=j.obj_id
  3166. join BIS_INSP_ALL_RLATION_PERS r on p.rec_pers=r.guid
  3167. ) w where w.ptype=#{pType} and w.code in(${codes})
  3168. <if test="persId !=null and persId !=''">
  3169. and
  3170. REGEXP_LIKE(
  3171. W.OID,'^('||
  3172. ( case when(SELECT count(id) from BIS_INSP_ALL_RLATION WHERE PERSID =#{persId}
  3173. <include refid="orgIdSql"/>
  3174. )>0 then
  3175. (SELECT LISTAGG(id, '|') WITHIN GROUP(ORDER BY PERSID) as
  3176. id FROM BIS_INSP_ALL_RLATION WHERE PERSID =#{persId}
  3177. <include refid="orgIdSql"/>
  3178. )
  3179. else (select 'non' from dual) end)
  3180. ||')')
  3181. </if>
  3182. ) a where a.insp_pblm_cate is not null group by a.code,a.insp_pblm_cate order by a.code ) dd where b.ID=dd.code
  3183. </select>
  3184. <select id="countPrd" resultType="cn.com.goldenwater.dcproj.dto.PblmCount" parameterType="java.lang.String">
  3185. select dd.*,b.name as rs_name from ATT_PRD_CSTR_PROJ_BASE b , (
  3186. select a.code,count(a.code) as sub,insp_pblm_cate,count(insp_pblm_cate) as total from (
  3187. select w.* from (
  3188. select j.id as oid,j.ptype,j.code,p.insp_pblm_cate from BIS_INSP_PBLM p
  3189. join (select * from BIS_INSP_ALL_OBJ o where o.ptype=#{pType}
  3190. <include refid="choseSql"/>
  3191. ) j on p.obj_id=j.obj_id
  3192. join BIS_INSP_ALL_RLATION_PERS r on p.rec_pers=r.guid
  3193. ) w where w.ptype=#{pType} and w.code in(${codes})
  3194. <if test="persId !=null and persId !=''">
  3195. and
  3196. REGEXP_LIKE(
  3197. W.OID,'^('||
  3198. ( case when(SELECT count(id) from BIS_INSP_ALL_RLATION WHERE PERSID =#{persId}
  3199. <include refid="orgIdSql"/>
  3200. )>0 then
  3201. (SELECT LISTAGG(id, '|') WITHIN GROUP(ORDER BY PERSID) as
  3202. id FROM BIS_INSP_ALL_RLATION WHERE PERSID =#{persId}
  3203. <include refid="orgIdSql"/>
  3204. )
  3205. else (select 'non' from dual) end)
  3206. ||')')
  3207. </if>
  3208. ) a where a.insp_pblm_cate is not null group by a.code,a.insp_pblm_cate order by a.code ) dd where b.ID=dd.code
  3209. </select>
  3210. <select id="countWiu" resultType="cn.com.goldenwater.dcproj.dto.PblmCount" parameterType="java.lang.String">
  3211. select dd.*,b.WIU_NAME as rs_name from ATT_WIU_BASE b , (
  3212. select a.code,count(a.code) as sub,insp_pblm_cate,count(insp_pblm_cate) as total from (
  3213. select w.* from (
  3214. select j.id as oid,j.ptype,j.code,p.insp_pblm_cate from BIS_INSP_PBLM p
  3215. join (select * from BIS_INSP_ALL_OBJ o where o.ptype=#{pType}
  3216. <include refid="choseSql"/>
  3217. ) j on p.obj_id=j.obj_id
  3218. join BIS_INSP_ALL_RLATION_PERS r on p.rec_pers=r.guid
  3219. ) w where w.ptype=#{pType} and w.code in(${codes})
  3220. <if test="persId !=null and persId !=''">
  3221. and
  3222. REGEXP_LIKE(
  3223. W.OID,'^('||
  3224. ( case when(SELECT count(id) from BIS_INSP_ALL_RLATION WHERE PERSID =#{persId}
  3225. <include refid="orgIdSql"/>
  3226. )>0 then
  3227. (SELECT LISTAGG(id, '|') WITHIN GROUP(ORDER BY PERSID) as
  3228. id FROM BIS_INSP_ALL_RLATION WHERE PERSID =#{persId}
  3229. <include refid="orgIdSql"/>
  3230. )
  3231. else (select 'non' from dual) end)
  3232. ||')')
  3233. </if>
  3234. ) a where a.insp_pblm_cate is not null group by a.code,a.insp_pblm_cate order by a.code ) dd where b.ID=dd.code
  3235. </select>
  3236. <select id="getObjPblmList" parameterType="cn.com.goldenwater.dcproj.param.BisInspPblmParam"
  3237. resultType="cn.com.goldenwater.dcproj.model.BisInspPblm">
  3238. select
  3239. p.*,s.check_point,s.pblm_desc
  3240. from bis_insp_pblm p
  3241. left join OBJ_INSP_PBLMS s on p.pblms_type_id=s.guid
  3242. where obj_type = #{objType}
  3243. <!-- and PBLMS_TYPE_ID in (${pblmsTypeId}) -->
  3244. <if test="objId != null and objId != ''">
  3245. and obj_id = #{objId}
  3246. </if>
  3247. <choose>
  3248. <when test="orgId !=null and orgId !=''">
  3249. AND ORG_ID=#{orgId}
  3250. </when>
  3251. <otherwise>
  3252. AND ORG_ID is null
  3253. </otherwise>
  3254. </choose>
  3255. </select>
  3256. <select id="getPblmList" resultMap="bisInspPblmResultMap"
  3257. parameterType="cn.com.goldenwater.dcproj.model.BisInspPblm">
  3258. select t.*,x.ad_full_name,r.rsvr_nm as rsName,r.RGSTR_ID,p.check_point,p.pblm_desc from BIS_INSP_PBLM t left
  3259. join obj_insp_pblms p on t.pblms_type_id = p.guid
  3260. <if test='objType == "1"'>
  3261. left join Bis_Insp_Rsvr_Rgstr
  3262. </if>
  3263. r on t.regid = r.rgstr_id
  3264. left join att_ad_x_base x on r.ad_code = x.ad_code
  3265. where p.guid is not null and t.obj_type = #{objType}
  3266. and t.regid in (${rgstrId})
  3267. </select>
  3268. <select id="getPblmListByRegId" parameterType="cn.com.goldenwater.dcproj.param.BisInspPblmParam"
  3269. resultType="cn.com.goldenwater.dcproj.model.BisInspPblm">
  3270. select t.*,x.ad_full_name,r.rsvr_nm as rsName,r.RGSTR_ID,p.check_point,p.pblm_desc from BIS_INSP_PBLM t left
  3271. join obj_insp_pblms p on t.pblms_type_id = p.guid
  3272. <if test='objType == "1"'>
  3273. left join Bis_Insp_Rsvr_Rgstr
  3274. </if>
  3275. r on t.regid = r.rgstr_id
  3276. left join att_ad_x_base x on r.ad_code = x.ad_code
  3277. where t.obj_type = #{objType}
  3278. ${regid}
  3279. </select>
  3280. <update id="updatePblmStateByObjId" parameterType="cn.com.goldenwater.dcproj.param.BisInspPblmParam">
  3281. UPDATE BIS_INSP_PBLM t
  3282. set t.state = #{state}
  3283. where t.obj_id = #{objId}
  3284. <if test="objType != null and objType != ''">
  3285. and t.obj_type = #{objType}
  3286. </if>
  3287. </update>
  3288. <update id="updatePblmState" parameterType="cn.com.goldenwater.dcproj.param.BisInspPblmParam">
  3289. UPDATE BIS_INSP_PBLM t set t.state = #{state} where t.obj_id = #{objId} and t.obj_type = #{objType}
  3290. </update>
  3291. <select id="getPblmListByTm" resultType="cn.com.goldenwater.dcproj.dto.BisInspTaskTotal">
  3292. select count(a.pblm_id)pblmSize from bis_insp_pblm A JOIN BIS_INSP_ALL_OBJ B ON A.OBJ_ID=B.OBJ_ID where
  3293. a.obj_type=#{objType} and a.coll_time&gt;=#{stTm} and a.coll_time&lt;#{enTm} and substr(b.code,1,6)=#{adCode}
  3294. </select>
  3295. <select id="getPblmPath" resultType="String">
  3296. select FILE_PATH
  3297. from GW_COM_FILE WHERE BIZ_ID = #{pblmId}
  3298. </select>
  3299. <!-- 批量导入口径查询 -->
  3300. <select id="getPblmListFromImport" parameterType="cn.com.goldenwater.dcproj.param.PblmParam" resultMap="bisInspPblmResultMap">
  3301. SELECT
  3302. t2.ad_full_name,
  3303. t1.PBLM_ID,
  3304. t1.obj_code,
  3305. t1.obj_name,
  3306. t1.check_point_bz,
  3307. t1.INSP_PBLM_TYPE,
  3308. t1.insp_pblm_name,
  3309. t1.INSP_PBLM_DESC,
  3310. t1.PBLM_DESC_BZ,
  3311. t1.INSP_PBLM_CATE,
  3312. t1.IF_CASE_PBLM,
  3313. t3.pers_name,
  3314. t1.coll_time,
  3315. t1.has_vedio
  3316. FROM bis_insp_pblm t1
  3317. LEFT JOIN ATT_AD_X_BASE t2 on t1.obj_ad_code = t2.ad_code
  3318. LEFT JOIN BIS_INSP_ALL_RLATION_PERS t3 ON t1.rec_pers = t3.guid
  3319. LEFT JOIN bis_insp_all_obj t4 ON t1.obj_id = t4.obj_id
  3320. WHERE t1.obj_type = '999'
  3321. <if test="province != null and province != ''">
  3322. <choose>
  3323. <when test="province !=null and province !=''">
  3324. and t1.obj_ad_code like '${province}%'
  3325. </when>
  3326. <otherwise>
  3327. and t1.obj_ad_code is null
  3328. </otherwise>
  3329. </choose>
  3330. </if>
  3331. <if test="adFullName != null and adFullName != '' ">
  3332. AND t2.ad_full_name like '%${adFullName}%'
  3333. </if>
  3334. <if test="objName != null and objName != '' ">
  3335. AND t1.obj_name like '%${objName}%'
  3336. </if>
  3337. <if test="inspPblmName != null and inspPblmName != '' ">
  3338. AND t1.insp_pblm_name like '%${inspPblmName}%'
  3339. </if>
  3340. <if test="recPers != null and recPers != '' ">
  3341. AND t1.rec_pers like '%{recPers}%'
  3342. </if>
  3343. <if test="persName != null and persName != '' ">
  3344. AND t3.pers_name like '%${persName}%'
  3345. </if>
  3346. <if test="startTime != null and startTime != '' ">
  3347. AND t1.coll_time &gt; TO_DATE(#{startTime},'YYYY-MM-DD')
  3348. </if>
  3349. <if test="endTime != null and endTime != '' ">
  3350. AND t1.coll_time &lt; TO_DATE(#{endTime},'YYYY-MM-DD')
  3351. </if>
  3352. </select>
  3353. <!-- 批量导入 -->
  3354. <insert id="insertByList" parameterType="java.util.ArrayList">
  3355. INSERT ALL
  3356. <foreach collection="list" item="item">
  3357. INTO bis_insp_pblm
  3358. (PBLM_ID, OBJ_ID,OBJ_TYPE, OBJ_AD_CODE, INSP_PBLM_NAME, PBLM_NAME_BZ, INSP_PBLM_DESC,
  3359. IF_CASE_PBLM, DATA_STAT, COLL_TIME, REC_PERS, obj_name, CHECK_POINT_BZ,
  3360. PBLM_DESC_BZ, INSP_PBLM_CATE, has_vedio, state )
  3361. VALUES
  3362. (
  3363. #{item.pblmId},#{item.objId},#{item.objType},#{item.objAdCode},#{item.inspPblmName},#{item.pblmNameBz},#{item.inspPblmDesc},
  3364. #{item.ifCasePblm}, 0, #{item.collTime},#{item.recPers},#{item.objName},#{item.checkPointBz},
  3365. #{item.pblmDescBz}, #{item.inspPblmCate},#{item.hasVedio},#{item.state}
  3366. )
  3367. </foreach>
  3368. select * from DUAL
  3369. </insert>
  3370. <delete id="batchDelete" parameterType="java.util.ArrayList">
  3371. delete from bis_insp_pblm where PBLM_ID in
  3372. <foreach collection="list" item="item" open="(" close=")" separator=",">
  3373. #{item.pblmId}
  3374. </foreach>
  3375. </delete>
  3376. <select id="indexTopList" resultMap="bisInspPblmResultMap"
  3377. parameterType="cn.com.goldenwater.dcproj.param.BisInspPblmParam">
  3378. SELECT * FROM (SELECT
  3379. P.*, O.NM, O.OBJ_AD_CODE AS AD_CODE,
  3380. AAB.AD_NAME, AAB.AD_FULL_NAME, A.PNM, T.NAME AS OBJ_TYPE_NAME
  3381. FROM BIS_INSP_PBLM P
  3382. JOIN BIS_INSP_ALL_OBJ O on P.OBJ_ID = O.OBJ_ID
  3383. JOIN (select * FROM ATT_INSP_TYPE where code IN (select INSP_TYPE FROM REL_ORG_INSP_TYPE
  3384. <where>
  3385. <if test="orgId != null and orgId != '' ">
  3386. AND ORG_ID = #{orgId}
  3387. </if>
  3388. </where>
  3389. )) T on P.OBJ_TYPE = T.PTYPE
  3390. LEFT JOIN ATT_AD_BASE AAB on O.OBJ_AD_CODE = AAB.AD_CODE
  3391. LEFT JOIN BIS_INSP_ALL A on A.ID = O.ID
  3392. <where>
  3393. <if test="orgId != null and orgId != '' ">O.ID LIKE '___${orgId}%'</if>
  3394. <if test="objType != null and objType != ''">and P.OBJ_TYPE = #{objType}</if>
  3395. <if test="inspPblmCate != null and inspPblmCate != ''">and P.INSP_PBLM_CATE = #{inspPblmCate}</if>
  3396. <if test="sttm != null and sttm != '' and entm != null and entm != '' ">
  3397. AND P.COLL_TIME &gt;= TO_DATE(#{sttm}, 'YYYY-MM-DD')
  3398. AND P.COLL_TIME &lt; TO_DATE(#{entm}, 'YYYY-MM-DD') + 1
  3399. </if>
  3400. <if test="adCode != null and adCode != ''">and O.OBJ_AD_CODE like '${adCode}%'</if>
  3401. <!-- 福建省 福州市排除 平潭县 把平潭县 归属到 平潭综合实验区-->
  3402. <if test='adCode != null and adCode == "3501" '>AND SUBSTR(O.OBJ_AD_CODE, 0, 6) !='350128'</if>
  3403. <if test='adCode != null and adCode == "3510" '>AND SUBSTR(O.OBJ_AD_CODE, 0, 6) ='350128'</if>
  3404. </where>
  3405. ORDER BY P.COLL_TIME desc
  3406. ) w where ROWNUM &lt;= ${pageSize}
  3407. </select>
  3408. <select id="lists" resultType="cn.com.goldenwater.dcproj.model.BisInspPblm">
  3409. select * from (
  3410. select
  3411. J.NM RS_NAME, J.OBJ_AD_CODE AS AD_CODE,
  3412. J.CODE,J.NM,J.ID AS OID, J.ID AS ORG_ID, J.PTYPE,
  3413. P.*, P.INSP_PBLM_NAME AS INSP_PBLMS_NAME,P.PBLM_DESC_BZ AS PBLM_DESC, P.CHECK_POINT_BZ AS CHECK_POINT,
  3414. BN.OBJ_TYPE AS BASE_OBJ_TYPE, BN.ENGR_TYPE
  3415. from BIS_INSP_PBLM p
  3416. join (select * from BIS_INSP_ALL_OBJ o where o.pType='128') J ON P.OBJ_ID=J.OBJ_ID
  3417. LEFT JOIN BIS_INSP_BASE_NEW BN ON BN.ID=J.CODE
  3418. ) a
  3419. <where>
  3420. <if test="orgIds != null and orgIds != ''">and org_id in (${orgIds})</if>
  3421. </where>
  3422. order by ad_code asc, CODE asc
  3423. </select>
  3424. </mapper>