SupervisionPlanDao.xml 116 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293
  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.SupervisionPlanDao">
  4. <sql id="choseSql">
  5. <choose>
  6. <when test="province !=null and province !=''">
  7. and B.ad_code like '${province}%'
  8. </when>
  9. <otherwise>
  10. and B.ad_code is null
  11. </otherwise>
  12. </choose>
  13. </sql>
  14. <sql id="baseChoseSql">
  15. <choose>
  16. <when test="province !=null and province !=''">
  17. and t.ad_code like '${province}%'
  18. </when>
  19. <otherwise>
  20. and t.ad_code is null
  21. </otherwise>
  22. </choose>
  23. </sql>
  24. <select id="getNodeByPersid" resultType="cn.com.goldenwater.dcproj.dto.AllNodeDto">
  25. SELECT A.ID,A.PID,A.PNM NM FROM BIS_INSP_ALL A LEFT JOIN BIS_INSP_ALL_RLATION B ON A.ID = B.ID
  26. WHERE B.PERSID = #{persid} and A.ID LIKE '${ptype}%'
  27. <include refid="choseSql"/>
  28. </select>
  29. <select id="getAllInfoByPersidAndOrgId" resultType="cn.com.goldenwater.dcproj.dto.PersAllInfoDto">
  30. SELECT DISTINCT A.ID,A.PID,A.ORG_ID,A.YEAR_TASK_ID INSP_TASK,A.PNM NM,SUBSTR(A.ID,0,3) PTYPE,TO_CHAR(A.STTM,'YYYY-MM-DD')
  31. STTM,TO_CHAR(A.ENTM,'YYYY-MM-DD') ENTM ,BIPY.CHK_NAME,BIPY.CHK_TYPE FROM BIS_INSP_ALL A
  32. LEFT JOIN BIS_INSP_PLAN_YEAR BIPY ON BIPY.ID = A.YEAR_TASK_ID
  33. LEFT JOIN BIS_INSP_ALL_RLATION B ON A.ID = B.ID
  34. WHERE A.ID LIKE '${orgIdStr}%' AND LENGTH(A.ID) = 12
  35. <if test="inspYear != null and inspYear != ''">AND A.INSP_YEAR = #{inspYear}</if>
  36. <if test="inspMnth != null and inspMnth != ''">AND A.INSP_MNTH = #{inspMnth}</if>
  37. <if test="yearPlanId !=null and yearPlanId != ''">AND A.YEAR_TASK_ID = #{yearPlanId}</if>
  38. <!--
  39. AND REGEXP_LIKE(
  40. A.Id,'^('||
  41. ( case when(SELECT count(id) from BIS_INSP_ALL_RLATION B WHERE PERSID = #{persid} and B.type=#{inspType}
  42. <include refid="choseSql"/>
  43. )>0 then
  44. (SELECT LISTAGG(id, '|') WITHIN GROUP(ORDER BY PERSID) as
  45. id FROM BIS_INSP_ALL_RLATION B WHERE PERSID = #{persid} and B.type=#{inspType} <include refid="choseSql"/> )
  46. else (select 'non' from dual) end)
  47. ||')')
  48. -->
  49. ORDER BY A.ID
  50. </select>
  51. <select id="getPersAllDtoList" parameterType="String" resultType="cn.com.goldenwater.dcproj.dto.PersAllDto">
  52. select A.GUID,A.PERS_NAME,B.PERTYPE persType from BIS_INSP_ALL_RLATION_PERS A LEFT JOIN BIS_INSP_ALL_RLATION B
  53. ON A.GUID = B.PERSID
  54. WHERE B.ID = #{id}
  55. <include refid="choseSql"/>
  56. </select>
  57. <select id="getPersAllObjDtoList" parameterType="String" resultType="cn.com.goldenwater.dcproj.dto.PersAllObjDto">
  58. select B.CODE,B.NM name,B.PTYPE,B.OBJ_ID from BIS_INSP_ALL_OBJ B WHERE B.ID = #{id}
  59. <include refid="choseSql"/>
  60. </select>
  61. <select id="getPersAllAreaDtoList" parameterType="String" resultType="cn.com.goldenwater.dcproj.dto.PersAllAreaDto">
  62. select A.AD_CODE,A.AD_NAME from BIS_INSP_SEL_AREA A WHERE A.ID = #{id}
  63. <choose>
  64. <when test="province !=null and province !=''">
  65. AND A.ORG_ID=#{orgId}
  66. </when>
  67. <otherwise>
  68. AND A.ORG_ID is null
  69. </otherwise>
  70. </choose>
  71. </select>
  72. <select id="getNode" resultType="cn.com.goldenwater.dcproj.dto.AllNodeDto">
  73. SELECT A.ID,A.PID,A.PNM NM FROM BIS_INSP_ALL A WHERE A.ID LIKE '${id}%' AND LENGTH(A.ID) = 9
  74. </select>
  75. <select id="getNodeById" parameterType="String" resultType="cn.com.goldenwater.dcproj.dto.AllNodeDto">
  76. SELECT A.ID,A.PID,A.PNM NM FROM BIS_INSP_ALL A WHERE A.ID = #{id}
  77. </select>
  78. <select id="getSupResByGroup" parameterType="cn.com.goldenwater.dcproj.param.InGroupResParam"
  79. resultType="cn.com.goldenwater.dcproj.dto.AttSupResBase">
  80. SELECT distinct *
  81. FROM (SELECT A.rs_code code,
  82. A.rs_name as name,
  83. A.rs_name as nm,
  84. NVL(B.state, 0) as state,
  85. NVL(B.state, 0) as hst_insp,
  86. A.RS_NAME,
  87. A.BUILD_STAT,
  88. A.LONGITUDE,
  89. A.LATITUDE,
  90. A.LOCATION,
  91. A.ENG_SCAL,
  92. A.LIM_STAG,
  93. A.TOT_CAP,
  94. A.RS_ADM_NAME,
  95. A.RS_ADM_CODE,
  96. A.RS_ADM_DEP,
  97. A.ADM_ATT_REL,
  98. A.ADM_DIV,
  99. A.ADM_DIV AS AD_CODE,
  100. A.RS_TYPE,
  101. A.DAM_TYPE_MAT,
  102. A.DAM_TYPE_STR,
  103. A.DAM_SIZE_HIG,
  104. A.CENTER_X,
  105. A.CENTER_Y,
  106. A.SRC,
  107. A.DATA_QUALITY,
  108. A.CENTER_X_GD,
  109. A.CENTER_Y_GD,
  110. A.RS_LOC,
  111. A.REG_CODE,
  112. A.COMP_DATE,
  113. A.INTM,
  114. A.REG_NO,
  115. A.PERS_ID,
  116. A.UPTM,
  117. A.CHK_STATE,
  118. A.EDTR_PESR,
  119. A.SLPC_ADM_DIV,
  120. A.ADM_DIV_NAME,
  121. A.ADM_DIV_NAME AS AD_NAME,
  122. AD.AD_FULL_NAME,
  123. A.PROVINCIAL
  124. FROM ATT_RS_BASE A
  125. LEFT JOIN (
  126. SELECT a.RS_CODE, '1' as state
  127. FROM ATT_RS_BASE a
  128. WHERE Exists (select code FROM BIS_INSP_ALL_OBJ o
  129. where o.code = a.RS_CODE
  130. and o.ptype = #{pType}
  131. and to_char(o.OBJ_INTM,'yyyy')=to_char(sysdate,'yyyy')
  132. )
  133. ) B ON A.RS_CODE = B.RS_CODE
  134. LEFT JOIN ATT_AD_BASE AD ON AD.AD_CODE = A.ADM_DIV
  135. WHERE
  136. A.RS_CODE NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ B
  137. WHERE ID = #{groupId}
  138. AND PTYPE = #{pType}
  139. <include refid="choseSql"/>
  140. )
  141. ) c
  142. <where>
  143. <if test="province !=null and province !=''">and adm_div like '${province}%'</if>
  144. <if test="adnm != null and adnm != ''">and ADM_DIV_NAME LIKE '%${adnm}%'</if>
  145. <if test="rsName != null and rsName != ''">and RS_NAME LIKE '%${rsName}%'</if>
  146. <if test="nm != null and nm != ''">and RS_NAME LIKE '%${nm}%'</if>
  147. <if test="engScal != null and engScal != ''">and ENG_SCAL IN (${engScal})</if>
  148. <if test="adcd != null and adcd != ''">and ${adcd}</if>
  149. <if test="adCode != null and adCode != ''">and ${adCode}</if>
  150. <if test="isSupn != null and isSupn != ''">and state = #{isSupn}</if>
  151. </where>
  152. ORDER BY
  153. <if test="orderBy != null and orderBy != ''">${orderBy} ,</if>
  154. code asc
  155. </select>
  156. <select id="getSupResStndByGroup" parameterType="cn.com.goldenwater.dcproj.param.InGroupResParam"
  157. resultType="cn.com.goldenwater.dcproj.dto.AttSupResBase">
  158. SELECT distinct *
  159. FROM (SELECT A.rs_code code,
  160. A.rs_name as name,
  161. A.rs_name as nm,
  162. A.rs_name,
  163. A.longitude,
  164. A.latitude,
  165. A.location,
  166. A.eng_scal,
  167. A.lim_stag,
  168. A.tot_cap,
  169. A.rs_adm_name,
  170. A.rs_adm_code,
  171. A.rs_adm_dep,
  172. A.adm_att_rel,
  173. A.adm_div,
  174. A.rs_type,
  175. A.dam_type_mat,
  176. A.dam_type_str,
  177. A.dam_size_hig,
  178. A.center_x,
  179. A.center_y,
  180. A.src,
  181. A.data_quality,
  182. A.center_x_gd,
  183. A.center_y_gd,
  184. A.rs_loc,
  185. A.reg_code,
  186. A.comp_date,
  187. A.intm,
  188. A.reg_no,
  189. A.hst_insp,
  190. A.pers_id,
  191. A.uptm,
  192. A.chk_state,
  193. A.edtr_pesr,
  194. A.slpc_adm_div,
  195. A.adm_div_name,
  196. case when b.code is null then '0' else '1' end
  197. STATE
  198. FROM ATT_RS_BASE A
  199. LEFT JOIN (select * from BIS_INSP_ALL_OBJ B where 1=1
  200. <include refid="choseSql"/>
  201. ) B
  202. ON A.rs_code = B.CODE
  203. WHERE A.RS_CODE NOT IN (SELECT CODE
  204. FROM BIS_INSP_ALL_OBJ B
  205. WHERE ID = #{groupId}
  206. AND PTYPE = #{pType}
  207. <include refid="choseSql"/>
  208. )
  209. <if test="province !=null and province !=''">
  210. and A.adm_div like '${province}%'
  211. </if>
  212. <if test="adnm != null and adnm != ''">and A.ADM_DIV_NAME LIKE '%${adnm}%'</if>
  213. <if test="rsName != null and rsName != ''">and A.RS_NAME LIKE '%${rsName}%'</if>
  214. <if test="engScal != null and engScal != ''">and A.ENG_SCAL IN (${engScal})</if>
  215. <if test="adcd != null and adcd != ''">and ${adcd}</if>
  216. ) c
  217. WHERE 1 = 1
  218. ORDER BY
  219. <if test="orderBy != null and orderBy != ''">${orderBy} ,</if>
  220. code asc
  221. </select>
  222. <select id="getSupResRsmlByGroup" parameterType="cn.com.goldenwater.dcproj.param.InGroupResParam"
  223. resultType="cn.com.goldenwater.dcproj.dto.AttSupResBase">
  224. SELECT distinct *
  225. FROM (SELECT A.rs_code code,
  226. A.rs_name as name,
  227. A.rs_name as nm,
  228. A.rs_name,
  229. A.longitude,
  230. A.latitude,
  231. A.location,
  232. A.eng_scal,
  233. A.lim_stag,
  234. A.tot_cap,
  235. A.rs_adm_name,
  236. A.rs_adm_code,
  237. A.rs_adm_dep,
  238. A.adm_att_rel,
  239. A.adm_div,
  240. A.rs_type,
  241. A.dam_type_mat,
  242. A.dam_type_str,
  243. A.dam_size_hig,
  244. A.center_x,
  245. A.center_y,
  246. A.src,
  247. A.data_quality,
  248. A.center_x_gd,
  249. A.center_y_gd,
  250. A.rs_loc,
  251. A.reg_code,
  252. A.comp_date,
  253. A.intm,
  254. A.reg_no,
  255. A.hst_insp,
  256. A.pers_id,
  257. A.uptm,
  258. A.chk_state,
  259. A.edtr_pesr,
  260. A.slpc_adm_div,
  261. A.adm_div_name,
  262. case when b.state is null then '0' else b.state end STATE
  263. FROM ATT_RS_BASE A
  264. LEFT JOIN (
  265. SELECT a.rs_code, '1' as state
  266. FROM ATT_RS_BASE a
  267. WHERE Exists (select code FROM BIS_INSP_ALL_OBJ o where o.code = a.rs_code and o.ptype = #{pType})
  268. ) B ON A.rs_code = B.rs_code
  269. WHERE A.RS_CODE NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ B WHERE ID = #{groupId} AND PTYPE = #{pType})
  270. <if test="province !=null and province !=''">and A.adm_div like '${province}%'</if>
  271. <if test="adnm != null and adnm != ''">and A.ADM_DIV_NAME LIKE '%${adnm}%'</if>
  272. <if test="rsName != null and rsName != ''">and A.RS_NAME LIKE '%${rsName}%'</if>
  273. <if test="engScal != null and engScal != ''">and A.ENG_SCAL IN (${engScal})</if>
  274. <if test="adcd != null and adcd != ''">and ${adcd}</if>
  275. ) c
  276. ORDER BY
  277. <if test="orderBy != null and orderBy != ''">${orderBy} ,</if>
  278. code asc
  279. </select>
  280. <!--查询不在范围内的对象-->
  281. <select id="getSupRivListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.AttSupResBase">
  282. select RS_CODE code,
  283. RS_NAME as name,
  284. RS_NAME as nm,
  285. LONGITUDE,
  286. LATITUDE,
  287. LOCATION,
  288. ENG_SCAL,
  289. LIM_STAG,
  290. TOT_CAP,
  291. RS_ADM_NAME,
  292. RS_ADM_CODE,
  293. RS_ADM_DEP,
  294. ADM_ATT_REL,
  295. ADM_DIV,
  296. RS_TYPE,
  297. DAM_TYPE_MAT,
  298. DAM_TYPE_STR,
  299. DAM_SIZE_HIG,
  300. CENTER_X,
  301. CENTER_Y,
  302. SRC,
  303. DATA_QUALITY,
  304. CENTER_X_GD,
  305. CENTER_Y_GD,
  306. RS_LOC,
  307. REG_CODE,
  308. COMP_DATE,
  309. INTM,
  310. REG_NO,
  311. HST_INSP,
  312. PERS_ID,
  313. UPTM,
  314. CHK_STATE,
  315. EDTR_PESR,
  316. SLPC_ADM_DIV,
  317. ADM_DIV_NAME,
  318. COMP_DATE_STR,
  319. PROVINCIAL
  320. from ATT_RS_BASE t
  321. where t.rs_code not in (
  322. select CODE from BIS_INSP_ALL_OBJ B where id like concat(#{inspGroupId},'%')
  323. )
  324. <include refid="baseChoseSql"/>
  325. <if test="rsName != null and rsName != ''">and t.RS_NAME LIKE '%${rsName}%'</if>
  326. <if test="nm != null and nm != ''">and t.RS_NAME LIKE '%${nm}%'</if>
  327. <if test="adCode != null and adCode != ''">and t.ADM_DIV LIKE '${adCode}%'</if>
  328. <if test="engScal != null and engScal != ''">and t.ENG_SCAL = #{engScal}</if>
  329. <if test="rsAdmDep != null and rsAdmDep != ''">and t.RS_ADM_DEP = #{rsAdmDep}</if>
  330. </select>
  331. <select id="getSupCwsListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.AttSupAdBase">
  332. select distinct * from (
  333. SELECT A.GUID,
  334. A.AD_CODE code,
  335. A.AD_NAME as name,
  336. A.AD_NAME as nm,
  337. A.AD_NAME,
  338. NVL(B.state, 0) as state,
  339. A.LOW_LEFT_LONG,
  340. A.LOW_LEFT_LAT,
  341. A.UP_RIGHT_LONG,
  342. A.UP_RIGHT_LAT,
  343. A.UP_AD_NAME,
  344. A.AD_GRAD,
  345. A.AD_ABBR_NAME,
  346. A.AD_STAT,
  347. A.AD_AREA,
  348. A.AD_FULL_NAME,
  349. A.NOTE,
  350. A.EFF_DATE,
  351. A.EXPR_DATE,
  352. A.AD_STAT_LONG,
  353. A.AD_STAT_LAT,
  354. A.DOMAIN_CODE,
  355. A.AD_SIGN,
  356. A.MODIFIER_PEOPLE,
  357. A.UPD_DATE,
  358. A.IS_REPORT,
  359. A.AD_FCODE,
  360. A.IS_POVERYT,
  361. A.SRC,
  362. A.REMARK,
  363. A.AD_LONG,
  364. A.AD_LAT,
  365. A.LGTD,
  366. A.LTTD,
  367. A.LGTDPC,
  368. A.LTTDPC
  369. FROM ATT_AD_X_BASE A
  370. LEFT JOIN (
  371. SELECT a.AD_CODE, '1' as state
  372. FROM ATT_AD_X_BASE a
  373. WHERE Exists (select code FROM BIS_INSP_ALL_OBJ o
  374. where o.code = a.AD_CODE
  375. and o.ptype = #{objType}
  376. and to_char(o.OBJ_INTM,'yyyy')=to_char(sysdate,'yyyy')
  377. )
  378. ) B ON A.AD_CODE = B.AD_CODE
  379. WHERE
  380. A.AD_GRAD IN (${adGrad})
  381. and A.AD_CODE NOT in (
  382. select CODE from BIS_INSP_ALL_OBJ B where id like concat(#{inspGroupId},'%')
  383. <include refid="choseSql"/>
  384. )
  385. <if test="province !=null and province !=''">
  386. and A.AD_CODE like '${province}%'
  387. </if>
  388. <if test="adName != null and adName != ''">and A.AD_NAME LIKE '%${adName}%'</if>
  389. <if test="nm != null and nm != ''">and A.AD_NAME LIKE '%${nm}%'</if>
  390. <if test="adCode != null and adCode != ''">and A.ad_code like '${adCode}%'</if>
  391. ORDER BY
  392. <!-- <if test="orderBy != null and orderBy != ''"> ${orderBy},</if>-->
  393. A.AD_CODE
  394. ) w
  395. <where>
  396. <if test="isSupn != null and isSupn != ''">and state = #{isSupn}</if>
  397. </where>
  398. </select>
  399. <select id="getSupMfdpListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.AttSupAdBase">
  400. select distinct * from (
  401. SELECT A.GUID,
  402. A.AD_CODE code,
  403. A.AD_NAME as name,
  404. A.AD_NAME as nm,
  405. A.AD_NAME,
  406. A.LOW_LEFT_LONG,
  407. A.LOW_LEFT_LAT,
  408. A.UP_RIGHT_LONG,
  409. A.UP_RIGHT_LAT,
  410. A.UP_AD_NAME,
  411. A.AD_GRAD,
  412. A.AD_ABBR_NAME,
  413. A.AD_STAT,
  414. A.AD_AREA,
  415. A.AD_FULL_NAME,
  416. A.NOTE,
  417. A.EFF_DATE,
  418. A.EXPR_DATE,
  419. A.AD_STAT_LONG,
  420. A.AD_STAT_LAT,
  421. A.DOMAIN_CODE,
  422. A.AD_SIGN,
  423. A.MODIFIER_PEOPLE,
  424. A.UPD_DATE,
  425. A.IS_REPORT,
  426. A.AD_FCODE,
  427. A.IS_POVERYT,
  428. A.SRC,
  429. A.REMARK,
  430. A.AD_LONG,
  431. A.AD_LAT,
  432. A.LGTD,
  433. A.LTTD,
  434. A.LGTDPC,
  435. A.LTTDPC,
  436. case when b.STATE is null then '0' else b.STATE end STATE
  437. FROM ATT_AD_X_BASE A
  438. LEFT JOIN (
  439. SELECT A.AD_CODE AS CODE, '1' AS STATE
  440. FROM ATT_AD_X_BASE A
  441. WHERE EXISTS (SELECT CODE FROM BIS_INSP_ALL_OBJ O WHERE O.CODE = A.AD_CODE AND O.PTYPE = #{objType})
  442. ) B ON A.AD_CODE = B.CODE
  443. WHERE A.AD_GRAD='4' and A.AD_CODE NOT in (
  444. select CODE from BIS_INSP_ALL_OBJ B where id like concat(#{inspGroupId},'%')
  445. <include refid="choseSql"/>
  446. )
  447. <if test="province !=null and province !=''">AND A.AD_CODE LIKE '${province}%'</if>
  448. <if test="adName != null and adName != ''">and A.AD_NAME LIKE '%${adName}%'</if>
  449. <if test="nm != null and nm != ''">and A.AD_NAME LIKE '%${nm}%'</if>
  450. <if test="adCode != null and adCode != ''">and ${adCode}</if>
  451. ORDER BY
  452. <if test="orderBy != null and orderBy != ''">A.${orderBy},</if>
  453. A.AD_CODE
  454. ) w
  455. </select>
  456. <select id="getSupWtdListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.BisInspSupWtdst">
  457. select distinct * from (
  458. select t.wtdst_id code,
  459. t.wtdst_type,
  460. t.wtdst_nm as name,
  461. t.wtdst_nm as nm,
  462. t.wtdst_state,
  463. t.loc_ad,
  464. t.wtdst_dtle,
  465. t.wtdst_wrkam,
  466. t.plan_rcvr_tm,
  467. t.intm,
  468. t.uptm,
  469. t.note,
  470. t.wtdst_lgtd,
  471. t.wtdst_lttd,
  472. t.loc_nm,
  473. t.obj_type,
  474. t.obj_code,
  475. t.obj_name,
  476. t.center_x_gd,
  477. t.center_y_gd,
  478. t.PROVINCIAL,
  479. case when b.state is null then '0' else '1' end STATE
  480. from BIS_INSP_WTDST t
  481. LEFT JOIN (
  482. SELECT a.wtdst_id, '1' as state
  483. FROM BIS_INSP_WTDST a
  484. WHERE Exists (select code FROM BIS_INSP_ALL_OBJ o where o.code = a.wtdst_id and o.ptype = '3')
  485. ) B ON T.wtdst_id = B.wtdst_id
  486. where t.wtdst_id NOT in (
  487. select CODE from BIS_INSP_ALL_OBJ B where id like concat(#{inspGroupId},'%')
  488. )
  489. <if test="province !=null and province !=''">
  490. and t.loc_ad like '${province}%'
  491. </if>
  492. <if test="wtdstNm != null and wtdstNm != ''">and t.WTDST_NM LIKE '%${wtdstNm}%'</if>
  493. <if test="nm != null and nm != ''">and t.WTDST_NM LIKE '%${nm}%'</if>
  494. <if test="wtdstState != null and wtdstState != ''">and t.WTDST_STATE = #{wtdstState}</if>
  495. <if test="wtdstType != null and wtdstType != ''">and t.WTDST_TYPE = #{wtdstType}</if>
  496. <if test="year != null and year != ''">and t.year = #{year}</if>
  497. <if test="prjState != null and prjState != ''">and t.PRJ_STATE = #{prjState}</if>
  498. <if test="adCode != null and adCode != ''">and ${adCode}</if>
  499. ORDER BY
  500. <if test="orderBy != null and orderBy != ''">t.${orderBy},</if>
  501. t.loc_ad
  502. ) w
  503. </select>
  504. <select id="getSupEmpListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.EmpwtprjDto">
  505. SELECT distinct * FROM
  506. (SELECT t.id code,t.id,
  507. NVL(B.state, 0) as state,
  508. t.ptype,
  509. t.ad_code,
  510. t.nm name,t.nm,
  511. t.stwktm,
  512. t.plantm,
  513. t.estapp,
  514. t.lgtd,
  515. t.lttd,
  516. t.lgtd_pc,
  517. t.lttd_pc,
  518. t.intm,
  519. t.uptm,
  520. t.note,
  521. t.unit_id,
  522. t.unit_nm,
  523. t.ad_name,
  524. t.eng_sta,
  525. t.buid_time_year
  526. FROM ATT_EMPWTPRJ_BASE t
  527. LEFT JOIN (
  528. SELECT a.ID, '1' as state
  529. FROM ATT_EMPWTPRJ_BASE a
  530. WHERE Exists (select code FROM BIS_INSP_ALL_OBJ o where o.code = a.id and o.ptype = #{objType})
  531. ) B ON T.ID = B.ID
  532. where t.ID NOT in (
  533. select CODE from BIS_INSP_ALL_OBJ B where id like concat(#{inspGroupId},'%')
  534. <if test="objType !=null and objType !=''">
  535. and pType=#{objType}
  536. </if>
  537. )
  538. <if test="nm != null and nm != ''">and t.NM LIKE '%${nm}%'</if>
  539. <if test="province !=null and province !=''">
  540. and t.AD_CODE like '${province}%'
  541. </if>
  542. AND t.ENG_STA = #{engSta}
  543. )
  544. WHERE 1 = 1
  545. <if test="adCode != null and adCode != ''">and ${adCode}</if>
  546. ORDER BY
  547. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  548. ad_code
  549. </select>
  550. <!--获取不在督查组范围内的稽察项目-->
  551. <select id="getSupPawpListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.model.TacAttPawpBase">
  552. SELECT distinct * FROM
  553. (SELECT t.id code, t.name as nm,t.*,'' AS OBJ_ID,case when b.code is null then '' else '1' end as
  554. STATE FROM TAC_ATT_PAWP_BASE t LEFT JOIN BIS_INSP_ALL_OBJ B ON t.id = B.CODE
  555. where t.ID NOT in (
  556. select CODE from BIS_INSP_ALL_OBJ B where id like concat(#{inspGroupId},'%')
  557. )
  558. <if test="nm != null and nm != ''">and t.name LIKE '%${nm}%'</if>
  559. <if test="province !=null and province !=''">
  560. and t.AD_CODE like '${province}%'
  561. </if>
  562. <if test="engSta != null and engSta != ''">and t.type LIKE '%${engSta}%'</if>
  563. )
  564. WHERE OBJ_ID IS NULL
  565. <if test="adCode != null and adCode != ''">and ${adCode}</if>
  566. ORDER BY
  567. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  568. ad_code,name
  569. </select>
  570. <select id="getSupGrwListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.GrwDto">
  571. select distinct * FROM
  572. (SELECT t.stcd code,t.stcd,
  573. t.stnm name,t.stnm,t.stnm nm,
  574. t.adcd,
  575. t.adnm,
  576. t.gogunt,
  577. t.stlc,
  578. t.lgtd,
  579. t.lttd,
  580. t.rvnm,
  581. t.welldep,
  582. t.stndpnt,
  583. t.grdlvl,
  584. t.spghgh,
  585. t.sttp,
  586. t.wsttp,
  587. t.prtc,
  588. t.bwsttp,
  589. t.isart,
  590. t.burcn,
  591. t.aqme,
  592. t.pbprj,
  593. t.esstym,
  594. t.calym,
  595. t.onun,
  596. t.mnun,
  597. t.ostcd,
  598. t.intm,
  599. t.esstyr,
  600. t.stel,
  601. t.dtmnm,
  602. t.dtmmdpr,
  603. t.note,
  604. t.lgtd_pc,
  605. t.lttd_pc,B.OBJ_ID,case when b.code is null then '' else '1' end
  606. STATE FROM Att_Grw_Base t LEFT JOIN BIS_INSP_ALL_OBJ B ON t.stcd = B.CODE
  607. where t.STCD NOT in (
  608. select CODE from BIS_INSP_ALL_OBJ B where id like concat(#{inspGroupId},'%')
  609. )
  610. <if test="province !=null and province !=''">
  611. and t.ADCD like '${province}%'
  612. </if>
  613. <if test="nm != null and nm != ''">and t.stnm LIKE '%${nm}%'</if>
  614. <if test="adCode != null and adCode != ''">and ${adCode}</if>
  615. <if test="sttp != null and sttp != ''">and t.sttp = #{sttp}</if>
  616. <if test="gateType != null and gateType != ''">and t.sttp like concat(#{gateType},'%')</if>
  617. ) w
  618. ORDER BY
  619. <if test="orderBy != null and orderBy != ''">w.${orderBy},</if>
  620. w.stcd
  621. </select>
  622. <select id="getSupWagaListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.WagaDto">
  623. select distinct * FROM
  624. (SELECT t.obj_code,t.obj_code code,
  625. t.gate_name,t.gate_name name,t.gate_name nm,
  626. t.ad_code,
  627. t.loc_rv_name,
  628. t.gate_type,
  629. t.gate_flow,
  630. t.eng_scal,
  631. t.fl_gate_flow,
  632. t.des_fl_sta,
  633. t.che_fl_sta,
  634. t.che_gate_flow,
  635. t.che_des_fl_sta,
  636. t.che_che_fl_sta,
  637. t.dra_gate_flow,
  638. t.dra_des_fl_sta,
  639. t.dra_che_fl_sta,
  640. t.if_dra_dou,
  641. t.int_gate_flow,
  642. t.int_des_fl_sta,
  643. t.int_che_fl_sta,
  644. t.int_div_ab,
  645. t.int_use,
  646. t.int_use_irr_name,
  647. t.if_int_dou,
  648. t.tide_gate_flow,
  649. t.tide_des_sta,
  650. t.tide_che_sta,
  651. t.if_gate,
  652. t.if_dou_dile,
  653. t.eng_sta,
  654. t.buid_time_year,
  655. t.buid_time_mon,
  656. t.sta_time_year,
  657. t.sta_time_mon,
  658. t.eng_grad,
  659. t.main_con_grad,
  660. t.hole_num,
  661. t.hole_wid,
  662. t.sub_gate_num,
  663. t.sub_gate_wid,
  664. t.location_xiang,
  665. t.location_cun,
  666. t.gate_adm_name,
  667. t.gate_adm_dep,
  668. t.if_dem,
  669. t.if_aff_ri,
  670. t.adm_att_rel,
  671. t.center_x,
  672. t.center_y,
  673. t.gd_x,
  674. t.gd_y,
  675. t.gate_adm_org,
  676. t.PROVINCIAL,
  677. NVL(b.state, '0') AS STATE
  678. FROM ATT_WAGA_BASE t
  679. LEFT JOIN (
  680. SELECT a.OBJ_CODE, '1' as state
  681. FROM ATT_WAGA_BASE a
  682. WHERE Exists (select code FROM BIS_INSP_ALL_OBJ o
  683. where o.code = a.OBJ_CODE
  684. and o.ptype = #{objType}
  685. and to_char(o.OBJ_INTM,'yyyy')=to_char(sysdate,'yyyy')
  686. )
  687. ) B ON T.OBJ_CODE = B.OBJ_CODE
  688. where t.obj_code NOT in (
  689. select CODE from BIS_INSP_ALL_OBJ B where id like concat(#{inspGroupId},'%')
  690. )
  691. <if test="province !=null and province !=''">and t.AD_CODE like '${province}%'</if>
  692. <if test="rsName != null and rsName != ''">and t.gate_name LIKE '%${rsName}%'</if>
  693. <if test="nm != null and nm != ''">and t.gate_name LIKE '%${nm}%'</if>
  694. <if test="gateType != null and gateType != ''">and t.gate_TYPE = #{gateType}</if>
  695. <if test="engScal != null and engScal != ''">and t.ENG_SCAL = #{engScal}</if>
  696. <if test="engSta != null and engSta != ''">and t.ENG_STA = #{engSta}</if>
  697. )
  698. <where>
  699. <if test="adCode != null and adCode != ''">and ${adCode}</if>
  700. </where>
  701. ORDER BY
  702. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  703. obj_code
  704. </select>
  705. <insert id="insertPers">
  706. INSERT INTO BIS_INSP_ALL_RLATION(ID,PERSID,PERTYPE,ORG_ID,AD_CODE,TYPE) VALUES (#{id},#{guid},#{persType},#{orgId},#{adCode},#{type})
  707. </insert>
  708. <select id="getLgtdAndLttd" resultType="cn.com.goldenwater.dcproj.dto.LgtdAndLttd">
  709. SELECT * FROM
  710. <choose>
  711. <when test='type == "001" or type =="036" or type =="024" or type == "022" or type == "026" or type == "034"
  712. or type == "080" or type == "084" or type == "096" or type == "106" '>
  713. (select RS_CODE code, ADM_DIV AD_CODE,CENTER_X_GD lgtd,CENTER_Y_GD lttd,CENTER_X lgtdPc,CENTER_Y lttdPc
  714. FROM
  715. ATT_RS_BASE WHERE RS_CODE = #{code})
  716. </when>
  717. <when test=' type == "002" or type == "014" or type == "015" or type == "023" or type =="025" or type == "027"
  718. or type == "028" or type == "032" or type == "037" or type == "041" or type == "053"
  719. or type == "056" or type == "071" or type == "073" or type == "079" or type == "082" or type == "083"
  720. or type == "094" or type == "097" or type == "101" or type == "102" or type == "108"
  721. or type == "110" '>
  722. (select AD_CODE code, AD_CODE,LGTD lgtd,LTTD lttd,LGTDPC lgtdPc,LTTDPC lttdPc FROM ATT_AD_X_BASE WHERE
  723. AD_CODE = #{code})
  724. </when>
  725. <when test='type == "003"'>
  726. (select WTDST_ID code, LOC_AD AD_CODE,CENTER_X_GD lgtd,CENTER_Y_GD lttd,WTDST_LGTD lgtdPc,WTDST_LTTD
  727. lttdPc
  728. FROM
  729. BIS_INSP_WTDST WHERE WTDST_ID = #{code})
  730. </when>
  731. <when test='type == "004" or type=="099" or type=="100"'>
  732. (select ID code, AD_CODE,LGTD lgtd,LTTD lttd,LGTD_PC lgtdPc,LTTD_PC lttdPc FROM ATT_EMPWTPRJ_BASE WHERE
  733. ID =
  734. #{code})
  735. </when>
  736. <when test='type == "005"'>
  737. (select STCD code,ADCD AD_CODE, ADCD AD_CODE,LGTD lgtd,LTTD lttd,LGTD_PC lgtdPc,LTTD_PC lttdPc FROM
  738. ATT_GRW_BASE
  739. WHERE STCD = #{code})
  740. </when>
  741. <when test='type == "006" or type == "081" '>
  742. (select OBJ_CODE code, AD_CODE,GD_X lgtd,GD_Y lttd,CENTER_X lgtdPc,CENTER_Y lttdPc FROM ATT_WAGA_BASE
  743. WHERE
  744. OBJ_CODE = #{code})
  745. </when>
  746. <when test='type == "007"'>
  747. (select ID code, AD_CODE,LGTD lgtd,LTTD lttd,LGTD_PC lgtdPc,LTTD_PC lttdPc FROM ATT_EMPWTPRJ_BASE WHERE
  748. ID =
  749. #{code})
  750. </when>
  751. <when test='type == "008"'>
  752. (select ID code, AD_CODE,GD_X lgtd,GD_Y lttd,CENTER_X lgtdPc,CENTER_Y lttdPc FROM TAC_ATT_PAWP_BASE
  753. WHERE ID
  754. =
  755. #{code})
  756. </when>
  757. <when test='type == "009"'>
  758. (select ID code, AD_CODE,GD_X lgtd,GD_Y lttd,CENTER_X lgtdPc,CENTER_Y lttdPc FROM ATT_FSC_BASE where ID
  759. =
  760. #{code})
  761. </when>
  762. <when test='type == "010"'>
  763. (select ID code, AD_CODE,GD_X lgtd,GD_Y lttd,CENTER_X lgtdPc,CENTER_Y lttdPc FROM ATT_OTHER_BASE where
  764. ID =
  765. #{code})
  766. </when>
  767. <when test='type == "011"'>
  768. (select SD_CODE code, AD_CODE,GD_X lgtd,GD_Y lttd,CENTER_X lgtdPc,CENTER_Y lttdPc FROM ATT_SD_BASE where
  769. SD_CODE =
  770. #{code})
  771. </when>
  772. <when test='type == "012" or type == "112"'>
  773. (select ID code , AD_CODE,GD_X lgtd,GD_Y lttd,WIU_Long lgtdPc,WIU_LAT lttdPc FROM ATT_WIU_BASE t where
  774. ID =
  775. #{code})
  776. </when>
  777. <when test='type == "013"'>
  778. (select ID code, AD_CODE,SWHS_LONG_GD lgtd,SWHS_LAT_GD lttd,SWHS_LONG lgtdPc,SWHS_LAT lttdPc FROM
  779. ATT_SWHS_BASE where
  780. ID = #{code})
  781. </when>
  782. <when test='type == "016"'>
  783. (select ID code, AD_CODE,GD_X lgtd,GD_Y lttd,PC_X lgtdPc,PC_Y lttdPc FROM ATT_WUNT_BASE where ID =
  784. #{code})
  785. </when>
  786. <when test='type == "017" or type == "091" '>
  787. ( select ID code, AD_CODE,e.gd_x lgtd,e.gd_y lttd,e.center_x lgtdPc,e.center_y lttdPc FROM
  788. ATT_PRD_CSTR_PROJ_BASE e
  789. where ID = #{code})
  790. </when>
  791. <when test='type == "018"'>
  792. ( select ID code, AD_CODE,e.gd_x lgtd,e.gd_y lttd,e.center_x lgtdPc,e.center_y lttdPc FROM
  793. ATT_JSKEJIAN_FLKDIS_BASE e
  794. where ID = #{code})
  795. </when>
  796. <when test='type == "019"'>
  797. ( select ID code, AD_CODE,e.gd_x lgtd,e.gd_y lttd,e.center_x lgtdPc,e.center_y lttdPc FROM
  798. ATT_JSKEJIAN_WATER_BASE e
  799. where ID = #{code})
  800. </when>
  801. <when test='type == "020"'>
  802. ( select ID code, AD_CODE,e.gd_x lgtd,e.gd_y lttd,e.center_x lgtdPc,e.center_y lttdPc FROM
  803. ATT_JSKEJIAN_ECOFRD_BASE e
  804. where ID = #{code})
  805. </when>
  806. <when test="type == '042'">
  807. (select AD_CODE code, AD_CODE,LGTD lgtd,LTTD lttd,LGTDPC lgtdPc,LTTDPC lttdPc FROM ATT_ZHEJIANG_JG_BASE
  808. WHERE AD_CODE
  809. =#{code})
  810. </when>
  811. <when test="type == '031'">
  812. (select ID code, AD_CODE,wain_Long lgtd,wain_Lat lttd FROM ATT_WINT_BASE WHERE ID = #{code})
  813. </when>
  814. <when test="type == '030'">
  815. (select ID code, NAME,TYPE, AD_CODE FROM ATT_EFP_BASE WHERE ID = #{code})
  816. </when>
  817. <when test="type == '029'">
  818. (select ID code, SAP_NAME,BAS_CODE, AD_CODE FROM ATT_WAGA_SAP_BASE WHERE ID = #{code})
  819. </when>
  820. <when test='type == "033" or type == "054"'>
  821. (select ID code, AD_CODE,GD_X lgtd,GD_Y lttd,CENTER_X lgtdPc,CENTER_Y lttdPc FROM ATT_WTUNT_BASE WHERE
  822. ID =
  823. #{code})
  824. </when>
  825. <when test='type == "055" or type == "057"'>
  826. (select ID code, AD_CODE,GD_X lgtd,GD_Y lttd,CENTER_X lgtdPc,CENTER_Y lttdPc FROM ATT_WTGT_BASE WHERE ID
  827. =
  828. #{code})
  829. </when>
  830. <when test="type == '035'">
  831. (select ID code, AD_CODE,GD_X lgtd,GD_Y lttd,CENTER_X lgtdPc,CENTER_Y lttdPc FROM ATT_SAMRMP_BASE WHERE
  832. ID =
  833. #{code})
  834. </when>
  835. <when test='type == "062"'>
  836. (select ID code, AD_CODE,e.gd_x lgtd,e.gd_y lttd,e.center_x lgtdPc,e.center_y lttdPc FROM ATT_CDEP_BASE
  837. e
  838. where ID = #{code})
  839. </when>
  840. <when test='type == "067"'>
  841. (select ID code, AD_CODE,e.gd_x lgtd,e.gd_y lttd,e.center_x lgtdPc,e.center_y lttdPc FROM ATT_BID_BASE e
  842. where ID = #{code})
  843. </when>
  844. <when test='type == "068" or type == "105" or type == "119"'>
  845. (select AD_CODE code, AD_CODE,lgtd,lttd,lgtdPc,lttdPc FROM ATT_AD_BASE e where AD_CODE = #{code})
  846. </when>
  847. <when test='type == "069"'>
  848. (select ID code, AD_CODE,e.gd_x lgtd,e.gd_y lttd,e.center_x lgtdPc,e.center_y lttdPc FROM ATT_DEP_BASE e
  849. where ID = #{code})
  850. </when>
  851. <when test='type == "070"'>
  852. (select ID code, AD_CODE,e.gd_x lgtd,e.gd_y lttd,e.center_x lgtdPc,e.center_y lttdPc FROM ATT_GROW_BASE
  853. e
  854. where ID = #{code})
  855. </when>
  856. <when test='type == "072"'>
  857. (select ID code, AD_CODE,GD_X lgtd,GD_Y lttd,CENTER_X lgtdPc,CENTER_Y lttdPc FROM ATT_WIUQH_BASE WHERE
  858. ID =
  859. #{code})
  860. </when>
  861. <when test='type == "074"'>
  862. (select ID code, AD_CODE,GD_X lgtd,GD_Y lttd,CENTER_X lgtdPc,CENTER_Y lttdPc FROM ATT_SAFETY_BASE WHERE
  863. ID =
  864. #{code})
  865. </when>
  866. <when test='type == "075"'>
  867. (select ID code, AD_CODE,GD_X lgtd,GD_Y lttd,CENTER_X lgtdPc,CENTER_Y lttdPc FROM ATT_YNDEP_BASE WHERE
  868. ID =
  869. #{code})
  870. </when>
  871. <when test='type == "076"'>
  872. (select ID code, AD_CODE,GD_X lgtd,GD_Y lttd,CENTER_X lgtdPc,CENTER_Y lttdPc FROM ATT_DPGM_BASE WHERE ID
  873. =
  874. #{code})
  875. </when>
  876. <when test='type == "077"'>
  877. (select ID code, AD_CODE,GD_X lgtd,GD_Y lttd,CENTER_X lgtdPc,CENTER_Y lttdPc FROM ATT_RVGM_BASE WHERE ID
  878. =
  879. #{code})
  880. </when>
  881. <when test='type == "078"'>
  882. (select ID code, AD_CODE,GD_X lgtd,GD_Y lttd,CENTER_X lgtdPc,CENTER_Y lttdPc FROM ATT_WTPRJ_BASE WHERE
  883. ID =
  884. #{code})
  885. </when>
  886. <when test='type == "089"'>
  887. (select ID code, AD_CODE,GD_X lgtd,GD_Y lttd,CENTER_X lgtdPc,CENTER_Y lttdPc FROM ATT_UNWT_BASE WHERE ID
  888. =
  889. #{code})
  890. </when>
  891. <when test='type == "093"'>
  892. (select ID code, AD_CODE,GD_X lgtd,GD_Y lttd,CENTER_X lgtdPc,CENTER_Y lttdPc FROM ATT_FLOODQH_BASE WHERE
  893. ID
  894. =
  895. #{code})
  896. </when>
  897. <when test='type == "095"'>
  898. (select ID code, AD_CODE,GD_X lgtd,GD_Y lttd,CENTER_X lgtdPc,CENTER_Y lttdPc FROM ATT_DSTFLDQH_BASE
  899. WHERE ID
  900. =
  901. #{code})
  902. </when>
  903. <when test='type == "098"'>
  904. (select ID code, AD_CODE,e.gd_x lgtd,e.gd_y lttd,e.center_x lgtdPc,e.center_y lttdPc FROM ATT_FUND_BASE
  905. e
  906. where ID = #{code})
  907. </when>
  908. <when test='type== "104"'>
  909. (select ID code, AD_CODE,e.gd_x lgtd,e.gd_y lttd,e.center_x lgtdPc,e.center_y lttdPc FROM ATT_STSTN_BASE
  910. e
  911. where ID = #{code})
  912. </when>
  913. <when test='type== "109"'>
  914. (select cws_code code, AD_CODE,e.gd_x lgtd,e.gd_y lttd,e.center_x lgtdPc,e.center_y lttdPc FROM
  915. ATT_CWSJX_BASE e
  916. where cws_code = #{code})
  917. </when>
  918. <when test='type== "113"'>
  919. (select ID code, AD_CODE,e.gd_x lgtd,e.gd_y lttd,e.center_x lgtdPc,e.center_y lttdPc FROM
  920. BIS_INSP_SWHSJS e
  921. where ID = #{code})
  922. </when>
  923. <when test='type== "116"'>
  924. (select ID code, AD_CODE,e.gd_x lgtd,e.gd_y lttd,e.center_x lgtdPc,e.center_y lttdPc FROM ATT_HYSTP_BASE
  925. e
  926. where ID = #{code})
  927. </when>
  928. <when test='type== "117"'>
  929. (select ID code, AD_CODE,e.gd_x lgtd,e.gd_y lttd,e.center_x lgtdPc,e.center_y lttdPc FROM ATT_RDWPGD_BASE
  930. e
  931. where ID = #{code})
  932. </when>
  933. <when test='type== "120"'>
  934. (select ID code, AD_CODE,e.gd_x lgtd,e.gd_y lttd,e.center_x lgtdPc,e.center_y lttdPc FROM ATT_JSPWIU_BASE e
  935. where ID = #{code})
  936. </when>
  937. <when test='type== "126"'>
  938. (select ID code, AD_CODE,e.gd_x lgtd,e.gd_y lttd,e.center_x lgtdPc,e.center_y lttdPc FROM ATT_JSPWIU2024_BASE e
  939. where ID = #{code})
  940. </when>
  941. <when test='type== "128"'>
  942. (select ID code, AD_CODE,e.gd_x lgtd,e.gd_y lttd,e.center_x lgtdPc,e.center_y lttdPc FROM BIS_INSP_BASE_NEW e
  943. where ID = #{code})
  944. </when>
  945. <otherwise>
  946. (select ID code, AD_CODE,e.gd_x lgtd,e.gd_y lttd,e.center_x lgtdPc,e.center_y lttdPc FROM
  947. ATT_GNRL_BASE e
  948. where ID = #{code})
  949. </otherwise>
  950. </choose>
  951. </select>
  952. <insert id="insertSupArea">
  953. INSERT INTO BIS_INSP_SEL_AREA(AREA_ID,ID,AD_CODE,AD_NAME,ORG_ID) VALUES(#{uuid},#{id},#{adCode},#{adName},#{orgId})
  954. </insert>
  955. <select id="getPers" resultType="cn.com.goldenwater.dcproj.dto.ObjIdDto">
  956. SELECT PERSID guid,ID id,PERTYPE persType FROM BIS_INSP_ALL_RLATION B WHERE ID = #{id} AND PERSID = #{guid}
  957. <include refid="choseSql"/>
  958. </select>
  959. <update id="updatePersType">
  960. UPDATE BIS_INSP_ALL_RLATION SET PERTYPE = #{persType} WHERE ID = #{id} AND PERSID = #{guid}
  961. <if test="orgId !=null and orgId !=''">
  962. and org_id=#{orgId}
  963. </if>
  964. </update>
  965. <select id="getPersType" parameterType="String" resultType="cn.com.goldenwater.dcproj.dto.PersTypeDto">
  966. SELECT r.id id,r.pnm name FROM BIS_INSP_ALL r left join
  967. (SELECT DISTINCT SUBSTR(A.ID,0,3) rid FROM BIS_INSP_ALL A LEFT JOIN BIS_INSP_ALL_RLATION B ON A.ID = B.ID
  968. WHERE B.PERSID = #{persid}
  969. <include refid="choseSql"/>
  970. ) p on r.id = p.rid
  971. where p.rid is not null ORDER BY r.id
  972. </select>
  973. <select id="updateTeamLeader" parameterType="String">
  974. UPDATE BIS_INSP_ALL_RLATION SET PERTYPE = '2' WHERE ID = #{id}
  975. </select>
  976. <update id="updateGroupNm">
  977. UPDATE BIS_INSP_ALL SET PNM = #{nm} WHERE ID = #{id}
  978. </update>
  979. <select id="getPersTypeByPersid" parameterType="String" resultType="cn.com.goldenwater.dcproj.dto.PersTypeDto">
  980. SELECT DISTINCT A.CODE id,A.NAME name FROM ATT_INSP_TYPE A LEFT JOIN BIS_INS_NTFCTN B ON A.CODE = B.INSP_TYPE
  981. LEFT JOIN BIS_INSP_RECV_UNIT C ON B.ID = C.NTFCTN_ID
  982. LEFT JOIN BIS_INSP_ALL_RLATION_PERS D ON C.ORG_ID = D.ORG_ID
  983. WHERE B.FLAG_VALID = '1' AND C.FLAG_VALID = '1'
  984. AND D.GUID = #{persid} and C.ORG_ID=#{orgId}
  985. ORDER BY A.CODE
  986. </select>
  987. <select id="getPersTypeByPersidOrg" parameterType="String" resultType="cn.com.goldenwater.dcproj.dto.PersTypeDto">
  988. select DISTINCT t.CODE id,t.NAME from ATT_INSP_TYPE t,bis_insp_all_rlation r
  989. where t.code=substr(r.id,0,3) and r.persid=#{persid}
  990. <choose>
  991. <when test="province !=null and province !=''">
  992. and r.ad_code =#{province}
  993. </when>
  994. <otherwise>
  995. and r.ad_code is null
  996. </otherwise>
  997. </choose>
  998. order by to_number(t.code)
  999. </select>
  1000. <select id="getAllInfoByPersid" resultType="cn.com.goldenwater.dcproj.dto.PersAllInfoDto">
  1001. SELECT DISTINCT A.ID,A.PID,A.PNM NM,A.STTM,A.ENTM FROM BIS_INSP_ALL A LEFT JOIN BIS_INSP_ALL_RLATION B ON A.ID =
  1002. B.ID
  1003. WHERE A.ID LIKE '${ptype}%' AND A.PID = #{id}
  1004. <include refid="choseSql"/>
  1005. </select>
  1006. <select id="getPersAllObjDtoListByType" parameterType="String"
  1007. resultType="cn.com.goldenwater.dcproj.dto.PersAllObjDto">
  1008. select B.CODE,B.NM name,B.org_id from BIS_INSP_ALL_OBJ B WHERE B.ID = #{id}
  1009. <include refid="choseSql"/>
  1010. </select>
  1011. <select id="getNodeBy" resultType="cn.com.goldenwater.dcproj.dto.ObjectNameDto">
  1012. SELECT ID,PNM NAME FROM BIS_INSP_ALL WHERE ID LIKE '${id}' AND INSP_YEAR = #{inspYear}
  1013. AND province=#{province}
  1014. AND INSP_MNTH = #{inspMnth} AND ROWNUM &lt; 2
  1015. </select>
  1016. <select id="getMaxGroupId" parameterType="String" resultType="cn.com.goldenwater.dcproj.dto.ObjIdDto">
  1017. SELECT MAX(ID) AS id FROM BIS_INSP_ALL WHERE PID = #{id} and PROVINCE=#{province}
  1018. </select>
  1019. <sql id="table_columns_node">
  1020. ID,
  1021. PID,
  1022. PNM,
  1023. STTM,
  1024. ENTM,
  1025. ORG_ID,
  1026. INSP_YEAR,
  1027. INSP_MNTH,
  1028. INSP_TASK,
  1029. PROVINCE,
  1030. INSP_TYPE,
  1031. YEAR_TASK_ID
  1032. </sql>
  1033. <sql id="entity_properties_node">
  1034. #{id},
  1035. #{pid},
  1036. #{pnm},
  1037. to_date(#{sttm},'YYYY-MM-DD HH24:MI:SS'),
  1038. to_date(#{entm},'YYYY-MM-DD HH24:MI:SS'),
  1039. #{orgId},
  1040. #{inspYear},
  1041. #{inspMnth},
  1042. #{inspTask},
  1043. #{province},
  1044. #{inspType},
  1045. #{yearTaskId}
  1046. </sql>
  1047. <insert id="insertNode" parameterType="cn.com.goldenwater.dcproj.dto.BisInspAllNodeDto">
  1048. insert into BIS_INSP_ALL(
  1049. <include refid="table_columns_node"/>
  1050. )
  1051. values (
  1052. <include refid="entity_properties_node"/>
  1053. )
  1054. </insert>
  1055. <update id="updateNode" parameterType="cn.com.goldenwater.dcproj.dto.BisInspAllDto">
  1056. update BIS_INSP_ALL
  1057. <trim prefix="set" suffixOverrides=",">
  1058. <if test="pid != null and pid != ''">PID = #{pid},</if>
  1059. <if test="pnm != null and pnm != ''">PNM = #{pnm},</if>
  1060. <if test="sttm != null">STTM = TO_DATE(#{sttm},'YYYY-MM-DD'),</if>
  1061. <if test="entm != null">ENTM = TO_DATE(#{entm},'YYYY-MM-DD'),</if>
  1062. <if test="orgId != null and orgId != ''">ORG_ID = #{orgId},</if>
  1063. <if test="intm != null">INTM = #{intm},</if>
  1064. <if test="psn != null and psn != ''">PSN = #{psn},</if>
  1065. <if test="inspYear != null and inspYear != ''">INSP_YEAR = #{inspYear},</if>
  1066. <if test="inspMnth != null and inspMnth != ''">INSP_MNTH = #{inspMnth},</if>
  1067. <if test="inspTask != null and inspTask != ''">INSP_TASK = #{inspTask},</if>
  1068. <if test="inspTask != null and inspTask != ''">YEAR_TASK_ID = #{inspTask},</if>
  1069. <if test="quantity != null">QUANTITY = #{quantity},</if>
  1070. </trim>
  1071. <where>ID = #{id}</where>
  1072. </update>
  1073. <select id="getPersInfo" parameterType="String" resultType="cn.com.goldenwater.dcproj.dto.BisInspAllRlationPersDto">
  1074. SELECT * FROM BIS_INSP_ALL_RLATION_PERS WHERE GUID = #{persid}
  1075. </select>
  1076. <select id="getNodeByOrgId" parameterType="String" resultType="cn.com.goldenwater.dcproj.dto.AllNodeDto">
  1077. SELECT ID id,PID pid,PNM,org_id nm FROM BIS_INSP_ALL WHERE ID LIKE '${orgIdStr}%' AND LENGTH(ID) = 9 AND PROVINCE=#{province}
  1078. </select>
  1079. <delete id="deleteNodeByPersid" parameterType="java.lang.String">
  1080. delete from bis_insp_all_rlation where length(id) &lt;= 6 and PERSID = #{persid}
  1081. </delete>
  1082. <select id="getSupFscListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.AttFscBaseDto">
  1083. SELECT DISTINCT * from (
  1084. select T.id,
  1085. T.Code,
  1086. T.NAME,
  1087. T.NAME as nm,
  1088. T.TYPE,
  1089. T.ADM_ORG,
  1090. T.AD_CODE,
  1091. T.LOCATION,
  1092. T.CENTER_X,
  1093. T.CENTER_Y,
  1094. T.GD_X,
  1095. T.GD_Y,
  1096. T.PERS_ID,
  1097. T.INTM,
  1098. T.UPTM,B.OBJ_ID ,case when b.code is null then '' else '1' end state
  1099. from ATT_FSC_BASE t LEFT JOIN BIS_INSP_ALL_OBJ B on T.id = B.Code
  1100. where t.id not in (select code from bis_insp_all_obj where id like concat(#{inspGroupId},'%'))
  1101. <if test="nm != null and nm != ''">AND T.name like '%${nm}%'</if>
  1102. <if test="type != null and type != ''">
  1103. And t.type = #{type}
  1104. </if>
  1105. <if test="province !=null and province !=''">
  1106. and t.ad_code like '${province}%'
  1107. </if>
  1108. ) WHERE 1 = 1
  1109. <if test="adCode != null and adCode != ''">and ${adCode}</if>
  1110. ORDER BY
  1111. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  1112. ad_code
  1113. </select>
  1114. <select id="getPrdListNotInspGroupId" parameterType="cn.com.goldenwater.dcproj.param.InspObjParam"
  1115. resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  1116. SELECT DISTINCT * FROM (
  1117. SELECT
  1118. T.ID CODE, T.NAME AS NM,
  1119. T.ID,T.NAME, T.TYPE, T.LOCATION,T.GD_X ,T.GD_Y,T.AD_CODE,T.AD_NAME,
  1120. CASE WHEN B.STATE IS NULL then '0' else B.STATE end STATE
  1121. FROM ATT_PRD_CSTR_PROJ_BASE T
  1122. LEFT JOIN (
  1123. SELECT A.ID, '1' AS STATE FROM ATT_PRD_CSTR_PROJ_BASE A
  1124. WHERE EXISTS (SELECT CODE FROM BIS_INSP_ALL_OBJ O WHERE O.CODE = A.ID AND O.PTYPE = #{objType})
  1125. ) B ON T.ID = B.ID
  1126. WHERE T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  1127. <if test="province !=null and province !=''">and t.ad_code like '${province}%'</if>
  1128. ) w
  1129. <where>
  1130. <if test="nm != null and nm != ''">and nm like '%${nm}%'</if>
  1131. <if test="adCode != null and adCode != ''">and ${adCode}</if>
  1132. <if test="type != null and type != ''">and TYPE = #{type}</if>
  1133. </where>
  1134. ORDER BY
  1135. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  1136. AD_CODE
  1137. </select>
  1138. <select id="getJSWAListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto"
  1139. parameterType="cn.com.goldenwater.dcproj.param.InspObjParam">
  1140. select distinct * from (
  1141. select t.id,t.id as code,t.name,t.name as nm,t.location as location,t.pblm_desc,t.gd_x as gdX,t.gd_y as
  1142. gdY,t.ad_code,t.pblm_type as type,t.ad_name,
  1143. B.OBJ_ID,CASE WHEN B.CODE IS NULL then '' else '1' end state
  1144. FROM ATT_JSKEJIAN_WATER_BASE T LEFT JOIN (select * FROM BIS_INSP_ALL_OBJ o where o.ptype = #{objType}) B ON T.id
  1145. = B.CODE
  1146. WHERE T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  1147. <if test="province !=null and province !=''">
  1148. and t.ad_code like '${province}%'
  1149. </if>
  1150. ) w where 1=1
  1151. <if test="nm != null and nm != ''">
  1152. and nm like '%${nm}%'
  1153. </if>
  1154. <if test="adCode != null and adCode != ''">and ${adCode}</if>
  1155. ORDER BY
  1156. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  1157. ad_code
  1158. </select>
  1159. <select id="getEcofrdListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto"
  1160. parameterType="cn.com.goldenwater.dcproj.param.InspObjParam">
  1161. select distinct * from (
  1162. select t.id,t.id as code,t.ASSIGN_NUM name,t.ASSIGN_NUM as nm,t.location as location,t.REPORT_CONTENT as
  1163. type,t.gd_x as gdX,t.gd_y
  1164. as gdY,t.ad_code,t.ad_name,
  1165. B.OBJ_ID,CASE WHEN B.CODE IS NULL then '' else '1' end state
  1166. FROM ATT_JSKEJIAN_ECOFRD_BASE T LEFT JOIN (select * FROM BIS_INSP_ALL_OBJ o where o.ptype = #{objType}) B ON
  1167. T.id = B.CODE
  1168. WHERE T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  1169. <if test="province !=null and province !=''">
  1170. and t.ad_code like '${province}%'
  1171. </if>
  1172. ) w where 1=1
  1173. <if test="nm != null and nm != ''">
  1174. and nm like '%${nm}%'
  1175. </if>
  1176. <if test="adCode != null and adCode != ''">and ${adCode}</if>
  1177. ORDER BY
  1178. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  1179. ad_code
  1180. </select>
  1181. <select id="getJSFLListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto"
  1182. parameterType="cn.com.goldenwater.dcproj.param.InspObjParam">
  1183. select distinct * from (
  1184. select
  1185. t.id, t.id as code, t.name, t.name as nm,
  1186. NVL(B.state, 0) as state,
  1187. t.location as location, t.pblm_type as type,
  1188. t.pblm_desc,t.gd_x,t.gd_y,t.ad_code,
  1189. t.ad_name,t.RECT_CONC, t.INTM
  1190. FROM ATT_JSKEJIAN_FLKDIS_BASE T
  1191. LEFT JOIN (
  1192. SELECT a.ID, '1' as state
  1193. FROM ATT_JSKEJIAN_FLKDIS_BASE a
  1194. WHERE Exists (select code FROM BIS_INSP_ALL_OBJ o
  1195. where o.code = a.ID
  1196. and o.ptype = #{objType}
  1197. and to_char(o.OBJ_INTM,'yyyy')=to_char(sysdate,'yyyy')
  1198. )
  1199. ) B ON T.ID = B.ID
  1200. WHERE
  1201. T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ
  1202. WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  1203. <if test="svType != null and svType != ''">
  1204. <choose>
  1205. <when test='svType == "1"'>
  1206. and t.INTM &lt; (select trunc(sysdate,'yyyy') from dual )
  1207. </when>
  1208. <otherwise>
  1209. and t.INTM >= (select trunc(sysdate,'yyyy') from dual )
  1210. </otherwise>
  1211. </choose>
  1212. </if>
  1213. <if test="province !=null and province !=''">
  1214. and t.ad_code like '${province}%'
  1215. </if>
  1216. ) w where 1=1
  1217. <if test="nm != null and nm != ''">
  1218. and nm like '%${nm}%'
  1219. </if>
  1220. <if test="adCode != null and adCode != ''">and ${adCode}</if>
  1221. <if test="isSupn != null and isSupn != ''">and state = #{isSupn}</if>
  1222. <if test="isBack != null and isBack != ''">
  1223. <choose>
  1224. <when test='isBack == "1"'>
  1225. and (to_char(INTM,'yyyy') <![CDATA[ < ]]> to_char(sysdate,'yyyy') or INTM IS NULL)
  1226. </when>
  1227. <otherwise>
  1228. and to_char(INTM,'yyyy') = to_char(sysdate,'yyyy')
  1229. </otherwise>
  1230. </choose>
  1231. </if>
  1232. ORDER BY
  1233. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  1234. ad_code
  1235. </select>
  1236. <select id="getSupOtherListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.AttOtherBaseDto">
  1237. SELECT DISTINCT * from (
  1238. select T.id,
  1239. T.Code,
  1240. T.NAME,
  1241. T.NAME as nm,
  1242. T.TYPE,
  1243. T.ADM_ORG,
  1244. T.AD_CODE,
  1245. T.LOCATION,
  1246. T.CENTER_X,
  1247. T.CENTER_Y,
  1248. T.GD_X,
  1249. T.GD_Y,
  1250. T.PERS_ID,
  1251. T.INTM,
  1252. T.UPTM,B.OBJ_ID ,case when b.code is null then '' else '1' end state
  1253. from ATT_OTHER_BASE t LEFT JOIN BIS_INSP_ALL_OBJ B on T.id = B.Code
  1254. where t.id not in (select code from bis_insp_all_obj where id like concat(#{inspGroupId},'%'))
  1255. <if test="nm != null and nm != ''">AND T.name like '%${nm}%'</if>
  1256. <if test="type != null and type != ''">
  1257. And t.type = #{type}
  1258. </if>
  1259. <if test="province !=null and province !=''">
  1260. and t.ad_code like '${province}%'
  1261. </if>
  1262. ) WHERE 1 = 1
  1263. <if test="adCode != null and adCode != ''">and ${adCode}</if>
  1264. ORDER BY
  1265. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  1266. ad_code
  1267. </select>
  1268. <select id="getSupSdListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.model.AttSdBase">
  1269. SELECT DISTINCT * from (
  1270. select
  1271. T.SD_CODE as id,
  1272. T.SD_CODE as code,
  1273. T.SD_CODE,
  1274. T.SD_NAME,
  1275. T.SD_NAME AS name,
  1276. T.SD_NAME AS nm,
  1277. T.SD_TYPE,
  1278. T.SD_TYPE_STR,
  1279. T.CON_AREA,
  1280. T.TOT_CAP,
  1281. T.SDR_CAP,
  1282. T.FLCO_YEAR,
  1283. T.WARP_CAP,
  1284. T.DAM_SIZE_HIG,
  1285. T.DAM_TOP_LEN,
  1286. T.AD_CODE,
  1287. T.SD_LOC,
  1288. T.CENTER_X,
  1289. T.CENTER_Y,
  1290. T.GD_X,
  1291. T.GD_Y,
  1292. T.ASINTTDS,
  1293. T.NO_SPWAY,
  1294. T.DAM_TEAR,
  1295. T.DAM_LAND_SUB_SIDE,
  1296. T.DAM_RSOG,
  1297. T.DAM_LOPC,
  1298. T.DS_LTS,
  1299. T.DS_CC,
  1300. T.DS_OC,
  1301. T.FRS_MAR,
  1302. T.FRS_TBD,
  1303. T.FRS_OTH,
  1304. T.NOTE,
  1305. T.IN_TM,
  1306. T.UP_TM,B.OBJ_ID ,case when b.code is null then '' else '1' end state
  1307. from ATT_SD_BASE t LEFT JOIN BIS_INSP_ALL_OBJ B on T.sd_code = B.Code
  1308. where t.sd_code not in (select code from bis_insp_all_obj where id like concat(#{inspGroupId},'%'))
  1309. <if test="nm != null and nm != ''">AND T.SD_NAME like '%${nm}%'</if>
  1310. <if test="province !=null and province !=''">
  1311. and t.ad_code like '${province}%'
  1312. </if>
  1313. ) WHERE 1 = 1
  1314. <if test="adCode != null and adCode != ''">and ${adCode}</if>
  1315. ORDER BY
  1316. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  1317. ad_code
  1318. </select>
  1319. <select id="getSupSwhsListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.model.AttSwhsBase">
  1320. SELECT DISTINCT * FROM (
  1321. SELECT T.ID,
  1322. T.ID as code,
  1323. T.SWHS_CODE,
  1324. T.SWHS_NAME,
  1325. T.SWHS_NAME AS nm,
  1326. T.SWHS_NAME AS name,
  1327. T.SWHS_LONG,
  1328. T.SWHS_LAT,
  1329. T.AD_CODE,
  1330. T.SWHS_LOC,
  1331. T.WAIN_WASO_TYPE,
  1332. T.WAT_AREA,
  1333. T.WAIN_NUM,
  1334. T.WAIN_USE,
  1335. T.WASU_OBJ_TYPE,
  1336. T.WASU_TOWN_NAME,
  1337. T.WASU_TOWN_NAME_2,
  1338. T.WASU_TOWN_NAME_3,
  1339. T.DES_ANN_WAIN,
  1340. T.DES_ANN_WASU_POP,
  1341. T.RUN_YEAR,
  1342. T.WINT_RV_NAME,
  1343. T.WINT_LAKE_NAME,
  1344. T.WINT_RS_NAME,
  1345. T.WAQU_GOAL,
  1346. T.IF_MON_WQUA,
  1347. T.WQUA_CAT,
  1348. T.IF_WQUA_UPTO_STA,
  1349. T.IF_WS_PROT,
  1350. T.WAT_AREA_1ST_PROT,
  1351. T.LAND_AREA_1ST_PROT,
  1352. T.WAT_AREA_2ND_PROT,
  1353. T.LAND_AREA_2ND_PROT,
  1354. T.QUS_PROT,
  1355. T.INS_NAME,
  1356. T.TRA,
  1357. T.PERS_ID,
  1358. T.NOTE,
  1359. T.EFF_DATE,
  1360. T.EXPR_DATE,
  1361. T.SWHS_LONG_GD,
  1362. T.SWHS_LAT_GD,
  1363. T.DISPLAY_LEVEL,
  1364. B.OBJ_ID,CASE WHEN B.CODE IS NULL then '' else '1' end state
  1365. FROM ATT_SWHS_BASE T LEFT JOIN BIS_INSP_ALL_OBJ B ON T.ID = B.CODE
  1366. WHERE T.ID NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  1367. <if test="province !=null and province !=''">
  1368. and t.ad_code like '${province}%'
  1369. </if>
  1370. ) WHERE 1 = 1
  1371. <if test="nm != null and nm != ''">
  1372. and nm like '%${nm}%'
  1373. </if>
  1374. <if test="note != null and note != ''">
  1375. and NOTE = ${note}
  1376. </if>
  1377. <if test="adCode != null and adCode != ''">and ${adCode}</if>
  1378. ORDER BY
  1379. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  1380. ad_code
  1381. </select>
  1382. <select id="getSupWiuListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.model.AttWiuBase"
  1383. parameterType="cn.com.goldenwater.dcproj.param.InspObjParam">
  1384. SELECT DISTINCT * from (
  1385. SELECT T.ID, T.ID AS CODE,
  1386. T.WIU_CODE,
  1387. T.WIU_NAME,
  1388. T.WIU_NAME AS NM,
  1389. T.WIU_NAME AS NAME,
  1390. T.WINT_CODE,
  1391. T.IDT_TYPE,
  1392. T.NAME AS USER_NM,
  1393. T.WIU_NAT,
  1394. T.WIU_NAT_NAME,
  1395. T.CODE_TYPE,
  1396. T.CODE_VAL,
  1397. T.WIU_CONTACT,
  1398. T.WIU_CONTACT_TEL,
  1399. T.IN_TM,
  1400. T.UP_TM,
  1401. T.AD_CODE,
  1402. T.AD_NAME,
  1403. CASE WHEN B.state IS NULL then '' else '1' end state,
  1404. w.WINT_NAME,w.WINT_POS
  1405. FROM ATT_WIU_BASE T
  1406. LEFT JOIN ATT_WINT_BASE_B w ON t.WINT_CODE = w.ID
  1407. LEFT JOIN (
  1408. SELECT a.ID, '1' as state
  1409. FROM ATT_WIU_BASE a
  1410. WHERE Exists (select code FROM BIS_INSP_ALL_OBJ o where o.code = a.ID and o.ptype = #{objType})
  1411. ) B ON T.ID = B.ID
  1412. WHERE T.ID NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  1413. <if test="province !=null and province !=''">
  1414. and t.ad_code like '${province}%'
  1415. </if>
  1416. )
  1417. <where>
  1418. <if test="nm != null and nm != ''">and nm like '%${nm}%'</if>
  1419. <if test="adCode != null and adCode != ''">and ${adCode}</if>
  1420. </where>
  1421. ORDER BY
  1422. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  1423. ad_code
  1424. </select>
  1425. <select id="getAdXBaseListNotInspGroupId" parameterType="cn.com.goldenwater.dcproj.param.InspObjParam"
  1426. resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  1427. select distinct * from (
  1428. select
  1429. t.ad_code as id, t.ad_code as code,t.ad_name as nm,t.ad_name as name,
  1430. t.ad_full_name, t.ad_full_name as location,
  1431. t.lgtd as gdX,t.lttd as gdY,t.ad_long as pcX,t.ad_lat as pcY,
  1432. t.ad_code, t.AD_GRAD, NVL(B.state, '0') state
  1433. FROM ATT_AD_X_BASE T
  1434. LEFT JOIN (
  1435. SELECT a.AD_CODE, '1' as state
  1436. FROM ATT_AD_X_BASE a
  1437. WHERE Exists (select code FROM BIS_INSP_ALL_OBJ o where o.code = a.AD_CODE and o.ptype = #{objType})
  1438. ) B ON T.AD_CODE = B.AD_CODE
  1439. WHERE
  1440. T.ad_code NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  1441. <if test="province !=null and province !=''">and t.ad_code like '${province}%'</if>
  1442. ) w
  1443. where w.AD_GRAD IN (${adGrad})
  1444. <if test="nm != null and nm != ''">and nm like '%${nm}%'</if>
  1445. <if test="adCode != null and adCode != ''">and ${adCode}</if>
  1446. ORDER BY
  1447. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  1448. ad_code
  1449. </select>
  1450. <select id="getAdBaseListNotInspGroupId" parameterType="cn.com.goldenwater.dcproj.param.InspObjParam"
  1451. resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  1452. select distinct *
  1453. from (
  1454. select
  1455. t.ad_code as id, t.ad_name as nm, t.ad_code as code, t.ad_name as name, t.ad_full_name as location,
  1456. t.lgtd as gdX, t.lttd as gdY, t.ad_code, t.AD_GRAD,
  1457. t.ad_long as pcX,t.ad_lat as pcY,
  1458. B.OBJ_ID, CASE WHEN B.CODE IS NULL then '' else '1' end state
  1459. FROM ATT_AD_X_BASE T
  1460. LEFT JOIN
  1461. (select * FROM BIS_INSP_ALL_OBJ o where o.ptype = #{objType}) B ON T.AD_CODE = B.CODE
  1462. WHERE
  1463. T.ad_code NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  1464. <if test="province !=null and province !=''">
  1465. and t.ad_code like '${province}%'
  1466. </if>
  1467. ) w where w.AD_GRAD = '3'
  1468. <if test="nm != null and nm != ''">
  1469. and nm like '%${nm}%'
  1470. </if>
  1471. <if test="adCode != null and adCode != ''">and ${adCode}</if>
  1472. ORDER BY
  1473. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  1474. ad_code
  1475. </select>
  1476. <select id="getWuntListNotInspGroupId" parameterType="cn.com.goldenwater.dcproj.param.InspObjParam"
  1477. resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  1478. select distinct * from (
  1479. select t.id as id,t.UT_NAME as nm,t.id as code,t.UT_NAME as name,t.UT_ADDR as location,t.pc_x as gdX,t.pc_Y as
  1480. gdY,t.ad_code,t.UT_TYPE as
  1481. type,t.TRD_TYPE,t.UT_TYPE,t.UT_PPT,
  1482. t.GD_X as pcX,t.GD_Y as pcY,
  1483. B.OBJ_ID,CASE WHEN B.CODE IS NULL then '' else '1' end state
  1484. FROM ATT_WUNT_BASE T LEFT JOIN (select * FROM BIS_INSP_ALL_OBJ o where o.ptype = #{objType}) B ON T.AD_CODE =
  1485. B.CODE
  1486. WHERE T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  1487. <if test="province !=null and province !=''">
  1488. and t.ad_code like '${province}%'
  1489. </if>
  1490. ) w where 1=1
  1491. <if test="nm != null and nm != ''">
  1492. and nm like '%${nm}%'
  1493. </if>
  1494. <if test="adCode != null and adCode != ''">and ${adCode}</if>
  1495. ORDER BY
  1496. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  1497. ad_code
  1498. </select>
  1499. <!--获取不在督查组中的对象-->
  1500. <select id="getNotSuperviseGroupObj" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  1501. select distinct * from (
  1502. select
  1503. t.id as id,
  1504. t.id as code,
  1505. t.ad_code,
  1506. t.AD_FULL_NAME AS adName,
  1507. t.DEPART_NM AS nm,
  1508. t.DEPART_NM AS name,
  1509. B.OBJ_ID,
  1510. CASE WHEN B.CODE IS NULL then '' else '1' end state
  1511. FROM
  1512. ATT_ZHEJIANG_JG_BASE T
  1513. LEFT JOIN
  1514. (
  1515. select * FROM BIS_INSP_ALL_OBJ o where o.ptype = #{objType}
  1516. ) B ON T.AD_CODE = B.CODE
  1517. WHERE
  1518. T.id NOT IN
  1519. (
  1520. SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%')
  1521. )
  1522. <if test="province !=null and province !=''">
  1523. and t.ad_code like '${province}%'
  1524. </if>
  1525. ) w where 1=1
  1526. <if test="nm != null and nm != ''">
  1527. and nm like '%${nm}%'
  1528. </if>
  1529. <if test="adCode != null and adCode != ''">and ${adCode}</if>
  1530. ORDER BY
  1531. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  1532. ad_code
  1533. </select>
  1534. <select id="getRsBaseListNotInspGroupId" parameterType="cn.com.goldenwater.dcproj.param.InspObjParam"
  1535. resultType="cn.com.goldenwater.dcproj.model.AttRsBase">
  1536. select DISTINCT * from (
  1537. select T.RS_CODE as code,t.RS_NAME as nm,t.*,B.OBJ_ID,CASE WHEN B.CODE IS NULL then '' else '1' end state from
  1538. ATT_RS_BASE t left join
  1539. (select * FROM BIS_INSP_ALL_OBJ o where o.ptype = '26') B ON T.rs_code =B.CODE
  1540. WHERE T.RS_CODE NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  1541. and t.ENG_SCAL in ('1','2','3')
  1542. <if test="nm != null and nm != ''">
  1543. and t.RS_NAME like '%${nm}%'
  1544. </if>
  1545. <if test="engScal != null and engScal != ''">
  1546. and t.ENG_SCAL = #{engScal}
  1547. </if>
  1548. ) w where 1=1
  1549. <if test="province != null and province != ''">and w.adm_div like '${province}%'</if>
  1550. <if test="adCode != null and adCode != ''">and ${adCode}</if>
  1551. ORDER BY
  1552. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  1553. ADM_DIV
  1554. </select>
  1555. <select id="getSapBaseListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.model.BisInspWagaSapRgstr">
  1556. select distinct * from (
  1557. SELECT
  1558. t.id AS id,
  1559. t.id AS code,
  1560. t.SAP_NAME AS nm,
  1561. t.AD_NAME as adName,
  1562. t.SAP_NAME AS sapName,
  1563. t.ad_code,
  1564. B.OBJ_ID,CASE WHEN B.CODE IS NULL then '' else '1' end state
  1565. FROM ATT_WAGA_SAP_BASE T
  1566. LEFT JOIN (select * FROM BIS_INSP_ALL_OBJ o where o.ptype = #{objType}) B ON T.id = B.CODE
  1567. WHERE T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  1568. ) w where 1=1
  1569. <if test="nm != null and nm != ''">
  1570. and sapName like '%${nm}%'
  1571. </if>
  1572. <if test="province != null and province != ''">and w.ad_code like '${province}%'</if>
  1573. <if test="adCode != null and adCode != ''">and ${adCode}</if>
  1574. ORDER BY
  1575. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  1576. ad_code
  1577. </select>
  1578. <select id="getEfpBaseListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  1579. select distinct * from (
  1580. SELECT
  1581. t.id AS id,
  1582. t.id as code,
  1583. t.Name as nm,
  1584. t.Name as name,
  1585. NVL(B.state, 0) as state,
  1586. t.type,
  1587. t.PRO,
  1588. t.BAS,
  1589. t.ORG_ID,
  1590. t.ORD
  1591. FROM ATT_EFP_BASE T
  1592. LEFT JOIN (
  1593. SELECT a.ID, '1' as state
  1594. FROM ATT_EFP_BASE a
  1595. WHERE Exists (select code FROM BIS_INSP_ALL_OBJ o where o.code = a.id and o.ptype = #{objType})
  1596. ) B ON T.ID = B.ID
  1597. WHERE T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  1598. ) w
  1599. <where>
  1600. <if test="nm != null and nm != ''">
  1601. and NM like '%${nm}%'
  1602. </if>
  1603. <if test="type != null and type != ''">
  1604. and type = #{type}
  1605. </if>
  1606. </where>
  1607. </select>
  1608. <!-- <if test="orgId !=null and orgId !=''">-->
  1609. <!-- and ORG_ID like '${orgId}%'-->
  1610. <!-- </if>-->
  1611. <select id="getWintuBaseListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.model.BisInspWintRgstr">
  1612. select distinct * from (
  1613. SELECT
  1614. t.id AS id,
  1615. t.id as code,
  1616. t.WINT_NAME as nm,
  1617. t.WINT_NAME as name,
  1618. NVL(B.state, 0) as state,
  1619. t.WAIN_TYPE wainIntType,
  1620. t.AD_CODE,
  1621. t.AD_NAME adName,
  1622. t.AD_NAME loc,
  1623. t.WIU_NAME bChkUnit,
  1624. t.WIU_CONTACT contact,
  1625. t.WIU_CONTACT_TEL contactTel,
  1626. t.WIU_PRINCIPAL principal,
  1627. t.WIU_PRINCIPAL_TEL principalTel
  1628. FROM ATT_WINT_BASE T
  1629. LEFT JOIN (
  1630. SELECT a.ID, '1' as state
  1631. FROM ATT_WINT_BASE a
  1632. WHERE Exists (select code FROM BIS_INSP_ALL_OBJ o where o.code = a.id and o.ptype = #{objType})
  1633. ) B ON T.ID = B.ID
  1634. WHERE T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  1635. ) w
  1636. where
  1637. 1=1
  1638. <if test="province !=null and province !=''">
  1639. and AD_CODE like '${province}%'
  1640. </if>
  1641. <if test="nm != null and nm != ''">
  1642. and NM like '%${nm}%'
  1643. </if>
  1644. <if test="type != null and type != ''">
  1645. and type = #{type}
  1646. </if>
  1647. <if test="adCode != null and adCode != ''">and ${adCode}</if>
  1648. </select>
  1649. <select id="getWuntuBaseListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.model.BisInspSvwtWuntRgstr">
  1650. select distinct * from (
  1651. SELECT
  1652. t.id AS id,
  1653. t.WINT_CODE as code,
  1654. t.WINT_NAME as nm,
  1655. t.WINT_NAME as name,
  1656. t.WAIN_TYPE wainIntType,
  1657. t.AD_CODE,
  1658. t.AD_NAME adName,
  1659. t.AD_NAME loc,
  1660. t.WIU_NAME bChkUnit,
  1661. t.WIU_CONTACT contact,
  1662. t.WIU_CONTACT_TEL contactTel,
  1663. t.WIU_PRINCIPAL principal,
  1664. t.WIU_PRINCIPAL_TEL principalTel,
  1665. B.OBJ_ID,CASE WHEN B.CODE IS NULL then '' else '1' end state
  1666. FROM ATT_WINT_BASE T
  1667. LEFT JOIN (select * FROM BIS_INSP_ALL_OBJ o where o.ptype = #{objType}) B ON T.id = B.CODE
  1668. WHERE T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  1669. ) w
  1670. where
  1671. 1=1
  1672. <if test="province !=null and province !=''">
  1673. and AD_CODE like '${province}%'
  1674. </if>
  1675. <if test="nm != null and nm != ''">
  1676. and NM like '%${nm}%'
  1677. </if>
  1678. <if test="type != null and type != ''">
  1679. and type = #{type}
  1680. </if>
  1681. <if test="adCode != null and adCode != ''">and ${adCode}</if>
  1682. </select>
  1683. <select id="getWtuntBaseListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  1684. select distinct * from (
  1685. SELECT
  1686. t.id AS id, t.id as code,
  1687. t.UT_NAME as nm,
  1688. t.ad_code, t.ad_name as adName,T.PRINCIPAL_TEL, T.NOTE,
  1689. B.OBJ_ID,CASE WHEN B.CODE IS NULL then '' else '1' end state,AD.AD_GRAD,
  1690. T.UT_TYPE type
  1691. FROM ATT_WTUNT_BASE T
  1692. LEFT JOIN (select * FROM BIS_INSP_ALL_OBJ o where o.ptype = #{objType}) B ON T.id = B.CODE
  1693. LEFT JOIN ATT_AD_BASE AD ON t.AD_CODE = AD.AD_CODE
  1694. WHERE
  1695. T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  1696. ) w
  1697. where 1=1
  1698. <if test="province !=null and province !=''">and ad_code like '${province}%'</if>
  1699. <if test="nm != null and nm != ''">and NM like '%${nm}%'</if>
  1700. <if test="adCode != null and adCode != ''">and ${adCode}</if>
  1701. <if test="type != null and type != ''">AND TYPE = #{type}</if>
  1702. <if test="adGrad != null and adGrad != ''">and AD_GRAD = #{adGrad}</if>
  1703. </select>
  1704. <select id="getWtgtBaseListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  1705. select distinct * from (
  1706. SELECT
  1707. B.OBJ_ID,CASE WHEN B.CODE IS NULL then '' else '1' end state, AD.AD_GRAD,
  1708. t.id AS id,
  1709. t.id as code,
  1710. t.DEP_NAME as nm,
  1711. t.AD_CODE, t.AD_NAME,
  1712. T.WINT_CODE,
  1713. T.DEP_PERS,
  1714. T.DEP_PERS_TEL,T.PRINCIPAL_TEL, T.NOTE,
  1715. T.LOC location
  1716. FROM ATT_WTGT_BASE T
  1717. LEFT JOIN (select * FROM BIS_INSP_ALL_OBJ o where o.ptype = #{objType}) B ON T.id = B.CODE
  1718. LEFT JOIN ATT_AD_BASE AD ON t.AD_CODE = AD.AD_CODE
  1719. WHERE T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  1720. ) w
  1721. <where>
  1722. <if test="province !=null and province !=''">
  1723. and ad_code like '${province}%'
  1724. </if>
  1725. <if test="nm != null and nm != ''">
  1726. and NM like '%${nm}%'
  1727. </if>
  1728. <if test="adCode != null and adCode != ''">and ${adCode}</if>
  1729. <if test="adGrad != null and adGrad != ''">and AD_GRAD = #{adGrad}</if>
  1730. </where>
  1731. </select>
  1732. <select id="getAdBaseMunicipalLevelListNotInspGroupIds" parameterType="cn.com.goldenwater.dcproj.param.InspObjParam"
  1733. resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  1734. select distinct *
  1735. from (
  1736. select
  1737. t.ad_code as id, t.ad_code as code, t.ad_name as nm, t.ad_full_name as location,
  1738. t.lgtd as gdX, t.lttd as gdY, t.ad_code, t.AD_GRAD,
  1739. t.ad_long as pcX,t.ad_lat as pcY
  1740. FROM ATT_AD_BASE T
  1741. LEFT JOIN
  1742. (select * FROM BIS_INSP_ALL_OBJ o where o.ptype = #{objType}) B ON T.AD_CODE = B.CODE
  1743. WHERE
  1744. T.ad_code NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  1745. <if test="province !=null and province !=''">
  1746. and t.ad_code like '${province}%'
  1747. </if>
  1748. ) w where w.AD_GRAD = '3'
  1749. <if test="nm != null and nm != ''">
  1750. and nm like '%${nm}%'
  1751. </if>
  1752. <if test="adCode != null and adCode != ''">and ${adCode}</if>
  1753. ORDER BY
  1754. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  1755. ad_code
  1756. </select>
  1757. <select id="getAdBaseCountyLevelListNotInspGroupIds" parameterType="cn.com.goldenwater.dcproj.param.InspObjParam"
  1758. resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  1759. select distinct *
  1760. from (
  1761. select
  1762. t.ad_code as id, t.ad_code as code, t.ad_name as nm, t.ad_full_name as location,
  1763. t.lgtd as gdX, t.lttd as gdY, t.ad_code, t.AD_GRAD,
  1764. t.ad_long as pcX,t.ad_lat as pcY
  1765. FROM ATT_AD_BASE T
  1766. LEFT JOIN
  1767. (select * FROM BIS_INSP_ALL_OBJ o where o.ptype = #{objType}) B ON T.AD_CODE = B.CODE
  1768. WHERE
  1769. T.ad_code NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  1770. <if test="province !=null and province !=''">
  1771. and t.ad_code like '${province}%'
  1772. </if>
  1773. ) w
  1774. where w.AD_GRAD = '4'
  1775. <if test="nm != null and nm != ''">
  1776. and nm like '%${nm}%'
  1777. </if>
  1778. <if test="adCode != null and adCode != ''">and ${adCode}</if>
  1779. ORDER BY
  1780. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  1781. ad_code
  1782. </select>
  1783. <select id="getRsListNotInGroup" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  1784. select distinct * from (
  1785. select t.rs_code as id,T.Rs_Code as code,t.rs_name as nm,
  1786. t.ENG_SCAL,t.build_stat,t.location,t.adm_div as
  1787. ad_code,t.adm_div_name as ad_name
  1788. ,B.OBJ_ID,
  1789. CASE WHEN B.CODE IS NULL then '' else '1' end state
  1790. from ATT_RS_BASE t
  1791. LEFT JOIN (select * FROM BIS_INSP_ALL_OBJ o where o.ptype = #{objType}) B ON T.RS_CODE = B.CODE
  1792. WHERE t.rs_code NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  1793. and t.build_stat in ('2','3')
  1794. ) w where 1=1
  1795. <if test="province !=null and province !=''">
  1796. and AD_CODE like '${province}%'
  1797. </if>
  1798. <if test="nm != null and nm != ''">
  1799. and NM like '%${nm}%'
  1800. </if>
  1801. <if test="adCode != null and adCode != ''">and ${adCode}</if>
  1802. <if test="engScal != null and engScal != ''"></if>
  1803. ORDER BY
  1804. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  1805. ad_code
  1806. </select>
  1807. <select id="getSamListNotInGroup" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  1808. select distinct * from (
  1809. select T.id,T.id as code,t.prj_name as nm,t.ad_code,t.ad_name,t.addr as location
  1810. ,B.OBJ_ID,CASE WHEN B.CODE IS NULL then '' else '1' end state
  1811. from ATT_SAMRMP_BASE T
  1812. LEFT JOIN (select * FROM BIS_INSP_ALL_OBJ o where o.ptype = #{objType}) B ON T.ID = B.CODE
  1813. WHERE t.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  1814. ) w where 1=1
  1815. <if test="province !=null and province !=''">
  1816. and AD_CODE like '${province}%'
  1817. </if>
  1818. <if test="nm != null and nm != ''">
  1819. and NM like '%${nm}%'
  1820. </if>
  1821. <if test="adCode != null and adCode != ''">and ${adCode}</if>
  1822. ORDER BY
  1823. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  1824. ad_code
  1825. </select>
  1826. <select id="getSupCdepListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  1827. select distinct * from (
  1828. SELECT
  1829. t.id AS id,
  1830. t.id AS code,
  1831. t.DEP_CODE as depCode,
  1832. t.DEP_NAME as nm,
  1833. t.AD_CODE as AD_CODE,
  1834. t.AD_NAME as adName,
  1835. t.LOC as location,
  1836. t.PRINCIPAL principal,
  1837. t.CONTACT as depPers,
  1838. B.OBJ_ID,CASE WHEN B.CODE IS NULL then '' else '1' end state
  1839. FROM ATT_CDEP_BASE T
  1840. LEFT JOIN (select * FROM BIS_INSP_ALL_OBJ o where o.ptype = #{objType}) B ON T.id = B.CODE
  1841. WHERE T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  1842. ) w
  1843. where
  1844. 1=1
  1845. <if test="province !=null and province !=''">
  1846. and AD_CODE like '${province}%'
  1847. </if>
  1848. <if test="nm != null and nm != ''">
  1849. and nm like '%${nm}%'
  1850. </if>
  1851. <if test="adCode != null and adCode != ''">and ${adCode}</if>
  1852. ORDER BY
  1853. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  1854. ad_code
  1855. </select>
  1856. <select id="getSupBidListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  1857. select distinct * from (
  1858. SELECT
  1859. t.id AS id,
  1860. t.id AS code,
  1861. t.BID_CODE as bidCode,
  1862. t.BID_NAME as nm,
  1863. t.AD_CODE as AD_CODE,
  1864. t.AD_NAME as adName,
  1865. t.LOC as location,
  1866. t.LEGAL_PERS as legalPers,
  1867. t.CONTACT as depPers,
  1868. B.OBJ_ID,CASE WHEN B.CODE IS NULL then '' else '1' end state
  1869. FROM ATT_BID_BASE T
  1870. LEFT JOIN (select * FROM BIS_INSP_ALL_OBJ o where o.ptype = #{objType}) B ON T.id = B.CODE
  1871. WHERE T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  1872. ) w
  1873. where
  1874. 1=1
  1875. <if test="province !=null and province !=''">
  1876. and AD_CODE like '${province}%'
  1877. </if>
  1878. <if test="nm != null and nm != ''">
  1879. and nm like '%' || #{nm} || '%'
  1880. </if>
  1881. <if test="adCode != null and adCode != ''">and ${adCode}</if>
  1882. ORDER BY
  1883. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  1884. ad_code
  1885. </select>
  1886. <select id="getSupRlrwListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  1887. select distinct * from (
  1888. SELECT
  1889. t.LAND_CODE AS id,
  1890. t.LAND_CODE AS code,
  1891. t.LAND_NAME as nm,
  1892. t.AD_CODE as AD_CODE,
  1893. t.AD_NAME as adName,
  1894. t.CONTACT as depPers,
  1895. B.OBJ_ID,CASE WHEN B.CODE IS NULL then '' else '1' end state
  1896. FROM ATT_RLRW_BASE T
  1897. LEFT JOIN (select * FROM BIS_INSP_ALL_OBJ o where o.ptype = #{objType}) B ON T.LAND_CODE = B.CODE
  1898. WHERE T.LAND_CODE NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  1899. ) w
  1900. where
  1901. 1=1
  1902. <if test="province !=null and province !=''">
  1903. and AD_CODE like '${province}%'
  1904. </if>
  1905. <if test="nm != null and nm != ''">
  1906. and nm like '%${depName}%'
  1907. </if>
  1908. <if test="adCode != null and adCode != ''">and ${adCode}</if>
  1909. ORDER BY
  1910. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  1911. ad_code
  1912. </select>
  1913. <select id="getSupDrdmpListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  1914. select distinct * from (
  1915. SELECT
  1916. t.id AS code,
  1917. t.DEP_NAME as nm,
  1918. t.LOC as location,
  1919. nvl(B.state, 0) as state,
  1920. t.DEP_NAME,
  1921. t.AD_CODE,
  1922. t.AD_NAME,
  1923. t.WINT_CODE,
  1924. t.LOC
  1925. FROM ATT_DEP_BASE T
  1926. LEFT JOIN (
  1927. SELECT a.ID, '1' as state FROM ATT_DEP_BASE a
  1928. WHERE Exists (select code FROM BIS_INSP_ALL_OBJ o where o.code = a.id and o.ptype = #{objType})
  1929. ) B ON T.ID = B.ID
  1930. WHERE T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  1931. ) w
  1932. <where>
  1933. <if test="province !=null and province !=''">
  1934. and AD_CODE like '${province}%'
  1935. </if>
  1936. <if test="nm != null and nm != ''">
  1937. and nm like '%' || #{nm} || '%'
  1938. </if>
  1939. <if test="adCode != null and adCode != ''">
  1940. and ${adCode}
  1941. </if>
  1942. </where>
  1943. ORDER BY
  1944. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  1945. ad_code
  1946. </select>
  1947. <select id="getSupGrowListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  1948. select distinct * from (
  1949. SELECT
  1950. t.id AS id,
  1951. NVL(B.state, 0) as state,
  1952. t.id AS code,
  1953. t.WELL_NAME AS nm,
  1954. t.AD_CODE as AD_CODE,
  1955. t.AD_NAME as adName,
  1956. t.CONTACT as depPers,
  1957. t.well_type as type
  1958. FROM ATT_GROW_BASE T
  1959. LEFT JOIN (
  1960. SELECT a.ID, '1' as state
  1961. FROM ATT_GROW_BASE a
  1962. WHERE Exists (select code FROM BIS_INSP_ALL_OBJ o where o.code = a.id and o.ptype = #{objType})
  1963. ) B ON T.ID = B.ID
  1964. WHERE T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  1965. ) w
  1966. where
  1967. 1=1
  1968. <if test="province !=null and province !=''">
  1969. and AD_CODE like '${province}%'
  1970. </if>
  1971. <if test="nm != null and nm != ''">
  1972. and nm like '%${nm}%'
  1973. </if>
  1974. <if test="type != null and type != ''">
  1975. and w.type = #{type}
  1976. </if>
  1977. <if test="adCode != null and adCode != ''">and ${adCode}</if>
  1978. ORDER BY
  1979. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  1980. ad_code
  1981. </select>
  1982. <select id="getSupFundListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  1983. select distinct * from (
  1984. SELECT
  1985. t.id AS id,
  1986. NVL(B.state, 0) as state,
  1987. t.id AS code,
  1988. t.Proj_Name AS nm,
  1989. t.AD_CODE as AD_CODE,
  1990. t.AD_NAME as adName,
  1991. t.plan_funds as planFunds,
  1992. decode(t.Proj_Type,1,'中小河流治理',2,'新建小型水库',3,'中型灌区',4,'水土保持',5,'山洪灾害防治',6,'农村饮水工程维修养护',7,'小型水库维修养护',8,'山洪灾害防治设施维修养护项目',9,'农业水价综合改革',10,'大中型水库移民',11,'其他')
  1993. as type
  1994. FROM ATT_FUND_BASE T
  1995. LEFT JOIN (
  1996. SELECT a.ID, '1' as state
  1997. FROM ATT_FUND_BASE a
  1998. WHERE Exists (select code FROM BIS_INSP_ALL_OBJ o where o.code = a.id and o.ptype = #{objType})
  1999. ) B ON T.ID = B.ID
  2000. WHERE T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  2001. ) w
  2002. where
  2003. 1=1
  2004. <if test="province !=null and province !=''">
  2005. and AD_CODE like '${province}%'
  2006. </if>
  2007. <if test="nm != null and nm != ''">
  2008. and nm like '%${nm}%'
  2009. </if>
  2010. <if test="type != null and type != ''">
  2011. and w.type = #{type}
  2012. </if>
  2013. <if test="adCode != null and adCode != ''">and ${adCode}</if>
  2014. ORDER BY
  2015. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  2016. ad_code
  2017. </select>
  2018. <select id="getSupWiuqhListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  2019. select distinct * from (
  2020. SELECT
  2021. t.id AS code,
  2022. t.NM,
  2023. t.LOC as location,
  2024. NVL(B.state, 0) as state,
  2025. t.AD_CODE, t.AD_NAME, t.APP_NO, t.WT_APP_NO,
  2026. t.APP_DEP, t.WT_TYPE, t.WT_MSR, t.WT_TM,
  2027. t.WT_SUR, t.WT_USR, t.DEP_PERS, t.PERS_PHONE,
  2028. t.DEP_CNT_PERS, t.DEP_CNT_PERS_PHONE, t.NOTE,
  2029. t.CENTER_X, t.CENTER_Y,
  2030. t.GD_X, t.GD_Y, t.INTM, t.UPTM, t.DATA_STAT
  2031. FROM ATT_WIUQH_BASE T
  2032. LEFT JOIN (
  2033. SELECT a.ID, '1' as state
  2034. FROM ATT_WIUQH_BASE a
  2035. WHERE Exists (select code FROM BIS_INSP_ALL_OBJ o where o.code = a.id and o.ptype = #{objType})
  2036. ) B ON T.ID = B.ID
  2037. WHERE
  2038. T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  2039. ) w
  2040. <where>
  2041. <if test="province !=null and province !=''">
  2042. and AD_CODE like '${province}%'
  2043. </if>
  2044. <if test="nm != null and nm != ''">
  2045. and nm like '%' || #{nm} || '%'
  2046. </if>
  2047. <if test="adCode != null and adCode != ''">
  2048. and ${adCode}
  2049. </if>
  2050. </where>
  2051. ORDER BY
  2052. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  2053. ad_code
  2054. </select>
  2055. <select id="getSafetyListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  2056. select distinct * from (
  2057. SELECT
  2058. t.id,
  2059. t.id AS code,
  2060. t.NAME AS NM,
  2061. t.LOC as location,
  2062. NVL(B.state, 0) as state,
  2063. t.NAME,
  2064. t.MG_PERS,
  2065. t.MG_PERS_TEL,
  2066. t.AD_CODE,
  2067. t.AD_NAME,
  2068. t.LOC,
  2069. t.NOTE,
  2070. t.CENTER_X,
  2071. t.CENTER_Y,
  2072. t.GD_X,
  2073. t.GD_Y,
  2074. t.INTM,
  2075. t.UPTM,
  2076. t.DATA_STAT
  2077. FROM ATT_SAFETY_BASE T
  2078. LEFT JOIN (
  2079. SELECT a.ID, '1' as state
  2080. FROM ATT_SAFETY_BASE a
  2081. WHERE Exists (select code FROM BIS_INSP_ALL_OBJ o where o.code = a.id and o.ptype = #{objType})
  2082. ) B ON T.ID = B.ID
  2083. WHERE
  2084. T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  2085. ) w
  2086. <where>
  2087. <if test="province !=null and province !=''">
  2088. and AD_CODE like '${province}%'
  2089. </if>
  2090. <if test="nm != null and nm != ''">
  2091. and nm like '%' || #{nm} || '%'
  2092. </if>
  2093. <if test="adCode != null and adCode != ''">
  2094. and ${adCode}
  2095. </if>
  2096. </where>
  2097. ORDER BY
  2098. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  2099. ad_code
  2100. </select>
  2101. <select id="getYndepListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  2102. select distinct * from (
  2103. SELECT
  2104. t.id AS code,
  2105. t.AD_NAME AS NM,
  2106. t.LOC as location,
  2107. REPLACE(A.AD_FULL_NAME, '-', '') AS AD_FULL_NAME,
  2108. NVL(B.state, 0) as state,
  2109. t.DEP_NAME,
  2110. t.UT_LEAD,
  2111. t.PRINCIPAL_TEL,
  2112. t.DEP_PERS,
  2113. t.DEP_PERS_TEL,
  2114. t.AD_CODE,
  2115. t.AD_NAME,
  2116. t.LOC,
  2117. t.NOTE,
  2118. t.CENTER_X,
  2119. t.CENTER_Y,
  2120. t.GD_X,
  2121. t.GD_Y,
  2122. t.INTM,
  2123. t.UPTM,
  2124. t.DATA_STAT
  2125. FROM ATT_YNDEP_BASE T
  2126. LEFT JOIN ATT_AD_BASE A ON A.AD_CODE = T.AD_CODE
  2127. LEFT JOIN (
  2128. SELECT a.ID, '1' as state
  2129. FROM ATT_YNDEP_BASE a
  2130. WHERE Exists (select code FROM BIS_INSP_ALL_OBJ o where o.code = a.id and o.ptype = #{objType})
  2131. ) B ON T.ID = B.ID
  2132. WHERE
  2133. T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  2134. ) w
  2135. <where>
  2136. <if test="province !=null and province !=''">
  2137. and AD_CODE like '${province}%'
  2138. </if>
  2139. <if test="nm != null and nm != ''">
  2140. and nm like '%' || #{nm} || '%'
  2141. </if>
  2142. <if test="adCode != null and adCode != ''">
  2143. and ${adCode}
  2144. </if>
  2145. </where>
  2146. ORDER BY
  2147. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  2148. ad_code
  2149. </select>
  2150. <select id="getRvgmListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  2151. select distinct * from (
  2152. SELECT
  2153. t.id AS code,
  2154. t.DEP_NAME AS NM,
  2155. t.LOC as location,
  2156. A.AD_FULL_NAME,
  2157. NVL(B.state, 0) as state,
  2158. t.DEP_NAME,
  2159. t.UT_LEAD,
  2160. t.PRINCIPAL_TEL,
  2161. t.DEP_PERS,
  2162. t.DEP_PERS_TEL,
  2163. t.AD_CODE,
  2164. t.AD_NAME,
  2165. t.LOC,
  2166. t.NOTE,
  2167. t.CENTER_X,
  2168. t.CENTER_Y,
  2169. t.GD_X,
  2170. t.GD_Y,
  2171. t.INTM,
  2172. t.UPTM,
  2173. t.DATA_STAT
  2174. FROM ATT_RVGM_BASE T
  2175. LEFT JOIN ATT_AD_BASE A ON A.AD_CODE = T.AD_CODE
  2176. LEFT JOIN (
  2177. SELECT a.ID, '1' as state
  2178. FROM ATT_RVGM_BASE a
  2179. WHERE Exists (select code FROM BIS_INSP_ALL_OBJ o where o.code = a.id and o.ptype = #{objType})
  2180. ) B ON T.ID = B.ID
  2181. WHERE
  2182. T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  2183. ) w
  2184. <where>
  2185. <if test="province !=null and province !=''">
  2186. and AD_CODE like '${province}%'
  2187. </if>
  2188. <if test="nm != null and nm != ''">
  2189. and nm like '%' || #{nm} || '%'
  2190. </if>
  2191. <if test="adCode != null and adCode != ''">
  2192. and ${adCode}
  2193. </if>
  2194. </where>
  2195. ORDER BY
  2196. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  2197. ad_code
  2198. </select>
  2199. <select id="getDpgmListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  2200. SELECT DISTINCT * FROM (
  2201. SELECT
  2202. T.ID AS CODE,
  2203. T.NM,
  2204. T.LOC AS LOCATION,
  2205. A.AD_FULL_NAME,
  2206. NVL(B.STATE, 0) AS STATE,
  2207. T.ID,
  2208. T.RV_PERS,
  2209. T.GM_DUTIES,
  2210. T.RV_PERS_TEL,
  2211. T.PERS_ID,
  2212. T.AD_CODE,
  2213. T.AD_NAME,
  2214. T.LOC,
  2215. T.NOTE,
  2216. T.CENTER_X,
  2217. T.CENTER_Y,
  2218. T.GD_X,
  2219. T.GD_Y,
  2220. T.INTM,
  2221. T.UPTM,
  2222. T.DATA_STAT
  2223. FROM ATT_DPGM_BASE T
  2224. LEFT JOIN ATT_AD_BASE A ON A.AD_CODE = T.AD_CODE
  2225. LEFT JOIN (
  2226. SELECT a.ID, '1' as state
  2227. FROM ATT_DPGM_BASE a
  2228. WHERE Exists (select code FROM BIS_INSP_ALL_OBJ o where o.code = a.id and o.ptype = #{objType})
  2229. ) B ON T.ID = B.ID
  2230. WHERE
  2231. T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  2232. ) w
  2233. <where>
  2234. <if test="province !=null and province !=''">
  2235. and AD_CODE like '${province}%'
  2236. </if>
  2237. <if test="nm != null and nm != ''">
  2238. and nm like '%' || #{nm} || '%'
  2239. </if>
  2240. <if test="adCode != null and adCode != ''">
  2241. and ${adCode}
  2242. </if>
  2243. </where>
  2244. ORDER BY
  2245. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  2246. ad_code
  2247. </select>
  2248. <select id="getWtprjListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  2249. SELECT DISTINCT * FROM (
  2250. SELECT
  2251. T.ID AS CODE,
  2252. T.NM,
  2253. T.LOC AS LOCATION,
  2254. A.AD_FULL_NAME,
  2255. NVL(B.STATE, 0) AS STATE,
  2256. T.ID,
  2257. T.PRJ_TYPE,
  2258. T.PRJ_CTGY,
  2259. T.PRJ_RISK,
  2260. T.AD_CODE,
  2261. T.AD_NAME,
  2262. T.LOC,
  2263. T.NOTE,
  2264. T.CENTER_X,
  2265. T.CENTER_Y,
  2266. T.GD_X,
  2267. T.GD_Y,
  2268. T.INTM,
  2269. T.UPTM,
  2270. T.DATA_STAT
  2271. FROM ATT_WTPRJ_BASE T
  2272. LEFT JOIN ATT_AD_BASE A ON A.AD_CODE = T.AD_CODE
  2273. LEFT JOIN (
  2274. SELECT a.ID, '1' as state
  2275. FROM ATT_WTPRJ_BASE a
  2276. WHERE Exists (SELECT CODE FROM BIS_INSP_ALL_OBJ O WHERE O.CODE = A.ID AND O.PTYPE = #{objType})
  2277. ) B ON T.ID = B.ID
  2278. WHERE
  2279. T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  2280. ) w
  2281. <where>
  2282. <if test="province !=null and province !=''">
  2283. and AD_CODE like '${province}%'
  2284. </if>
  2285. <if test="nm != null and nm != ''">
  2286. and nm like '%' || #{nm} || '%'
  2287. </if>
  2288. <if test="adCode != null and adCode != ''">
  2289. and ${adCode}
  2290. </if>
  2291. </where>
  2292. ORDER BY
  2293. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  2294. ad_code
  2295. </select>
  2296. <select id="getUnwtListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  2297. SELECT DISTINCT * FROM (
  2298. SELECT
  2299. T.ID AS CODE,
  2300. T.NM,
  2301. T.LOC AS LOCATION,
  2302. A.AD_FULL_NAME,
  2303. NVL(B.STATE, 0) AS STATE,
  2304. T.ID,
  2305. T.AD_CODE,
  2306. T.AD_NAME,
  2307. T.LOC,
  2308. T.CENTER_X,
  2309. T.CENTER_Y,
  2310. T.GD_X,
  2311. T.GD_Y,
  2312. T.INTM,
  2313. T.UPTM,
  2314. T.DATA_STAT
  2315. FROM ATT_UNWT_BASE T
  2316. LEFT JOIN ATT_AD_BASE A ON A.AD_CODE = T.AD_CODE
  2317. LEFT JOIN (
  2318. SELECT a.ID, '1' as state
  2319. FROM ATT_UNWT_BASE a
  2320. WHERE Exists (SELECT CODE FROM BIS_INSP_ALL_OBJ O WHERE O.CODE = A.ID AND O.PTYPE = #{objType})
  2321. ) B ON T.ID = B.ID
  2322. WHERE
  2323. T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  2324. ) w
  2325. <where>
  2326. <if test="province !=null and province !=''">
  2327. and AD_CODE like '${province}%'
  2328. </if>
  2329. <if test="nm != null and nm != ''">
  2330. and nm like '%' || #{nm} || '%'
  2331. </if>
  2332. <if test="adCode != null and adCode != ''">
  2333. and ${adCode}
  2334. </if>
  2335. </where>
  2336. ORDER BY
  2337. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  2338. ad_code
  2339. </select>
  2340. <select id="getFloodqhListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  2341. SELECT DISTINCT * FROM (
  2342. SELECT
  2343. T.ID AS CODE,
  2344. T.LOC AS LOCATION,
  2345. A.AD_FULL_NAME,
  2346. NVL(B.STATE, 0) AS STATE,
  2347. T.ID,
  2348. T.NM,
  2349. T.FLOOD_TYPE,
  2350. T.AD_CODE,
  2351. T.AD_NAME,
  2352. T.LOC,
  2353. T.CENTER_X,
  2354. T.CENTER_Y,
  2355. T.GD_X,
  2356. T.GD_Y,
  2357. T.INTM,
  2358. T.UPTM,
  2359. T.DATA_STAT
  2360. FROM ATT_FLOODQH_BASE T
  2361. LEFT JOIN ATT_AD_BASE A ON A.AD_CODE = T.AD_CODE
  2362. LEFT JOIN (
  2363. SELECT a.ID, '1' as state
  2364. FROM ATT_FLOODQH_BASE a
  2365. WHERE Exists (SELECT CODE FROM BIS_INSP_ALL_OBJ O WHERE O.CODE = A.ID AND O.PTYPE = #{objType})
  2366. ) B ON T.ID = B.ID
  2367. WHERE
  2368. T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  2369. ) w
  2370. <where>
  2371. <if test="province !=null and province !=''">
  2372. and AD_CODE like '${province}%'
  2373. </if>
  2374. <if test="nm != null and nm != ''">
  2375. and nm like '%' || #{nm} || '%'
  2376. </if>
  2377. <if test="adCode != null and adCode != ''">
  2378. and ${adCode}
  2379. </if>
  2380. </where>
  2381. ORDER BY
  2382. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  2383. ad_code
  2384. </select>
  2385. <select id="getDstfldqhListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  2386. SELECT DISTINCT * FROM (
  2387. SELECT
  2388. T.ID AS CODE,
  2389. T.LOC AS LOCATION,
  2390. A.AD_FULL_NAME,
  2391. NVL(B.STATE, 0) AS STATE,
  2392. T.ID,
  2393. T.NM,
  2394. T.NM AS NAME,
  2395. T.PRJT_TYPE AS PRJ_TYPE,
  2396. T.AD_CODE,
  2397. T.AD_NAME,
  2398. T.LOC,
  2399. T.UNIT,
  2400. T.CONTENT,
  2401. T.NOTE,
  2402. T.CENTER_X,
  2403. T.CENTER_Y,
  2404. T.GD_X,
  2405. T.GD_Y,
  2406. T.INTM,
  2407. T.UPTM,
  2408. T.DATA_STAT
  2409. FROM ATT_DSTFLDQH_BASE T
  2410. LEFT JOIN ATT_AD_BASE A ON A.AD_CODE = T.AD_CODE
  2411. LEFT JOIN (
  2412. SELECT a.ID, '1' as state
  2413. FROM ATT_DSTFLDQH_BASE a
  2414. WHERE Exists (SELECT CODE FROM BIS_INSP_ALL_OBJ O WHERE O.CODE = A.ID AND O.PTYPE = #{objType})
  2415. ) B ON T.ID = B.ID
  2416. WHERE
  2417. T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  2418. ) w
  2419. <where>
  2420. <if test="province !=null and province !=''">
  2421. and AD_CODE like '${province}%'
  2422. </if>
  2423. <if test="nm != null and nm != ''">
  2424. and nm like '%' || #{nm} || '%'
  2425. </if>
  2426. <if test="adCode != null and adCode != ''">
  2427. and ${adCode}
  2428. </if>
  2429. </where>
  2430. ORDER BY
  2431. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  2432. ad_code
  2433. </select>
  2434. <select id="getAddAxListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.AttSupAdBase">
  2435. select distinct * from (
  2436. SELECT A.GUID,
  2437. A.AD_CODE code,
  2438. A.AD_NAME name,
  2439. A.LOW_LEFT_LONG,
  2440. A.LOW_LEFT_LAT,
  2441. A.UP_RIGHT_LONG,
  2442. A.UP_RIGHT_LAT,
  2443. A.UP_AD_NAME,
  2444. A.AD_GRAD,
  2445. A.AD_ABBR_NAME,
  2446. A.AD_STAT,
  2447. A.AD_AREA,
  2448. A.AD_FULL_NAME,
  2449. A.NOTE,
  2450. A.EFF_DATE,
  2451. A.EXPR_DATE,
  2452. A.AD_STAT_LONG,
  2453. A.AD_STAT_LAT,
  2454. A.DOMAIN_CODE,
  2455. A.AD_SIGN,
  2456. A.MODIFIER_PEOPLE,
  2457. A.UPD_DATE,
  2458. A.IS_REPORT,
  2459. A.AD_FCODE,
  2460. (case when A.IS_POVERYT is null then '0' else A.IS_POVERYT end) IS_POVERYT,
  2461. A.SRC,
  2462. A.REMARK,
  2463. A.AD_LONG,
  2464. A.AD_LAT,
  2465. A.LGTD,
  2466. A.LTTD,
  2467. A.LGTDPC,
  2468. A.LTTDPC
  2469. FROM ATT_AD_BASE A
  2470. WHERE A.AD_GRAD='4'
  2471. AND A.AD_CODE IN (SELECT DISTINCT T.AD_CODE FROM ATT_HYST_BASE T WHERE T.AD_CODE IS NOT NULL)
  2472. AND A.AD_CODE NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%')
  2473. <if test="province !=null and province !=''">and ad_code like '${province}%'</if>
  2474. )
  2475. <if test="adName != null and adName != ''">and A.AD_NAME LIKE '%${adName}%'</if>
  2476. <if test="nm != null and nm != ''">and AD_NAME like '%${nm}%'</if>
  2477. <if test="adCode != null and adCode != ''">and ${adCode}</if>
  2478. <if test="isPkx != null and isPkx != ''">and A.IS_POVERYT =#{isPkx}</if>
  2479. ORDER BY
  2480. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  2481. AD_CODE
  2482. ) w
  2483. </select>
  2484. <select id="getStstnListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  2485. SELECT DISTINCT * FROM (
  2486. SELECT
  2487. T.ID AS CODE,
  2488. T.LOC AS LOCATION,
  2489. A.AD_FULL_NAME,
  2490. NVL(B.STATE, 0) AS STATE,
  2491. T.ID,
  2492. T.NM,
  2493. T.NM AS NAME,
  2494. T.PRJC_TYPE AS PRJ_TYPE,
  2495. T.AD_CODE,
  2496. T.AD_NAME,
  2497. T.LOC,
  2498. T.COST,
  2499. T.COST_YEAR,
  2500. T.MGR,
  2501. T.OWNER,
  2502. T.QUALITY,
  2503. T.DESIGN,
  2504. T.SUPERVISOR,
  2505. T.BUILD,
  2506. T.PRJC_PERS,
  2507. T.PRJC_PRES_TEL,
  2508. T.CENTER_X,
  2509. T.CENTER_Y,
  2510. T.GD_X,
  2511. T.GD_Y,
  2512. T.INTM,
  2513. T.UPTM,
  2514. T.DATA_STAT
  2515. FROM ATT_STSTN_BASE T
  2516. LEFT JOIN ATT_AD_BASE A ON A.AD_CODE = T.AD_CODE
  2517. LEFT JOIN (
  2518. SELECT a.ID, '1' as state
  2519. FROM ATT_STSTN_BASE a
  2520. WHERE Exists (SELECT CODE FROM BIS_INSP_ALL_OBJ O WHERE O.CODE = A.ID AND O.PTYPE = #{objType})
  2521. ) B ON T.ID = B.ID
  2522. WHERE
  2523. T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  2524. ) w
  2525. <where>
  2526. <if test="province !=null and province !=''">
  2527. and AD_CODE like '${province}%'
  2528. </if>
  2529. <if test="nm != null and nm != ''">
  2530. and nm like '%' || #{nm} || '%'
  2531. </if>
  2532. <if test="adCode != null and adCode != ''">
  2533. and ${adCode}
  2534. </if>
  2535. </where>
  2536. ORDER BY
  2537. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  2538. ad_code
  2539. </select>
  2540. <select id="getGnrlListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  2541. SELECT DISTINCT * FROM (
  2542. SELECT
  2543. T.ID AS CODE,
  2544. T.LOC AS LOCATION,
  2545. A.AD_FULL_NAME,
  2546. T.SECT_NAME,
  2547. NVL(B.STATE, 0) AS STATE,
  2548. T.ID,
  2549. T.NM,
  2550. T.NM AS NAME,
  2551. T.AD_CODE,
  2552. T.AD_NAME,
  2553. T.LOC,
  2554. T.NOTE,
  2555. T.CENTER_X, T.CENTER_Y, T.GD_X, T.GD_Y, T.INTM, T.UPTM, T.OBJ_TYPE
  2556. FROM ATT_GNRL_BASE T
  2557. LEFT JOIN ATT_AD_BASE A ON A.AD_CODE = T.AD_CODE
  2558. LEFT JOIN (
  2559. SELECT a.ID, '1' as state
  2560. FROM ATT_GNRL_BASE a
  2561. WHERE Exists (SELECT CODE FROM BIS_INSP_ALL_OBJ O WHERE O.CODE = A.ID AND O.PTYPE = #{objType})
  2562. ) B ON T.ID = B.ID
  2563. WHERE
  2564. T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  2565. ) w
  2566. <where>
  2567. <if test="province !=null and province !=''">
  2568. and AD_CODE like '${province}%'
  2569. </if>
  2570. <if test="nm != null and nm != ''">
  2571. and nm like '%' || #{nm} || '%'
  2572. </if>
  2573. <if test="adCode != null and adCode != ''">
  2574. and ${adCode}
  2575. </if>
  2576. <if test="type != null and type != ''">
  2577. and OBJ_TYPE = #{type}
  2578. </if>
  2579. </where>
  2580. ORDER BY
  2581. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  2582. ad_code
  2583. </select>
  2584. <select id="getSwhsjsListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  2585. SELECT DISTINCT * FROM (
  2586. SELECT
  2587. T.ID AS CODE, T.WAIN_LOC AS LOCATION, A.AD_FULL_NAME,
  2588. NVL(B.STATE, 0) AS STATE, T.ID,
  2589. T.SWHS_NAME AS NM,
  2590. T.SWHS_NAME AS NAME,
  2591. T.AD_CODE,
  2592. T.AD_NAME,
  2593. T.NOTE,
  2594. T.CENTER_X,
  2595. T.CENTER_Y,
  2596. T.GD_X,
  2597. T.GD_Y,
  2598. T.INTM,
  2599. T.UPTM,
  2600. T.DATA_STAT,
  2601. T.SWHS_CODE,
  2602. T.SWHS_NAME,
  2603. T.WAIN_WASO_TYPE,
  2604. T.SWHS_USE,
  2605. T.SWHS_LEVEL,
  2606. T.WAIN_LOC,
  2607. T.INS_NAME,
  2608. T.INS_PER,
  2609. T.INS_PER_PHONE,
  2610. T.DEPT,
  2611. T.DEPT_PER,
  2612. T.DEPT_PER_PHONE
  2613. FROM ATT_SWHSJS_BASE T
  2614. LEFT JOIN ATT_AD_BASE A ON A.AD_CODE = T.AD_CODE
  2615. LEFT JOIN (
  2616. SELECT a.ID, '1' as state
  2617. FROM ATT_SWHSJS_BASE a
  2618. WHERE Exists (SELECT CODE FROM BIS_INSP_ALL_OBJ O WHERE O.CODE = A.ID AND O.PTYPE = #{objType})
  2619. ) B ON T.ID = B.ID
  2620. WHERE
  2621. T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  2622. ) w
  2623. <where>
  2624. <if test="province !=null and province !=''">
  2625. and AD_CODE like '${province}%'
  2626. </if>
  2627. <if test="nm != null and nm != ''">
  2628. and nm like '%' || #{nm} || '%'
  2629. </if>
  2630. <if test="adCode != null and adCode != ''">
  2631. and ${adCode}
  2632. </if>
  2633. </where>
  2634. ORDER BY
  2635. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  2636. ad_code
  2637. </select>
  2638. <select id="getRsvrSdListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  2639. SELECT DISTINCT * FROM (
  2640. SELECT
  2641. T.rs_code AS CODE, T.LOCATION AS LOCATION, A.AD_FULL_NAME,
  2642. NVL(B.STATE, 0) AS STATE, T.rs_code ID,
  2643. T.rs_name AS NM,
  2644. T.rs_name AS RS_NAME,
  2645. T.rs_name AS NAME,
  2646. T.adm_div AD_CODE,
  2647. T.location AD_NAME,
  2648. T.CENTER_X,
  2649. T.CENTER_Y,
  2650. T.CENTER_X_GD GD_X ,
  2651. T.CENTER_Y_GD GD_Y
  2652. FROM att_rs_base T
  2653. LEFT JOIN ATT_AD_BASE A ON A.AD_CODE = T.adm_div
  2654. LEFT JOIN (
  2655. SELECT a.rs_code , '1' as state
  2656. FROM att_rs_base a
  2657. WHERE Exists (SELECT CODE FROM BIS_INSP_ALL_OBJ O WHERE O.CODE = A.rs_code AND O.PTYPE = #{objType})
  2658. ) B ON T.rs_code = B.rs_code
  2659. WHERE
  2660. T.rs_code NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  2661. ) w
  2662. <where>
  2663. <if test="province !=null and province !=''">
  2664. and AD_CODE like '${province}%'
  2665. </if>
  2666. <if test="nm != null and nm != ''">
  2667. and nm like '%' || #{nm} || '%'
  2668. </if>
  2669. <if test="adCode != null and adCode != ''">
  2670. and ${adCode}
  2671. </if>
  2672. </where>
  2673. ORDER BY
  2674. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  2675. ad_code
  2676. </select>
  2677. <select id="getXsdyhglListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  2678. SELECT DISTINCT * FROM (
  2679. SELECT
  2680. T . ID AS CODE,
  2681. T .LOC AS LOCATION,
  2682. A .AD_FULL_NAME,
  2683. NVL (B.STATE, 0) AS STATE,
  2684. T . ID,
  2685. T .NM AS NM,
  2686. T .NM AS NAME,
  2687. T .AD_CODE,
  2688. T .AD_NAME,
  2689. T .NOTE,
  2690. T .CENTER_X,
  2691. T .CENTER_Y,
  2692. T .GD_X,
  2693. T .GD_Y,
  2694. T .INTM,
  2695. T .UPTM,
  2696. T .DATA_STAT
  2697. FROM ATT_HYSTP_BASE T
  2698. LEFT JOIN ATT_AD_BASE A ON A.AD_CODE = T.AD_CODE
  2699. LEFT JOIN (
  2700. SELECT a.ID, '1' as state
  2701. FROM ATT_HYSTP_BASE a
  2702. WHERE Exists (SELECT CODE FROM BIS_INSP_ALL_OBJ O WHERE O.CODE = A.ID AND O.PTYPE = #{objType})
  2703. ) B ON T.ID = B.ID
  2704. WHERE
  2705. T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  2706. ) w
  2707. <where>
  2708. <if test="province !=null and province !=''">
  2709. and AD_CODE like '${province}%'
  2710. </if>
  2711. <if test="nm != null and nm != ''">
  2712. and nm like '%' || #{nm} || '%'
  2713. </if>
  2714. <if test="adCode != null and adCode != ''">
  2715. and ${adCode}
  2716. </if>
  2717. </where>
  2718. ORDER BY
  2719. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  2720. ad_code
  2721. </select>
  2722. <select id="getRdwpGdListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  2723. SELECT DISTINCT *
  2724. FROM (
  2725. SELECT T.ID AS CODE
  2726. , T.SITE_OF_PRJ AS LOCATION
  2727. , A.AD_FULL_NAME
  2728. , NVL(B.STATE, 0) AS STATE
  2729. , T.ID
  2730. , T.PRJ_NAME AS NM
  2731. , T.PRJ_NAME AS NAME
  2732. , T.PRJ_TYPE
  2733. , T.AD_CODE
  2734. , T.AD_NAME
  2735. , T.INTM
  2736. , T.UPTM
  2737. , T.DATA_STAT
  2738. FROM ATT_RDWPGD_BASE T
  2739. LEFT JOIN ATT_AD_BASE A ON A.AD_CODE = T.AD_CODE
  2740. LEFT JOIN (
  2741. SELECT a.ID, '1' AS state
  2742. FROM ATT_RDWPGD_BASE a
  2743. WHERE EXISTS(
  2744. SELECT CODE
  2745. FROM BIS_INSP_ALL_OBJ O
  2746. WHERE O.CODE = A.ID
  2747. AND O.PTYPE = #{objType}
  2748. )
  2749. ) B
  2750. ON T.ID = B.ID
  2751. WHERE T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  2752. ) w
  2753. <where>
  2754. <if test="province !=null and province !=''">
  2755. and AD_CODE like '${province}%'
  2756. </if>
  2757. <if test="nm != null and nm != ''">
  2758. and nm like '%' || #{nm} || '%'
  2759. </if>
  2760. <if test="adCode != null and adCode != ''">
  2761. and ${adCode}
  2762. </if>
  2763. <if test="prjType != null and prjType != ''">
  2764. and PRJ_TYPE = #{prjType}
  2765. </if>
  2766. </where>
  2767. ORDER BY
  2768. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  2769. ad_code
  2770. </select>
  2771. <select id="getYearMonth" resultType="java.util.Map">
  2772. SELECT A.ID,A.PNM,A.INSP_YEAR,A.INSP_MNTH, TO_CHAR(A.STTM,'YYYY-MM-DD') STTM,TO_CHAR(A.ENTM,'YYYY-MM-DD') ENTM ,B.CHK_NAME FROM BIS_INSP_ALL A LEFT JOIN BIS_INSP_PLAN_YEAR B ON B.ID = A.YEAR_TASK_ID where A.ID=#{groupId} and A.INSP_YEAR is not null and A.INSP_MNTH is not null
  2773. </select>
  2774. <select id="getPersAllDtoByIdsList" resultType="cn.com.goldenwater.dcproj.dto.PersAllDto">
  2775. SELECT DISTINCT A.GUID, A.PERS_NAME, B.PERTYPE persType
  2776. FROM BIS_INSP_ALL_RLATION_PERS A
  2777. LEFT JOIN BIS_INSP_ALL_RLATION B
  2778. ON A.GUID = B.PERSID
  2779. WHERE B.ID IN (${ids})
  2780. </select>
  2781. <select id="getPersAllAreaDtoByIdsList" resultType="cn.com.goldenwater.dcproj.dto.PersAllAreaDto">
  2782. SELECT DISTINCT A.AD_CODE, A.AD_NAME
  2783. FROM BIS_INSP_SEL_AREA A
  2784. WHERE A.ID IN (${ids})
  2785. </select>
  2786. <select id="getPersAllObjDtoByIdList" parameterType="String"
  2787. resultType="cn.com.goldenwater.dcproj.dto.PersAllObjDto">
  2788. select B.CODE, B.NM name, B.PTYPE, B.OBJ_ID
  2789. from BIS_INSP_ALL_OBJ B
  2790. WHERE B.ID = #{id}
  2791. </select>
  2792. <select id="getJsPwiuListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  2793. SELECT DISTINCT * FROM (
  2794. SELECT
  2795. T .ID AS CODE,
  2796. A .AD_FULL_NAME,
  2797. NVL (B.STATE, 0) AS STATE,
  2798. T .ID,
  2799. T .NAME AS NM,
  2800. T .NAME AS NAME,
  2801. T .AD_CODE,
  2802. T .AD_NAME,
  2803. T.DEP_TYPE as utType,
  2804. T.TMP_TYPE as trdType,
  2805. T .NOTE,
  2806. T .CENTER_X,
  2807. T .CENTER_Y,
  2808. T .GD_X,
  2809. T .GD_Y,
  2810. T .INTM,
  2811. T .UPTM,
  2812. T .DATA_STAT
  2813. FROM ATT_JSPWIU_BASE T
  2814. LEFT JOIN ATT_AD_BASE A ON A.AD_CODE = T.AD_CODE
  2815. LEFT JOIN (
  2816. SELECT a.ID, '1' as state
  2817. FROM ATT_JSPWIU_BASE a
  2818. WHERE Exists (SELECT CODE FROM BIS_INSP_ALL_OBJ O WHERE O.CODE = A.ID AND O.PTYPE = #{objType})
  2819. ) B ON T.ID = B.ID
  2820. WHERE
  2821. T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  2822. ) w
  2823. <where>
  2824. <if test="province !=null and province !=''">
  2825. and AD_CODE like '${province}%'
  2826. </if>
  2827. <if test="nm != null and nm != ''">
  2828. and NM like '%' || #{nm} || '%'
  2829. </if>
  2830. <if test="adCode != null and adCode != ''">
  2831. and ${adCode}
  2832. </if>
  2833. </where>
  2834. ORDER BY
  2835. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  2836. ad_code
  2837. </select>
  2838. <select id="getJsPwiu2024ListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  2839. SELECT DISTINCT * FROM (
  2840. SELECT
  2841. T .ID AS CODE,
  2842. A .AD_FULL_NAME,
  2843. NVL (B.STATE, 0) AS STATE,
  2844. T .ID,
  2845. T .NAME AS NM,
  2846. T .NAME AS NAME,
  2847. T .AD_CODE,
  2848. T .AD_NAME,
  2849. T .NOTE,
  2850. T .CENTER_X,
  2851. T .CENTER_Y,
  2852. T .GD_X,
  2853. T .GD_Y,
  2854. T .INTM,
  2855. T .UPTM,
  2856. T .DATA_STAT
  2857. FROM ATT_JSPWIU2024_BASE T
  2858. LEFT JOIN ATT_AD_BASE A ON A.AD_CODE = T.AD_CODE
  2859. LEFT JOIN (
  2860. SELECT a.ID, '1' as state
  2861. FROM ATT_JSPWIU2024_BASE a
  2862. WHERE Exists (SELECT CODE FROM BIS_INSP_ALL_OBJ O WHERE O.CODE = A.ID AND O.PTYPE = #{objType})
  2863. ) B ON T.ID = B.ID
  2864. WHERE
  2865. T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  2866. ) w
  2867. <where>
  2868. <if test="province !=null and province !=''">
  2869. and AD_CODE like '${province}%'
  2870. </if>
  2871. <if test="nm != null and nm != ''">
  2872. and NM like '%' || #{nm} || '%'
  2873. </if>
  2874. <if test="adCode != null and adCode != ''">
  2875. and ${adCode}
  2876. </if>
  2877. </where>
  2878. ORDER BY
  2879. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  2880. ad_code
  2881. </select>
  2882. <select id="getFjgnrlListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  2883. SELECT DISTINCT * FROM (
  2884. SELECT
  2885. T .ID AS CODE,
  2886. A .AD_FULL_NAME,
  2887. case when B.state is not null then B.state else '0' end STATE,
  2888. T .ID,
  2889. T .NM,
  2890. T .OBJ_TYPE,
  2891. T .NM AS NAME,
  2892. T .AD_CODE,
  2893. T .AD_NAME,
  2894. T .NOTE,
  2895. T .CENTER_X,
  2896. T .CENTER_Y,
  2897. T .GD_X,
  2898. T .GD_Y,
  2899. T .INTM,
  2900. T .UPTM,
  2901. T .DATA_STAT
  2902. FROM BIS_INSP_BASE_NEW T
  2903. LEFT JOIN ATT_AD_BASE A ON A.AD_CODE = T.AD_CODE
  2904. LEFT JOIN (
  2905. SELECT a.ID, '1' as state
  2906. FROM BIS_INSP_BASE_NEW a
  2907. WHERE Exists (SELECT CODE FROM BIS_INSP_ALL_OBJ O WHERE O.CODE = A.ID AND O.PTYPE = #{objType})
  2908. ) B ON T.ID = B.ID
  2909. WHERE
  2910. T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  2911. ) w
  2912. <where>
  2913. <if test="province !=null and province !=''">
  2914. and AD_CODE like '${province}%'
  2915. </if>
  2916. <if test="nm != null and nm != ''">
  2917. and NM like '%' || #{nm} || '%'
  2918. </if>
  2919. <if test="adCode != null and adCode != ''">
  2920. and ${adCode}
  2921. </if>
  2922. </where>
  2923. ORDER BY
  2924. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  2925. ad_code
  2926. </select>
  2927. <select id="getFpjlglListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  2928. SELECT DISTINCT * FROM (
  2929. SELECT
  2930. T.ID AS CODE,
  2931. A.AD_FULL_NAME,
  2932. NVL(B.STATE, 0) AS STATE,
  2933. T.ID,
  2934. T.NAME AS NM,
  2935. T.NAME AS NAME,
  2936. T.AD_CODE,
  2937. T.AD_NAME,
  2938. T.BUS_ADDR,
  2939. T.CON_PERS,
  2940. T.CON_PERS_TEL,
  2941. T.CENTER_X,
  2942. T.CENTER_Y,
  2943. T.GD_X,
  2944. T.GD_Y,
  2945. T.INTM,
  2946. T.UPTM,
  2947. T.DATA_STAT
  2948. FROM ATT_FJPJLGL_BASE T
  2949. LEFT JOIN ATT_AD_BASE A ON A.AD_CODE = T.AD_CODE
  2950. LEFT JOIN (
  2951. SELECT a.ID, '1' as state
  2952. FROM ATT_FJPJLGL_BASE a
  2953. WHERE Exists (SELECT CODE FROM BIS_INSP_ALL_OBJ O WHERE O.CODE = A.ID AND O.PTYPE = #{objType})
  2954. ) B ON T.ID = B.ID
  2955. WHERE
  2956. T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  2957. ) w
  2958. <where>
  2959. <if test="province !=null and province !=''">
  2960. and AD_CODE like '${province}%'
  2961. </if>
  2962. <if test="nm != null and nm != ''">
  2963. and nm like '%' || #{nm} || '%'
  2964. </if>
  2965. <if test="adCode != null and adCode != ''">
  2966. and ${adCode}
  2967. </if>
  2968. </where>
  2969. ORDER BY
  2970. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  2971. ad_code
  2972. </select>
  2973. <select id="getFjpjmgdpListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  2974. SELECT DISTINCT * FROM (
  2975. SELECT
  2976. T.ID AS CODE,
  2977. A.AD_FULL_NAME,
  2978. NVL(B.STATE, 0) AS STATE,
  2979. T.ID,
  2980. T.NAME AS NM,
  2981. T.NAME AS NAME,
  2982. T.AD_CODE,
  2983. T.AD_NAME,
  2984. T.BUS_ADDR,
  2985. T.CON_PERS,
  2986. T.CON_PERS_TEL,
  2987. T.CENTER_X,
  2988. T.CENTER_Y,
  2989. T.GD_X,
  2990. T.GD_Y,
  2991. T.INTM,
  2992. T.UPTM,
  2993. T.DATA_STAT
  2994. FROM ATT_FJPJMGDP_BASE T
  2995. LEFT JOIN ATT_AD_BASE A ON A.AD_CODE = T.AD_CODE
  2996. LEFT JOIN (
  2997. SELECT a.ID, '1' as state
  2998. FROM ATT_FJPJMGDP_BASE a
  2999. WHERE Exists (SELECT CODE FROM BIS_INSP_ALL_OBJ O WHERE O.CODE = A.ID AND O.PTYPE = #{objType})
  3000. ) B ON T.ID = B.ID
  3001. WHERE
  3002. T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  3003. ) w
  3004. <where>
  3005. <if test="province !=null and province !=''">
  3006. and AD_CODE like '${province}%'
  3007. </if>
  3008. <if test="nm != null and nm != ''">
  3009. and nm like '%' || #{nm} || '%'
  3010. </if>
  3011. <if test="adCode != null and adCode != ''">
  3012. and ${adCode}
  3013. </if>
  3014. </where>
  3015. ORDER BY
  3016. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  3017. ad_code
  3018. </select>
  3019. <select id="getFjaccpListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  3020. SELECT DISTINCT * FROM (
  3021. SELECT
  3022. T.ID AS CODE,
  3023. A.AD_FULL_NAME,
  3024. NVL(B.STATE, 0) AS STATE,
  3025. T.ID,
  3026. T.NAME AS NM,
  3027. T.NAME AS NAME,
  3028. T.AD_CODE,
  3029. T.AD_NAME,
  3030. T.BUS_ADDR,
  3031. T.CON_PERS,
  3032. T.CON_PERS_TEL,
  3033. T.CENTER_X,
  3034. T.CENTER_Y,
  3035. T.GD_X,
  3036. T.GD_Y,
  3037. T.INTM,
  3038. T.UPTM,
  3039. T.DATA_STAT
  3040. FROM ATT_FJACCP_BASE T
  3041. LEFT JOIN ATT_AD_BASE A ON A.AD_CODE = T.AD_CODE
  3042. LEFT JOIN (
  3043. SELECT a.ID, '1' as state
  3044. FROM ATT_FJACCP_BASE a
  3045. WHERE Exists (SELECT CODE FROM BIS_INSP_ALL_OBJ O WHERE O.CODE = A.ID AND O.PTYPE = #{objType})
  3046. ) B ON T.ID = B.ID
  3047. WHERE
  3048. T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  3049. ) w
  3050. <where>
  3051. <if test="province !=null and province !=''">
  3052. and AD_CODE like '${province}%'
  3053. </if>
  3054. <if test="nm != null and nm != ''">
  3055. and nm like '%' || #{nm} || '%'
  3056. </if>
  3057. <if test="adCode != null and adCode != ''">
  3058. and ${adCode}
  3059. </if>
  3060. </where>
  3061. ORDER BY
  3062. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  3063. ad_code
  3064. </select>
  3065. <select id="getFjsduListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  3066. SELECT DISTINCT * FROM (
  3067. SELECT
  3068. T.ID AS CODE,
  3069. A.AD_FULL_NAME,
  3070. NVL(B.STATE, 0) AS STATE,
  3071. T.ID,
  3072. T.NAME AS NM,
  3073. T.NAME AS NAME,
  3074. T.AD_CODE,
  3075. T.AD_NAME,
  3076. T.BUS_ADDR,
  3077. T.CON_PERS,
  3078. T.CON_PERS_TEL,
  3079. T.CENTER_X,
  3080. T.CENTER_Y,
  3081. T.GD_X,
  3082. T.GD_Y,
  3083. T.INTM,
  3084. T.UPTM,
  3085. T.DATA_STAT
  3086. FROM ATT_FJSDU_BASE T
  3087. LEFT JOIN ATT_AD_BASE A ON A.AD_CODE = T.AD_CODE
  3088. LEFT JOIN (
  3089. SELECT a.ID, '1' as state
  3090. FROM ATT_FJSDU_BASE a
  3091. WHERE Exists (SELECT CODE FROM BIS_INSP_ALL_OBJ O WHERE O.CODE = A.ID AND O.PTYPE = #{objType})
  3092. ) B ON T.ID = B.ID
  3093. WHERE
  3094. T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  3095. ) w
  3096. <where>
  3097. <if test="province !=null and province !=''">
  3098. and AD_CODE like '${province}%'
  3099. </if>
  3100. <if test="nm != null and nm != ''">
  3101. and nm like '%' || #{nm} || '%'
  3102. </if>
  3103. <if test="adCode != null and adCode != ''">
  3104. and ${adCode}
  3105. </if>
  3106. </where>
  3107. ORDER BY
  3108. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  3109. ad_code
  3110. </select>
  3111. <select id="getFjpjcsuListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  3112. SELECT DISTINCT * FROM (
  3113. SELECT
  3114. T.ID AS CODE,
  3115. A.AD_FULL_NAME,
  3116. NVL(B.STATE, 0) AS STATE,
  3117. T.ID,
  3118. T.NAME AS NM,
  3119. T.NAME AS NAME,
  3120. T.AD_CODE,
  3121. T.AD_NAME,
  3122. T.BUS_ADDR,
  3123. T.CON_PERS,
  3124. T.CON_PERS_TEL,
  3125. T.CENTER_X,
  3126. T.CENTER_Y,
  3127. T.GD_X,
  3128. T.GD_Y,
  3129. T.INTM,
  3130. T.UPTM,
  3131. T.DATA_STAT
  3132. FROM ATT_FJPJCSU_BASE T
  3133. LEFT JOIN ATT_AD_BASE A ON A.AD_CODE = T.AD_CODE
  3134. LEFT JOIN (
  3135. SELECT a.ID, '1' as state
  3136. FROM ATT_FJPJCSU_BASE a
  3137. WHERE Exists (SELECT CODE FROM BIS_INSP_ALL_OBJ O WHERE O.CODE = A.ID AND O.PTYPE = #{objType})
  3138. ) B ON T.ID = B.ID
  3139. WHERE
  3140. T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  3141. ) w
  3142. <where>
  3143. <if test="province !=null and province !=''">
  3144. and AD_CODE like '${province}%'
  3145. </if>
  3146. <if test="nm != null and nm != ''">
  3147. and nm like '%' || #{nm} || '%'
  3148. </if>
  3149. <if test="adCode != null and adCode != ''">
  3150. and ${adCode}
  3151. </if>
  3152. </where>
  3153. ORDER BY
  3154. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  3155. ad_code
  3156. </select>
  3157. <select id="getFillListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  3158. SELECT DISTINCT * FROM (
  3159. SELECT
  3160. T .ID AS CODE,
  3161. A .AD_FULL_NAME,
  3162. case when B.state is not null then B.state else '0' end STATE,
  3163. T .ID,
  3164. T .NAME AS NM,
  3165. T .NAME,
  3166. T .AD_CODE,
  3167. T .AD_NAME,
  3168. T .CENTER_X,
  3169. T .CENTER_Y,
  3170. T .GD_X,
  3171. T .GD_Y,
  3172. T .INTM,
  3173. T .UPTM,
  3174. T .DATA_STAT
  3175. FROM ATT_PROJECT_INSURANCE T
  3176. LEFT JOIN ATT_AD_BASE A ON A.AD_CODE = T.AD_CODE
  3177. LEFT JOIN (
  3178. SELECT a.ID, '1' as state
  3179. FROM BIS_INSP_BASE_NEW a
  3180. WHERE Exists (SELECT CODE FROM BIS_INSP_ALL_OBJ O WHERE O.CODE = A.ID AND O.PTYPE = #{objType})
  3181. ) B ON T.ID = B.ID
  3182. WHERE T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  3183. AND T.BUSINESS_TYPE = #{businessType}
  3184. ) w
  3185. <where>
  3186. <if test="province !=null and province !=''">
  3187. and AD_CODE like '${province}%'
  3188. </if>
  3189. <if test="nm != null and nm != ''">
  3190. and NM like '%' || #{nm} || '%'
  3191. </if>
  3192. <if test="adCode != null and adCode != ''">
  3193. and ${adCode}
  3194. </if>
  3195. </where>
  3196. ORDER BY
  3197. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  3198. ad_code
  3199. </select>
  3200. </mapper>