ff40d29294a3faf86ed55a3a4f93bc8c88b39f4d.svn-base 178 KB

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