SupervisionPlanDao.xml 116 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245
  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. case when B.state is not null then B.state else '0' end state,
  85. case when B.state is not null then B.state else '0' end 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. case when B.state is not null then B.state else '0' end 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. case when B.state is not null then B.state else '0' end 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. case when B.state is not null then B.state else '0' end 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. <otherwise>
  942. (select ID code, AD_CODE,e.gd_x lgtd,e.gd_y lttd,e.center_x lgtdPc,e.center_y lttdPc FROM
  943. ATT_GNRL_BASE e
  944. where ID = #{code})
  945. </otherwise>
  946. </choose>
  947. </select>
  948. <insert id="insertSupArea">
  949. INSERT INTO BIS_INSP_SEL_AREA(AREA_ID,ID,AD_CODE,AD_NAME,ORG_ID) VALUES(#{uuid},#{id},#{adCode},#{adName},#{orgId})
  950. </insert>
  951. <select id="getPers" resultType="cn.com.goldenwater.dcproj.dto.ObjIdDto">
  952. SELECT PERSID guid,ID id,PERTYPE persType FROM BIS_INSP_ALL_RLATION B WHERE ID = #{id} AND PERSID = #{guid}
  953. <include refid="choseSql"/>
  954. </select>
  955. <update id="updatePersType">
  956. UPDATE BIS_INSP_ALL_RLATION SET PERTYPE = #{persType} WHERE ID = #{id} AND PERSID = #{guid}
  957. <if test="orgId !=null and orgId !=''">
  958. and org_id=#{orgId}
  959. </if>
  960. </update>
  961. <select id="getPersType" parameterType="String" resultType="cn.com.goldenwater.dcproj.dto.PersTypeDto">
  962. SELECT r.id id,r.pnm name FROM BIS_INSP_ALL r left join
  963. (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
  964. WHERE B.PERSID = #{persid}
  965. <include refid="choseSql"/>
  966. ) p on r.id = p.rid
  967. where p.rid is not null ORDER BY r.id
  968. </select>
  969. <select id="updateTeamLeader" parameterType="String">
  970. UPDATE BIS_INSP_ALL_RLATION SET PERTYPE = '2' WHERE ID = #{id}
  971. </select>
  972. <update id="updateGroupNm">
  973. UPDATE BIS_INSP_ALL SET PNM = #{nm} WHERE ID = #{id}
  974. </update>
  975. <select id="getPersTypeByPersid" parameterType="String" resultType="cn.com.goldenwater.dcproj.dto.PersTypeDto">
  976. 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
  977. LEFT JOIN BIS_INSP_RECV_UNIT C ON B.ID = C.NTFCTN_ID
  978. LEFT JOIN BIS_INSP_ALL_RLATION_PERS D ON C.ORG_ID = D.ORG_ID
  979. WHERE B.FLAG_VALID = '1' AND C.FLAG_VALID = '1'
  980. AND D.GUID = #{persid} and C.ORG_ID=#{orgId}
  981. ORDER BY A.CODE
  982. </select>
  983. <select id="getPersTypeByPersidOrg" parameterType="String" resultType="cn.com.goldenwater.dcproj.dto.PersTypeDto">
  984. select DISTINCT to_number(t.code) id,t.NAME from ATT_INSP_TYPE t,bis_insp_all_rlation r
  985. where t.code=substr(r.id,0,3) and r.persid=#{persid}
  986. <choose>
  987. <when test="province !=null and province !=''">
  988. and r.ad_code =#{province}
  989. </when>
  990. <otherwise>
  991. and r.ad_code is null
  992. </otherwise>
  993. </choose>
  994. order by to_number(t.code)
  995. </select>
  996. <select id="getAllInfoByPersid" resultType="cn.com.goldenwater.dcproj.dto.PersAllInfoDto">
  997. 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 =
  998. B.ID
  999. WHERE A.ID LIKE '${ptype}%' AND A.PID = #{id}
  1000. <include refid="choseSql"/>
  1001. </select>
  1002. <select id="getPersAllObjDtoListByType" parameterType="String"
  1003. resultType="cn.com.goldenwater.dcproj.dto.PersAllObjDto">
  1004. select B.CODE,B.NM name,B.org_id from BIS_INSP_ALL_OBJ B WHERE B.ID = #{id}
  1005. <include refid="choseSql"/>
  1006. </select>
  1007. <select id="getNodeBy" resultType="cn.com.goldenwater.dcproj.dto.ObjectNameDto">
  1008. SELECT ID,PNM NAME FROM BIS_INSP_ALL WHERE ID LIKE '${id}' AND INSP_YEAR = #{inspYear}
  1009. AND province=#{province}
  1010. AND INSP_MNTH = #{inspMnth} AND ROWNUM &lt; 2
  1011. </select>
  1012. <select id="getMaxGroupId" parameterType="String" resultType="cn.com.goldenwater.dcproj.dto.ObjIdDto">
  1013. SELECT MAX(ID) AS id FROM BIS_INSP_ALL WHERE PID = #{id} and PROVINCE=#{province}
  1014. </select>
  1015. <sql id="table_columns_node">
  1016. ID,
  1017. PID,
  1018. PNM,
  1019. STTM,
  1020. ENTM,
  1021. ORG_ID,
  1022. INSP_YEAR,
  1023. INSP_MNTH,
  1024. INSP_TASK,
  1025. PROVINCE,
  1026. INSP_TYPE,
  1027. YEAR_TASK_ID
  1028. </sql>
  1029. <sql id="entity_properties_node">
  1030. #{id},
  1031. #{pid},
  1032. #{pnm},
  1033. to_date(#{sttm},'YYYY-MM-DD HH24:MI:SS'),
  1034. to_date(#{entm},'YYYY-MM-DD HH24:MI:SS'),
  1035. #{orgId},
  1036. #{inspYear},
  1037. #{inspMnth},
  1038. #{inspTask},
  1039. #{province},
  1040. #{inspType},
  1041. #{yearTaskId}
  1042. </sql>
  1043. <insert id="insertNode" parameterType="cn.com.goldenwater.dcproj.dto.BisInspAllNodeDto">
  1044. insert into BIS_INSP_ALL(
  1045. <include refid="table_columns_node"/>
  1046. )
  1047. values (
  1048. <include refid="entity_properties_node"/>
  1049. )
  1050. </insert>
  1051. <update id="updateNode" parameterType="cn.com.goldenwater.dcproj.dto.BisInspAllDto">
  1052. update BIS_INSP_ALL
  1053. <trim prefix="set" suffixOverrides=",">
  1054. <if test="pid != null and pid != ''">PID = #{pid},</if>
  1055. <if test="pnm != null and pnm != ''">PNM = #{pnm},</if>
  1056. <if test="sttm != null">STTM = TO_DATE(#{sttm},'YYYY-MM-DD'),</if>
  1057. <if test="entm != null">ENTM = TO_DATE(#{entm},'YYYY-MM-DD'),</if>
  1058. <if test="orgId != null and orgId != ''">ORG_ID = #{orgId},</if>
  1059. <if test="intm != null">INTM = #{intm},</if>
  1060. <if test="psn != null and psn != ''">PSN = #{psn},</if>
  1061. <if test="inspYear != null and inspYear != ''">INSP_YEAR = #{inspYear},</if>
  1062. <if test="inspMnth != null and inspMnth != ''">INSP_MNTH = #{inspMnth},</if>
  1063. <if test="inspTask != null and inspTask != ''">INSP_TASK = #{inspTask},</if>
  1064. <if test="inspTask != null and inspTask != ''">YEAR_TASK_ID = #{inspTask},</if>
  1065. <if test="quantity != null">QUANTITY = #{quantity},</if>
  1066. </trim>
  1067. <where>ID = #{id}</where>
  1068. </update>
  1069. <select id="getPersInfo" parameterType="String" resultType="cn.com.goldenwater.dcproj.dto.BisInspAllRlationPersDto">
  1070. SELECT * FROM BIS_INSP_ALL_RLATION_PERS WHERE GUID = #{persid}
  1071. </select>
  1072. <select id="getNodeByOrgId" parameterType="String" resultType="cn.com.goldenwater.dcproj.dto.AllNodeDto">
  1073. SELECT ID id,PID pid,PNM,org_id nm FROM BIS_INSP_ALL WHERE ID LIKE '${orgIdStr}%' AND LENGTH(ID) = 9 AND PROVINCE=#{province}
  1074. </select>
  1075. <delete id="deleteNodeByPersid" parameterType="java.lang.String">
  1076. delete from bis_insp_all_rlation where length(id) &lt;= 6 and PERSID = #{persid}
  1077. </delete>
  1078. <select id="getSupFscListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.AttFscBaseDto">
  1079. SELECT DISTINCT * from (
  1080. select T.id,
  1081. T.Code,
  1082. T.NAME,
  1083. T.NAME as nm,
  1084. T.TYPE,
  1085. T.ADM_ORG,
  1086. T.AD_CODE,
  1087. T.LOCATION,
  1088. T.CENTER_X,
  1089. T.CENTER_Y,
  1090. T.GD_X,
  1091. T.GD_Y,
  1092. T.PERS_ID,
  1093. T.INTM,
  1094. T.UPTM,B.OBJ_ID ,case when b.code is null then '' else '1' end state
  1095. from ATT_FSC_BASE t LEFT JOIN BIS_INSP_ALL_OBJ B on T.id = B.Code
  1096. where t.id not in (select code from bis_insp_all_obj where id like concat(#{inspGroupId},'%'))
  1097. <if test="nm != null and nm != ''">AND T.name like '%${nm}%'</if>
  1098. <if test="type != null and type != ''">
  1099. And t.type = #{type}
  1100. </if>
  1101. <if test="province !=null and province !=''">
  1102. and t.ad_code like '${province}%'
  1103. </if>
  1104. ) WHERE 1 = 1
  1105. <if test="adCode != null and adCode != ''">and ${adCode}</if>
  1106. ORDER BY
  1107. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  1108. ad_code
  1109. </select>
  1110. <select id="getPrdListNotInspGroupId" parameterType="cn.com.goldenwater.dcproj.param.InspObjParam"
  1111. resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  1112. SELECT DISTINCT * FROM (
  1113. SELECT
  1114. T.ID CODE, T.NAME AS NM,
  1115. T.ID,T.NAME, T.TYPE, T.LOCATION,T.GD_X ,T.GD_Y,T.AD_CODE,T.AD_NAME,
  1116. CASE WHEN B.STATE IS NULL then '0' else B.STATE end STATE
  1117. FROM ATT_PRD_CSTR_PROJ_BASE T
  1118. LEFT JOIN (
  1119. SELECT A.ID, '1' AS STATE FROM ATT_PRD_CSTR_PROJ_BASE A
  1120. WHERE EXISTS (SELECT CODE FROM BIS_INSP_ALL_OBJ O WHERE O.CODE = A.ID AND O.PTYPE = #{objType})
  1121. ) B ON T.ID = B.ID
  1122. WHERE T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  1123. <if test="province !=null and province !=''">and t.ad_code like '${province}%'</if>
  1124. ) w
  1125. <where>
  1126. <if test="nm != null and nm != ''">and nm like '%${nm}%'</if>
  1127. <if test="adCode != null and adCode != ''">and ${adCode}</if>
  1128. <if test="type != null and type != ''">and TYPE = #{type}</if>
  1129. </where>
  1130. ORDER BY
  1131. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  1132. AD_CODE
  1133. </select>
  1134. <select id="getJSWAListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto"
  1135. parameterType="cn.com.goldenwater.dcproj.param.InspObjParam">
  1136. select distinct * from (
  1137. 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
  1138. gdY,t.ad_code,t.pblm_type as type,t.ad_name,
  1139. B.OBJ_ID,CASE WHEN B.CODE IS NULL then '' else '1' end state
  1140. FROM ATT_JSKEJIAN_WATER_BASE T LEFT JOIN (select * FROM BIS_INSP_ALL_OBJ o where o.ptype = #{objType}) B ON T.id
  1141. = B.CODE
  1142. WHERE T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  1143. <if test="province !=null and province !=''">
  1144. and t.ad_code like '${province}%'
  1145. </if>
  1146. ) w where 1=1
  1147. <if test="nm != null and nm != ''">
  1148. and nm like '%${nm}%'
  1149. </if>
  1150. <if test="adCode != null and adCode != ''">and ${adCode}</if>
  1151. ORDER BY
  1152. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  1153. ad_code
  1154. </select>
  1155. <select id="getEcofrdListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto"
  1156. parameterType="cn.com.goldenwater.dcproj.param.InspObjParam">
  1157. select distinct * from (
  1158. select t.id,t.id as code,t.ASSIGN_NUM name,t.ASSIGN_NUM as nm,t.location as location,t.REPORT_CONTENT as
  1159. type,t.gd_x as gdX,t.gd_y
  1160. as gdY,t.ad_code,t.ad_name,
  1161. B.OBJ_ID,CASE WHEN B.CODE IS NULL then '' else '1' end state
  1162. FROM ATT_JSKEJIAN_ECOFRD_BASE T LEFT JOIN (select * FROM BIS_INSP_ALL_OBJ o where o.ptype = #{objType}) B ON
  1163. T.id = B.CODE
  1164. WHERE T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  1165. <if test="province !=null and province !=''">
  1166. and t.ad_code like '${province}%'
  1167. </if>
  1168. ) w where 1=1
  1169. <if test="nm != null and nm != ''">
  1170. and nm like '%${nm}%'
  1171. </if>
  1172. <if test="adCode != null and adCode != ''">and ${adCode}</if>
  1173. ORDER BY
  1174. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  1175. ad_code
  1176. </select>
  1177. <select id="getJSFLListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto"
  1178. parameterType="cn.com.goldenwater.dcproj.param.InspObjParam">
  1179. select distinct * from (
  1180. select
  1181. t.id, t.id as code, t.name, t.name as nm,
  1182. case when B.state is not null then B.state else '0' end state,
  1183. t.location as location, t.pblm_type as type,
  1184. t.pblm_desc,t.gd_x,t.gd_y,t.ad_code,
  1185. t.ad_name,t.RECT_CONC, t.INTM
  1186. FROM ATT_JSKEJIAN_FLKDIS_BASE T
  1187. LEFT JOIN (
  1188. SELECT a.ID, '1' as state
  1189. FROM ATT_JSKEJIAN_FLKDIS_BASE a
  1190. WHERE Exists (select code FROM BIS_INSP_ALL_OBJ o
  1191. where o.code = a.ID
  1192. and o.ptype = #{objType}
  1193. and to_char(o.OBJ_INTM,'yyyy')=to_char(sysdate,'yyyy')
  1194. )
  1195. ) B ON T.ID = B.ID
  1196. WHERE
  1197. T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ
  1198. WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  1199. <if test="svType != null and svType != ''">
  1200. <choose>
  1201. <when test='svType == "1"'>
  1202. and t.INTM &lt; (select trunc(sysdate,'yyyy') from dual )
  1203. </when>
  1204. <otherwise>
  1205. and t.INTM >= (select trunc(sysdate,'yyyy') from dual )
  1206. </otherwise>
  1207. </choose>
  1208. </if>
  1209. <if test="province !=null and province !=''">
  1210. and t.ad_code like '${province}%'
  1211. </if>
  1212. ) w where 1=1
  1213. <if test="nm != null and nm != ''">
  1214. and nm like '%${nm}%'
  1215. </if>
  1216. <if test="adCode != null and adCode != ''">and ${adCode}</if>
  1217. <if test="isSupn != null and isSupn != ''">and state = #{isSupn}</if>
  1218. <if test="isBack != null and isBack != ''">
  1219. <choose>
  1220. <when test='isBack == "1"'>
  1221. and (to_char(INTM,'yyyy') <![CDATA[ < ]]> to_char(sysdate,'yyyy') or INTM IS NULL)
  1222. </when>
  1223. <otherwise>
  1224. and to_char(INTM,'yyyy') = to_char(sysdate,'yyyy')
  1225. </otherwise>
  1226. </choose>
  1227. </if>
  1228. ORDER BY
  1229. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  1230. ad_code
  1231. </select>
  1232. <select id="getSupOtherListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.AttOtherBaseDto">
  1233. SELECT DISTINCT * from (
  1234. select T.id,
  1235. T.Code,
  1236. T.NAME,
  1237. T.NAME as nm,
  1238. T.TYPE,
  1239. T.ADM_ORG,
  1240. T.AD_CODE,
  1241. T.LOCATION,
  1242. T.CENTER_X,
  1243. T.CENTER_Y,
  1244. T.GD_X,
  1245. T.GD_Y,
  1246. T.PERS_ID,
  1247. T.INTM,
  1248. T.UPTM,B.OBJ_ID ,case when b.code is null then '' else '1' end state
  1249. from ATT_OTHER_BASE t LEFT JOIN BIS_INSP_ALL_OBJ B on T.id = B.Code
  1250. where t.id not in (select code from bis_insp_all_obj where id like concat(#{inspGroupId},'%'))
  1251. <if test="nm != null and nm != ''">AND T.name like '%${nm}%'</if>
  1252. <if test="type != null and type != ''">
  1253. And t.type = #{type}
  1254. </if>
  1255. <if test="province !=null and province !=''">
  1256. and t.ad_code like '${province}%'
  1257. </if>
  1258. ) WHERE 1 = 1
  1259. <if test="adCode != null and adCode != ''">and ${adCode}</if>
  1260. ORDER BY
  1261. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  1262. ad_code
  1263. </select>
  1264. <select id="getSupSdListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.model.AttSdBase">
  1265. SELECT DISTINCT * from (
  1266. select
  1267. T.SD_CODE as id,
  1268. T.SD_CODE as code,
  1269. T.SD_CODE,
  1270. T.SD_NAME,
  1271. T.SD_NAME AS name,
  1272. T.SD_NAME AS nm,
  1273. T.SD_TYPE,
  1274. T.SD_TYPE_STR,
  1275. T.CON_AREA,
  1276. T.TOT_CAP,
  1277. T.SDR_CAP,
  1278. T.FLCO_YEAR,
  1279. T.WARP_CAP,
  1280. T.DAM_SIZE_HIG,
  1281. T.DAM_TOP_LEN,
  1282. T.AD_CODE,
  1283. T.SD_LOC,
  1284. T.CENTER_X,
  1285. T.CENTER_Y,
  1286. T.GD_X,
  1287. T.GD_Y,
  1288. T.ASINTTDS,
  1289. T.NO_SPWAY,
  1290. T.DAM_TEAR,
  1291. T.DAM_LAND_SUB_SIDE,
  1292. T.DAM_RSOG,
  1293. T.DAM_LOPC,
  1294. T.DS_LTS,
  1295. T.DS_CC,
  1296. T.DS_OC,
  1297. T.FRS_MAR,
  1298. T.FRS_TBD,
  1299. T.FRS_OTH,
  1300. T.NOTE,
  1301. T.IN_TM,
  1302. T.UP_TM,B.OBJ_ID ,case when b.code is null then '' else '1' end state
  1303. from ATT_SD_BASE t LEFT JOIN BIS_INSP_ALL_OBJ B on T.sd_code = B.Code
  1304. where t.sd_code not in (select code from bis_insp_all_obj where id like concat(#{inspGroupId},'%'))
  1305. <if test="nm != null and nm != ''">AND T.SD_NAME like '%${nm}%'</if>
  1306. <if test="province !=null and province !=''">
  1307. and t.ad_code like '${province}%'
  1308. </if>
  1309. ) WHERE 1 = 1
  1310. <if test="adCode != null and adCode != ''">and ${adCode}</if>
  1311. ORDER BY
  1312. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  1313. ad_code
  1314. </select>
  1315. <select id="getSupSwhsListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.model.AttSwhsBase">
  1316. SELECT DISTINCT * FROM (
  1317. SELECT T.ID,
  1318. T.ID as code,
  1319. T.SWHS_CODE,
  1320. T.SWHS_NAME,
  1321. T.SWHS_NAME AS nm,
  1322. T.SWHS_NAME AS name,
  1323. T.SWHS_LONG,
  1324. T.SWHS_LAT,
  1325. T.AD_CODE,
  1326. T.SWHS_LOC,
  1327. T.WAIN_WASO_TYPE,
  1328. T.WAT_AREA,
  1329. T.WAIN_NUM,
  1330. T.WAIN_USE,
  1331. T.WASU_OBJ_TYPE,
  1332. T.WASU_TOWN_NAME,
  1333. T.WASU_TOWN_NAME_2,
  1334. T.WASU_TOWN_NAME_3,
  1335. T.DES_ANN_WAIN,
  1336. T.DES_ANN_WASU_POP,
  1337. T.RUN_YEAR,
  1338. T.WINT_RV_NAME,
  1339. T.WINT_LAKE_NAME,
  1340. T.WINT_RS_NAME,
  1341. T.WAQU_GOAL,
  1342. T.IF_MON_WQUA,
  1343. T.WQUA_CAT,
  1344. T.IF_WQUA_UPTO_STA,
  1345. T.IF_WS_PROT,
  1346. T.WAT_AREA_1ST_PROT,
  1347. T.LAND_AREA_1ST_PROT,
  1348. T.WAT_AREA_2ND_PROT,
  1349. T.LAND_AREA_2ND_PROT,
  1350. T.QUS_PROT,
  1351. T.INS_NAME,
  1352. T.TRA,
  1353. T.PERS_ID,
  1354. T.NOTE,
  1355. T.EFF_DATE,
  1356. T.EXPR_DATE,
  1357. T.SWHS_LONG_GD,
  1358. T.SWHS_LAT_GD,
  1359. T.DISPLAY_LEVEL,
  1360. B.OBJ_ID,CASE WHEN B.CODE IS NULL then '' else '1' end state
  1361. FROM ATT_SWHS_BASE T LEFT JOIN BIS_INSP_ALL_OBJ B ON T.ID = B.CODE
  1362. WHERE T.ID NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  1363. <if test="province !=null and province !=''">
  1364. and t.ad_code like '${province}%'
  1365. </if>
  1366. ) WHERE 1 = 1
  1367. <if test="nm != null and nm != ''">
  1368. and nm like '%${nm}%'
  1369. </if>
  1370. <if test="note != null and note != ''">
  1371. and NOTE = ${note}
  1372. </if>
  1373. <if test="adCode != null and adCode != ''">and ${adCode}</if>
  1374. ORDER BY
  1375. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  1376. ad_code
  1377. </select>
  1378. <select id="getSupWiuListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.model.AttWiuBase"
  1379. parameterType="cn.com.goldenwater.dcproj.param.InspObjParam">
  1380. SELECT DISTINCT * from (
  1381. SELECT T.ID, T.ID AS CODE,
  1382. T.WIU_CODE,
  1383. T.WIU_NAME,
  1384. T.WIU_NAME AS NM,
  1385. T.WIU_NAME AS NAME,
  1386. T.WINT_CODE,
  1387. T.IDT_TYPE,
  1388. T.NAME AS USER_NM,
  1389. T.WIU_NAT,
  1390. T.WIU_NAT_NAME,
  1391. T.CODE_TYPE,
  1392. T.CODE_VAL,
  1393. T.WIU_CONTACT,
  1394. T.WIU_CONTACT_TEL,
  1395. T.IN_TM,
  1396. T.UP_TM,
  1397. T.AD_CODE,
  1398. T.AD_NAME,
  1399. CASE WHEN B.state IS NULL then '' else '1' end state,
  1400. w.WINT_NAME,w.WINT_POS
  1401. FROM ATT_WIU_BASE T
  1402. LEFT JOIN ATT_WINT_BASE_B w ON t.WINT_CODE = w.ID
  1403. LEFT JOIN (
  1404. SELECT a.ID, '1' as state
  1405. FROM ATT_WIU_BASE a
  1406. WHERE Exists (select code FROM BIS_INSP_ALL_OBJ o where o.code = a.ID and o.ptype = #{objType})
  1407. ) B ON T.ID = B.ID
  1408. WHERE T.ID NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  1409. <if test="province !=null and province !=''">
  1410. and t.ad_code like '${province}%'
  1411. </if>
  1412. )
  1413. <where>
  1414. <if test="nm != null and nm != ''">and nm like '%${nm}%'</if>
  1415. <if test="adCode != null and adCode != ''">and ${adCode}</if>
  1416. </where>
  1417. ORDER BY
  1418. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  1419. ad_code
  1420. </select>
  1421. <select id="getAdXBaseListNotInspGroupId" parameterType="cn.com.goldenwater.dcproj.param.InspObjParam"
  1422. resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  1423. select distinct * from (
  1424. select
  1425. t.ad_code as id, t.ad_code as code,t.ad_name as nm,t.ad_name as name,
  1426. t.ad_full_name, t.ad_full_name as location,
  1427. t.lgtd as gdX,t.lttd as gdY,t.ad_long as pcX,t.ad_lat as pcY,
  1428. t.ad_code, t.AD_GRAD, case when B.state is not null then B.state else '0' end state
  1429. FROM ATT_AD_X_BASE T
  1430. LEFT JOIN (
  1431. SELECT a.AD_CODE, '1' as state
  1432. FROM ATT_AD_X_BASE a
  1433. WHERE Exists (select code FROM BIS_INSP_ALL_OBJ o where o.code = a.AD_CODE and o.ptype = #{objType})
  1434. ) B ON T.AD_CODE = B.AD_CODE
  1435. WHERE
  1436. T.ad_code NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  1437. <if test="province !=null and province !=''">and t.ad_code like '${province}%'</if>
  1438. ) w
  1439. where w.AD_GRAD IN (${adGrad})
  1440. <if test="nm != null and nm != ''">and nm like '%${nm}%'</if>
  1441. <if test="adCode != null and adCode != ''">and ${adCode}</if>
  1442. ORDER BY
  1443. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  1444. ad_code
  1445. </select>
  1446. <select id="getAdBaseListNotInspGroupId" parameterType="cn.com.goldenwater.dcproj.param.InspObjParam"
  1447. resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  1448. select distinct *
  1449. from (
  1450. select
  1451. 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,
  1452. t.lgtd as gdX, t.lttd as gdY, t.ad_code, t.AD_GRAD,
  1453. t.ad_long as pcX,t.ad_lat as pcY,
  1454. B.OBJ_ID, CASE WHEN B.CODE IS NULL then '' else '1' end state
  1455. FROM ATT_AD_X_BASE T
  1456. LEFT JOIN
  1457. (select * FROM BIS_INSP_ALL_OBJ o where o.ptype = #{objType}) B ON T.AD_CODE = B.CODE
  1458. WHERE
  1459. T.ad_code NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  1460. <if test="province !=null and province !=''">
  1461. and t.ad_code like '${province}%'
  1462. </if>
  1463. ) w where w.AD_GRAD = '3'
  1464. <if test="nm != null and nm != ''">
  1465. and nm like '%${nm}%'
  1466. </if>
  1467. <if test="adCode != null and adCode != ''">and ${adCode}</if>
  1468. ORDER BY
  1469. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  1470. ad_code
  1471. </select>
  1472. <select id="getWuntListNotInspGroupId" parameterType="cn.com.goldenwater.dcproj.param.InspObjParam"
  1473. resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  1474. select distinct * from (
  1475. 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
  1476. gdY,t.ad_code,t.UT_TYPE as
  1477. type,t.TRD_TYPE,t.UT_TYPE,t.UT_PPT,
  1478. t.GD_X as pcX,t.GD_Y as pcY,
  1479. B.OBJ_ID,CASE WHEN B.CODE IS NULL then '' else '1' end state
  1480. FROM ATT_WUNT_BASE T LEFT JOIN (select * FROM BIS_INSP_ALL_OBJ o where o.ptype = #{objType}) B ON T.AD_CODE =
  1481. B.CODE
  1482. WHERE T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  1483. <if test="province !=null and province !=''">
  1484. and t.ad_code like '${province}%'
  1485. </if>
  1486. ) w where 1=1
  1487. <if test="nm != null and nm != ''">
  1488. and nm like '%${nm}%'
  1489. </if>
  1490. <if test="adCode != null and adCode != ''">and ${adCode}</if>
  1491. ORDER BY
  1492. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  1493. ad_code
  1494. </select>
  1495. <!--获取不在督查组中的对象-->
  1496. <select id="getNotSuperviseGroupObj" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  1497. select distinct * from (
  1498. select
  1499. t.id as id,
  1500. t.id as code,
  1501. t.ad_code,
  1502. t.AD_FULL_NAME AS adName,
  1503. t.DEPART_NM AS nm,
  1504. t.DEPART_NM AS name,
  1505. B.OBJ_ID,
  1506. CASE WHEN B.CODE IS NULL then '' else '1' end state
  1507. FROM
  1508. ATT_ZHEJIANG_JG_BASE T
  1509. LEFT JOIN
  1510. (
  1511. select * FROM BIS_INSP_ALL_OBJ o where o.ptype = #{objType}
  1512. ) B ON T.AD_CODE = B.CODE
  1513. WHERE
  1514. T.id NOT IN
  1515. (
  1516. SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%')
  1517. )
  1518. <if test="province !=null and province !=''">
  1519. and t.ad_code like '${province}%'
  1520. </if>
  1521. ) w where 1=1
  1522. <if test="nm != null and nm != ''">
  1523. and nm like '%${nm}%'
  1524. </if>
  1525. <if test="adCode != null and adCode != ''">and ${adCode}</if>
  1526. ORDER BY
  1527. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  1528. ad_code
  1529. </select>
  1530. <select id="getRsBaseListNotInspGroupId" parameterType="cn.com.goldenwater.dcproj.param.InspObjParam"
  1531. resultType="cn.com.goldenwater.dcproj.model.AttRsBase">
  1532. select DISTINCT * from (
  1533. 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
  1534. ATT_RS_BASE t left join
  1535. (select * FROM BIS_INSP_ALL_OBJ o where o.ptype = '26') B ON T.rs_code =B.CODE
  1536. WHERE T.RS_CODE NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  1537. and t.ENG_SCAL in ('1','2','3')
  1538. <if test="nm != null and nm != ''">
  1539. and t.RS_NAME like '%${nm}%'
  1540. </if>
  1541. <if test="engScal != null and engScal != ''">
  1542. and t.ENG_SCAL = #{engScal}
  1543. </if>
  1544. ) w where 1=1
  1545. <if test="province != null and province != ''">and w.adm_div like '${province}%'</if>
  1546. <if test="adCode != null and adCode != ''">and ${adCode}</if>
  1547. ORDER BY
  1548. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  1549. ADM_DIV
  1550. </select>
  1551. <select id="getSapBaseListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.model.BisInspWagaSapRgstr">
  1552. select distinct * from (
  1553. SELECT
  1554. t.id AS id,
  1555. t.id AS code,
  1556. t.SAP_NAME AS nm,
  1557. t.AD_NAME as adName,
  1558. t.SAP_NAME AS sapName,
  1559. t.ad_code,
  1560. B.OBJ_ID,CASE WHEN B.CODE IS NULL then '' else '1' end state
  1561. FROM ATT_WAGA_SAP_BASE T
  1562. LEFT JOIN (select * FROM BIS_INSP_ALL_OBJ o where o.ptype = #{objType}) B ON T.id = B.CODE
  1563. WHERE T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  1564. ) w where 1=1
  1565. <if test="nm != null and nm != ''">
  1566. and sapName like '%${nm}%'
  1567. </if>
  1568. <if test="province != null and province != ''">and w.ad_code like '${province}%'</if>
  1569. <if test="adCode != null and adCode != ''">and ${adCode}</if>
  1570. ORDER BY
  1571. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  1572. ad_code
  1573. </select>
  1574. <select id="getEfpBaseListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  1575. select distinct * from (
  1576. SELECT
  1577. t.id AS id,
  1578. t.id as code,
  1579. t.Name as nm,
  1580. t.Name as name,
  1581. case when B.state is not null then B.state else '0' end state,
  1582. t.type,
  1583. t.PRO,
  1584. t.BAS,
  1585. t.ORG_ID,
  1586. t.ORD
  1587. FROM ATT_EFP_BASE T
  1588. LEFT JOIN (
  1589. SELECT a.ID, '1' as state
  1590. FROM ATT_EFP_BASE a
  1591. WHERE Exists (select code FROM BIS_INSP_ALL_OBJ o where o.code = a.id and o.ptype = #{objType})
  1592. ) B ON T.ID = B.ID
  1593. WHERE T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  1594. ) w
  1595. <where>
  1596. <if test="nm != null and nm != ''">
  1597. and NM like '%${nm}%'
  1598. </if>
  1599. <if test="type != null and type != ''">
  1600. and type = #{type}
  1601. </if>
  1602. </where>
  1603. </select>
  1604. <!-- <if test="orgId !=null and orgId !=''">-->
  1605. <!-- and ORG_ID like '${orgId}%'-->
  1606. <!-- </if>-->
  1607. <select id="getWintuBaseListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.model.BisInspWintRgstr">
  1608. select distinct * from (
  1609. SELECT
  1610. t.id AS id,
  1611. t.id as code,
  1612. t.WINT_NAME as nm,
  1613. t.WINT_NAME as name,
  1614. case when B.state is not null then B.state else '0' end state,
  1615. t.WAIN_TYPE wainIntType,
  1616. t.AD_CODE,
  1617. t.AD_NAME adName,
  1618. t.AD_NAME loc,
  1619. t.WIU_NAME bChkUnit,
  1620. t.WIU_CONTACT contact,
  1621. t.WIU_CONTACT_TEL contactTel,
  1622. t.WIU_PRINCIPAL principal,
  1623. t.WIU_PRINCIPAL_TEL principalTel
  1624. FROM ATT_WINT_BASE T
  1625. LEFT JOIN (
  1626. SELECT a.ID, '1' as state
  1627. FROM ATT_WINT_BASE a
  1628. WHERE Exists (select code FROM BIS_INSP_ALL_OBJ o where o.code = a.id and o.ptype = #{objType})
  1629. ) B ON T.ID = B.ID
  1630. WHERE T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  1631. ) w
  1632. where
  1633. 1=1
  1634. <if test="province !=null and province !=''">
  1635. and AD_CODE like '${province}%'
  1636. </if>
  1637. <if test="nm != null and nm != ''">
  1638. and NM like '%${nm}%'
  1639. </if>
  1640. <if test="type != null and type != ''">
  1641. and type = #{type}
  1642. </if>
  1643. <if test="adCode != null and adCode != ''">and ${adCode}</if>
  1644. </select>
  1645. <select id="getWuntuBaseListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.model.BisInspSvwtWuntRgstr">
  1646. select distinct * from (
  1647. SELECT
  1648. t.id AS id,
  1649. t.WINT_CODE as code,
  1650. t.WINT_NAME as nm,
  1651. t.WINT_NAME as name,
  1652. t.WAIN_TYPE wainIntType,
  1653. t.AD_CODE,
  1654. t.AD_NAME adName,
  1655. t.AD_NAME loc,
  1656. t.WIU_NAME bChkUnit,
  1657. t.WIU_CONTACT contact,
  1658. t.WIU_CONTACT_TEL contactTel,
  1659. t.WIU_PRINCIPAL principal,
  1660. t.WIU_PRINCIPAL_TEL principalTel,
  1661. B.OBJ_ID,CASE WHEN B.CODE IS NULL then '' else '1' end state
  1662. FROM ATT_WINT_BASE T
  1663. LEFT JOIN (select * FROM BIS_INSP_ALL_OBJ o where o.ptype = #{objType}) B ON T.id = B.CODE
  1664. WHERE T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  1665. ) w
  1666. where
  1667. 1=1
  1668. <if test="province !=null and province !=''">
  1669. and AD_CODE like '${province}%'
  1670. </if>
  1671. <if test="nm != null and nm != ''">
  1672. and NM like '%${nm}%'
  1673. </if>
  1674. <if test="type != null and type != ''">
  1675. and type = #{type}
  1676. </if>
  1677. <if test="adCode != null and adCode != ''">and ${adCode}</if>
  1678. </select>
  1679. <select id="getWtuntBaseListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  1680. select distinct * from (
  1681. SELECT
  1682. t.id AS id, t.id as code,
  1683. t.UT_NAME as nm,
  1684. t.ad_code, t.ad_name as adName,T.PRINCIPAL_TEL, T.NOTE,
  1685. B.OBJ_ID,CASE WHEN B.CODE IS NULL then '' else '1' end state,AD.AD_GRAD,
  1686. T.UT_TYPE type
  1687. FROM ATT_WTUNT_BASE T
  1688. LEFT JOIN (select * FROM BIS_INSP_ALL_OBJ o where o.ptype = #{objType}) B ON T.id = B.CODE
  1689. LEFT JOIN ATT_AD_BASE AD ON t.AD_CODE = AD.AD_CODE
  1690. WHERE
  1691. T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  1692. ) w
  1693. where 1=1
  1694. <if test="province !=null and province !=''">and ad_code like '${province}%'</if>
  1695. <if test="nm != null and nm != ''">and NM like '%${nm}%'</if>
  1696. <if test="adCode != null and adCode != ''">and ${adCode}</if>
  1697. <if test="type != null and type != ''">AND TYPE = #{type}</if>
  1698. <if test="adGrad != null and adGrad != ''">and AD_GRAD = #{adGrad}</if>
  1699. </select>
  1700. <select id="getWtgtBaseListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  1701. select distinct * from (
  1702. SELECT
  1703. B.OBJ_ID,CASE WHEN B.CODE IS NULL then '' else '1' end state, AD.AD_GRAD,
  1704. t.id AS id,
  1705. t.id as code,
  1706. t.DEP_NAME as nm,
  1707. t.AD_CODE, t.AD_NAME,
  1708. T.WINT_CODE,
  1709. T.DEP_PERS,
  1710. T.DEP_PERS_TEL,T.PRINCIPAL_TEL, T.NOTE,
  1711. T.LOC location
  1712. FROM ATT_WTGT_BASE T
  1713. LEFT JOIN (select * FROM BIS_INSP_ALL_OBJ o where o.ptype = #{objType}) B ON T.id = B.CODE
  1714. LEFT JOIN ATT_AD_BASE AD ON t.AD_CODE = AD.AD_CODE
  1715. WHERE T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  1716. ) w
  1717. <where>
  1718. <if test="province !=null and province !=''">
  1719. and ad_code like '${province}%'
  1720. </if>
  1721. <if test="nm != null and nm != ''">
  1722. and NM like '%${nm}%'
  1723. </if>
  1724. <if test="adCode != null and adCode != ''">and ${adCode}</if>
  1725. <if test="adGrad != null and adGrad != ''">and AD_GRAD = #{adGrad}</if>
  1726. </where>
  1727. </select>
  1728. <select id="getAdBaseMunicipalLevelListNotInspGroupIds" parameterType="cn.com.goldenwater.dcproj.param.InspObjParam"
  1729. resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  1730. select distinct *
  1731. from (
  1732. select
  1733. t.ad_code as id, t.ad_code as code, t.ad_name as nm, t.ad_full_name as location,
  1734. t.lgtd as gdX, t.lttd as gdY, t.ad_code, t.AD_GRAD,
  1735. t.ad_long as pcX,t.ad_lat as pcY
  1736. FROM ATT_AD_BASE T
  1737. LEFT JOIN
  1738. (select * FROM BIS_INSP_ALL_OBJ o where o.ptype = #{objType}) B ON T.AD_CODE = B.CODE
  1739. WHERE
  1740. T.ad_code NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  1741. <if test="province !=null and province !=''">
  1742. and t.ad_code like '${province}%'
  1743. </if>
  1744. ) w where w.AD_GRAD = '3'
  1745. <if test="nm != null and nm != ''">
  1746. and nm like '%${nm}%'
  1747. </if>
  1748. <if test="adCode != null and adCode != ''">and ${adCode}</if>
  1749. ORDER BY
  1750. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  1751. ad_code
  1752. </select>
  1753. <select id="getAdBaseCountyLevelListNotInspGroupIds" parameterType="cn.com.goldenwater.dcproj.param.InspObjParam"
  1754. resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  1755. select distinct *
  1756. from (
  1757. select
  1758. t.ad_code as id, t.ad_code as code, t.ad_name as nm, t.ad_full_name as location,
  1759. t.lgtd as gdX, t.lttd as gdY, t.ad_code, t.AD_GRAD,
  1760. t.ad_long as pcX,t.ad_lat as pcY
  1761. FROM ATT_AD_BASE T
  1762. LEFT JOIN
  1763. (select * FROM BIS_INSP_ALL_OBJ o where o.ptype = #{objType}) B ON T.AD_CODE = B.CODE
  1764. WHERE
  1765. T.ad_code NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  1766. <if test="province !=null and province !=''">
  1767. and t.ad_code like '${province}%'
  1768. </if>
  1769. ) w
  1770. where w.AD_GRAD = '4'
  1771. <if test="nm != null and nm != ''">
  1772. and nm like '%${nm}%'
  1773. </if>
  1774. <if test="adCode != null and adCode != ''">and ${adCode}</if>
  1775. ORDER BY
  1776. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  1777. ad_code
  1778. </select>
  1779. <select id="getRsListNotInGroup" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  1780. select distinct * from (
  1781. select t.rs_code as id,T.Rs_Code as code,t.rs_name as nm,
  1782. t.ENG_SCAL,t.build_stat,t.location,t.adm_div as
  1783. ad_code,t.adm_div_name as ad_name
  1784. ,B.OBJ_ID,
  1785. CASE WHEN B.CODE IS NULL then '' else '1' end state
  1786. from ATT_RS_BASE t
  1787. LEFT JOIN (select * FROM BIS_INSP_ALL_OBJ o where o.ptype = #{objType}) B ON T.RS_CODE = B.CODE
  1788. WHERE t.rs_code NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  1789. and t.build_stat in ('2','3')
  1790. ) w where 1=1
  1791. <if test="province !=null and province !=''">
  1792. and AD_CODE like '${province}%'
  1793. </if>
  1794. <if test="nm != null and nm != ''">
  1795. and NM like '%${nm}%'
  1796. </if>
  1797. <if test="adCode != null and adCode != ''">and ${adCode}</if>
  1798. <if test="engScal != null and engScal != ''"></if>
  1799. ORDER BY
  1800. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  1801. ad_code
  1802. </select>
  1803. <select id="getSamListNotInGroup" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  1804. select distinct * from (
  1805. select T.id,T.id as code,t.prj_name as nm,t.ad_code,t.ad_name,t.addr as location
  1806. ,B.OBJ_ID,CASE WHEN B.CODE IS NULL then '' else '1' end state
  1807. from ATT_SAMRMP_BASE T
  1808. LEFT JOIN (select * FROM BIS_INSP_ALL_OBJ o where o.ptype = #{objType}) B ON T.ID = B.CODE
  1809. WHERE t.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  1810. ) w where 1=1
  1811. <if test="province !=null and province !=''">
  1812. and AD_CODE like '${province}%'
  1813. </if>
  1814. <if test="nm != null and nm != ''">
  1815. and NM like '%${nm}%'
  1816. </if>
  1817. <if test="adCode != null and adCode != ''">and ${adCode}</if>
  1818. ORDER BY
  1819. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  1820. ad_code
  1821. </select>
  1822. <select id="getSupCdepListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  1823. select distinct * from (
  1824. SELECT
  1825. t.id AS id,
  1826. t.id AS code,
  1827. t.DEP_CODE as depCode,
  1828. t.DEP_NAME as nm,
  1829. t.AD_CODE as AD_CODE,
  1830. t.AD_NAME as adName,
  1831. t.LOC as location,
  1832. t.PRINCIPAL principal,
  1833. t.CONTACT as depPers,
  1834. B.OBJ_ID,CASE WHEN B.CODE IS NULL then '' else '1' end state
  1835. FROM ATT_CDEP_BASE T
  1836. LEFT JOIN (select * FROM BIS_INSP_ALL_OBJ o where o.ptype = #{objType}) B ON T.id = B.CODE
  1837. WHERE T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  1838. ) w
  1839. where
  1840. 1=1
  1841. <if test="province !=null and province !=''">
  1842. and AD_CODE like '${province}%'
  1843. </if>
  1844. <if test="nm != null and nm != ''">
  1845. and nm like '%${nm}%'
  1846. </if>
  1847. <if test="adCode != null and adCode != ''">and ${adCode}</if>
  1848. ORDER BY
  1849. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  1850. ad_code
  1851. </select>
  1852. <select id="getSupBidListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  1853. select distinct * from (
  1854. SELECT
  1855. t.id AS id,
  1856. t.id AS code,
  1857. t.BID_CODE as bidCode,
  1858. t.BID_NAME as nm,
  1859. t.AD_CODE as AD_CODE,
  1860. t.AD_NAME as adName,
  1861. t.LOC as location,
  1862. t.LEGAL_PERS as legalPers,
  1863. t.CONTACT as depPers,
  1864. B.OBJ_ID,CASE WHEN B.CODE IS NULL then '' else '1' end state
  1865. FROM ATT_BID_BASE T
  1866. LEFT JOIN (select * FROM BIS_INSP_ALL_OBJ o where o.ptype = #{objType}) B ON T.id = B.CODE
  1867. WHERE T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  1868. ) w
  1869. where
  1870. 1=1
  1871. <if test="province !=null and province !=''">
  1872. and AD_CODE like '${province}%'
  1873. </if>
  1874. <if test="nm != null and nm != ''">
  1875. and nm like '%' || #{nm} || '%'
  1876. </if>
  1877. <if test="adCode != null and adCode != ''">and ${adCode}</if>
  1878. ORDER BY
  1879. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  1880. ad_code
  1881. </select>
  1882. <select id="getSupRlrwListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  1883. select distinct * from (
  1884. SELECT
  1885. t.LAND_CODE AS id,
  1886. t.LAND_CODE AS code,
  1887. t.LAND_NAME as nm,
  1888. t.AD_CODE as AD_CODE,
  1889. t.AD_NAME as adName,
  1890. t.CONTACT as depPers,
  1891. B.OBJ_ID,CASE WHEN B.CODE IS NULL then '' else '1' end state
  1892. FROM ATT_RLRW_BASE T
  1893. LEFT JOIN (select * FROM BIS_INSP_ALL_OBJ o where o.ptype = #{objType}) B ON T.LAND_CODE = B.CODE
  1894. WHERE T.LAND_CODE NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  1895. ) w
  1896. where
  1897. 1=1
  1898. <if test="province !=null and province !=''">
  1899. and AD_CODE like '${province}%'
  1900. </if>
  1901. <if test="nm != null and nm != ''">
  1902. and nm like '%${depName}%'
  1903. </if>
  1904. <if test="adCode != null and adCode != ''">and ${adCode}</if>
  1905. ORDER BY
  1906. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  1907. ad_code
  1908. </select>
  1909. <select id="getSupDrdmpListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  1910. select distinct * from (
  1911. SELECT
  1912. t.id AS code,
  1913. t.DEP_NAME as nm,
  1914. t.LOC as location,
  1915. case when B.state is not null then B.state else '0' end state,
  1916. t.DEP_NAME,
  1917. t.AD_CODE,
  1918. t.AD_NAME,
  1919. t.WINT_CODE,
  1920. t.LOC
  1921. FROM ATT_DEP_BASE T
  1922. LEFT JOIN (
  1923. SELECT a.ID, '1' as state FROM ATT_DEP_BASE a
  1924. WHERE Exists (select code FROM BIS_INSP_ALL_OBJ o where o.code = a.id and o.ptype = #{objType})
  1925. ) B ON T.ID = B.ID
  1926. WHERE T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  1927. ) w
  1928. <where>
  1929. <if test="province !=null and province !=''">
  1930. and AD_CODE like '${province}%'
  1931. </if>
  1932. <if test="nm != null and nm != ''">
  1933. and nm like '%' || #{nm} || '%'
  1934. </if>
  1935. <if test="adCode != null and adCode != ''">
  1936. and ${adCode}
  1937. </if>
  1938. </where>
  1939. ORDER BY
  1940. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  1941. ad_code
  1942. </select>
  1943. <select id="getSupGrowListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  1944. select distinct * from (
  1945. SELECT
  1946. t.id AS id,
  1947. case when B.state is not null then B.state else '0' end state,
  1948. t.id AS code,
  1949. t.WELL_NAME AS nm,
  1950. t.AD_CODE as AD_CODE,
  1951. t.AD_NAME as adName,
  1952. t.CONTACT as depPers,
  1953. t.well_type as type
  1954. FROM ATT_GROW_BASE T
  1955. LEFT JOIN (
  1956. SELECT a.ID, '1' as state
  1957. FROM ATT_GROW_BASE a
  1958. WHERE Exists (select code FROM BIS_INSP_ALL_OBJ o where o.code = a.id and o.ptype = #{objType})
  1959. ) B ON T.ID = B.ID
  1960. WHERE T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  1961. ) w
  1962. where
  1963. 1=1
  1964. <if test="province !=null and province !=''">
  1965. and AD_CODE like '${province}%'
  1966. </if>
  1967. <if test="nm != null and nm != ''">
  1968. and nm like '%${nm}%'
  1969. </if>
  1970. <if test="type != null and type != ''">
  1971. and w.type = #{type}
  1972. </if>
  1973. <if test="adCode != null and adCode != ''">and ${adCode}</if>
  1974. ORDER BY
  1975. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  1976. ad_code
  1977. </select>
  1978. <select id="getSupFundListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  1979. select distinct * from (
  1980. SELECT
  1981. t.id AS id,
  1982. case when B.state is not null then B.state else '0' end state,
  1983. t.id AS code,
  1984. t.Proj_Name AS nm,
  1985. t.AD_CODE as AD_CODE,
  1986. t.AD_NAME as adName,
  1987. t.plan_funds as planFunds,
  1988. decode(t.Proj_Type,1,'中小河流治理',2,'新建小型水库',3,'中型灌区',4,'水土保持',5,'山洪灾害防治',6,'农村饮水工程维修养护',7,'小型水库维修养护',8,'山洪灾害防治设施维修养护项目',9,'农业水价综合改革',10,'大中型水库移民',11,'其他')
  1989. as type
  1990. FROM ATT_FUND_BASE T
  1991. LEFT JOIN (
  1992. SELECT a.ID, '1' as state
  1993. FROM ATT_FUND_BASE a
  1994. WHERE Exists (select code FROM BIS_INSP_ALL_OBJ o where o.code = a.id and o.ptype = #{objType})
  1995. ) B ON T.ID = B.ID
  1996. WHERE T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  1997. ) w
  1998. where
  1999. 1=1
  2000. <if test="province !=null and province !=''">
  2001. and AD_CODE like '${province}%'
  2002. </if>
  2003. <if test="nm != null and nm != ''">
  2004. and nm like '%${nm}%'
  2005. </if>
  2006. <if test="type != null and type != ''">
  2007. and w.type = #{type}
  2008. </if>
  2009. <if test="adCode != null and adCode != ''">and ${adCode}</if>
  2010. ORDER BY
  2011. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  2012. ad_code
  2013. </select>
  2014. <select id="getSupWiuqhListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  2015. select distinct * from (
  2016. SELECT
  2017. t.id AS code,
  2018. t.NM,
  2019. t.LOC as location,
  2020. case when B.state is not null then B.state else '0' end state,
  2021. t.AD_CODE, t.AD_NAME, t.APP_NO, t.WT_APP_NO,
  2022. t.APP_DEP, t.WT_TYPE, t.WT_MSR, t.WT_TM,
  2023. t.WT_SUR, t.WT_USR, t.DEP_PERS, t.PERS_PHONE,
  2024. t.DEP_CNT_PERS, t.DEP_CNT_PERS_PHONE, t.NOTE,
  2025. t.CENTER_X, t.CENTER_Y,
  2026. t.GD_X, t.GD_Y, t.INTM, t.UPTM, t.DATA_STAT
  2027. FROM ATT_WIUQH_BASE T
  2028. LEFT JOIN (
  2029. SELECT a.ID, '1' as state
  2030. FROM ATT_WIUQH_BASE a
  2031. WHERE Exists (select code FROM BIS_INSP_ALL_OBJ o where o.code = a.id and o.ptype = #{objType})
  2032. ) B ON T.ID = B.ID
  2033. WHERE
  2034. T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  2035. ) w
  2036. <where>
  2037. <if test="province !=null and province !=''">
  2038. and AD_CODE like '${province}%'
  2039. </if>
  2040. <if test="nm != null and nm != ''">
  2041. and nm like '%' || #{nm} || '%'
  2042. </if>
  2043. <if test="adCode != null and adCode != ''">
  2044. and ${adCode}
  2045. </if>
  2046. </where>
  2047. ORDER BY
  2048. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  2049. ad_code
  2050. </select>
  2051. <select id="getSafetyListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  2052. select distinct * from (
  2053. SELECT
  2054. t.id,
  2055. t.id AS code,
  2056. t.NAME AS NM,
  2057. t.LOC as location,
  2058. case when B.state is not null then B.state else '0' end state,
  2059. t.NAME,
  2060. t.MG_PERS,
  2061. t.MG_PERS_TEL,
  2062. t.AD_CODE,
  2063. t.AD_NAME,
  2064. t.LOC,
  2065. t.NOTE,
  2066. t.CENTER_X,
  2067. t.CENTER_Y,
  2068. t.GD_X,
  2069. t.GD_Y,
  2070. t.INTM,
  2071. t.UPTM,
  2072. t.DATA_STAT
  2073. FROM ATT_SAFETY_BASE T
  2074. LEFT JOIN (
  2075. SELECT a.ID, '1' as state
  2076. FROM ATT_SAFETY_BASE a
  2077. WHERE Exists (select code FROM BIS_INSP_ALL_OBJ o where o.code = a.id and o.ptype = #{objType})
  2078. ) B ON T.ID = B.ID
  2079. WHERE
  2080. T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  2081. ) w
  2082. <where>
  2083. <if test="province !=null and province !=''">
  2084. and AD_CODE like '${province}%'
  2085. </if>
  2086. <if test="nm != null and nm != ''">
  2087. and nm like '%' || #{nm} || '%'
  2088. </if>
  2089. <if test="adCode != null and adCode != ''">
  2090. and ${adCode}
  2091. </if>
  2092. </where>
  2093. ORDER BY
  2094. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  2095. ad_code
  2096. </select>
  2097. <select id="getYndepListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  2098. select distinct * from (
  2099. SELECT
  2100. t.id AS code,
  2101. t.AD_NAME AS NM,
  2102. t.LOC as location,
  2103. REPLACE(A.AD_FULL_NAME, '-', '') AS AD_FULL_NAME,
  2104. case when B.state is not null then B.state else '0' end state,
  2105. t.DEP_NAME,
  2106. t.UT_LEAD,
  2107. t.PRINCIPAL_TEL,
  2108. t.DEP_PERS,
  2109. t.DEP_PERS_TEL,
  2110. t.AD_CODE,
  2111. t.AD_NAME,
  2112. t.LOC,
  2113. t.NOTE,
  2114. t.CENTER_X,
  2115. t.CENTER_Y,
  2116. t.GD_X,
  2117. t.GD_Y,
  2118. t.INTM,
  2119. t.UPTM,
  2120. t.DATA_STAT
  2121. FROM ATT_YNDEP_BASE T
  2122. LEFT JOIN ATT_AD_BASE A ON A.AD_CODE = T.AD_CODE
  2123. LEFT JOIN (
  2124. SELECT a.ID, '1' as state
  2125. FROM ATT_YNDEP_BASE a
  2126. WHERE Exists (select code FROM BIS_INSP_ALL_OBJ o where o.code = a.id and o.ptype = #{objType})
  2127. ) B ON T.ID = B.ID
  2128. WHERE
  2129. T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  2130. ) w
  2131. <where>
  2132. <if test="province !=null and province !=''">
  2133. and AD_CODE like '${province}%'
  2134. </if>
  2135. <if test="nm != null and nm != ''">
  2136. and nm like '%' || #{nm} || '%'
  2137. </if>
  2138. <if test="adCode != null and adCode != ''">
  2139. and ${adCode}
  2140. </if>
  2141. </where>
  2142. ORDER BY
  2143. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  2144. ad_code
  2145. </select>
  2146. <select id="getRvgmListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  2147. select distinct * from (
  2148. SELECT
  2149. t.id AS code,
  2150. t.DEP_NAME AS NM,
  2151. t.LOC as location,
  2152. A.AD_FULL_NAME,
  2153. case when B.state is not null then B.state else '0' end state,
  2154. t.DEP_NAME,
  2155. t.UT_LEAD,
  2156. t.PRINCIPAL_TEL,
  2157. t.DEP_PERS,
  2158. t.DEP_PERS_TEL,
  2159. t.AD_CODE,
  2160. t.AD_NAME,
  2161. t.LOC,
  2162. t.NOTE,
  2163. t.CENTER_X,
  2164. t.CENTER_Y,
  2165. t.GD_X,
  2166. t.GD_Y,
  2167. t.INTM,
  2168. t.UPTM,
  2169. t.DATA_STAT
  2170. FROM ATT_RVGM_BASE T
  2171. LEFT JOIN ATT_AD_BASE A ON A.AD_CODE = T.AD_CODE
  2172. LEFT JOIN (
  2173. SELECT a.ID, '1' as state
  2174. FROM ATT_RVGM_BASE a
  2175. WHERE Exists (select code FROM BIS_INSP_ALL_OBJ o where o.code = a.id and o.ptype = #{objType})
  2176. ) B ON T.ID = B.ID
  2177. WHERE
  2178. T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  2179. ) w
  2180. <where>
  2181. <if test="province !=null and province !=''">
  2182. and AD_CODE like '${province}%'
  2183. </if>
  2184. <if test="nm != null and nm != ''">
  2185. and nm like '%' || #{nm} || '%'
  2186. </if>
  2187. <if test="adCode != null and adCode != ''">
  2188. and ${adCode}
  2189. </if>
  2190. </where>
  2191. ORDER BY
  2192. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  2193. ad_code
  2194. </select>
  2195. <select id="getDpgmListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  2196. SELECT DISTINCT * FROM (
  2197. SELECT
  2198. T.ID AS CODE,
  2199. T.NM,
  2200. T.LOC AS LOCATION,
  2201. A.AD_FULL_NAME,
  2202. case when B.state is not null then B.state else '0' end STATE,
  2203. T.ID,
  2204. T.RV_PERS,
  2205. T.GM_DUTIES,
  2206. T.RV_PERS_TEL,
  2207. T.PERS_ID,
  2208. T.AD_CODE,
  2209. T.AD_NAME,
  2210. T.LOC,
  2211. T.NOTE,
  2212. T.CENTER_X,
  2213. T.CENTER_Y,
  2214. T.GD_X,
  2215. T.GD_Y,
  2216. T.INTM,
  2217. T.UPTM,
  2218. T.DATA_STAT
  2219. FROM ATT_DPGM_BASE T
  2220. LEFT JOIN ATT_AD_BASE A ON A.AD_CODE = T.AD_CODE
  2221. LEFT JOIN (
  2222. SELECT a.ID, '1' as state
  2223. FROM ATT_DPGM_BASE a
  2224. WHERE Exists (select code FROM BIS_INSP_ALL_OBJ o where o.code = a.id and o.ptype = #{objType})
  2225. ) B ON T.ID = B.ID
  2226. WHERE
  2227. T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  2228. ) w
  2229. <where>
  2230. <if test="province !=null and province !=''">
  2231. and AD_CODE like '${province}%'
  2232. </if>
  2233. <if test="nm != null and nm != ''">
  2234. and nm like '%' || #{nm} || '%'
  2235. </if>
  2236. <if test="adCode != null and adCode != ''">
  2237. and ${adCode}
  2238. </if>
  2239. </where>
  2240. ORDER BY
  2241. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  2242. ad_code
  2243. </select>
  2244. <select id="getWtprjListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  2245. SELECT DISTINCT * FROM (
  2246. SELECT
  2247. T.ID AS CODE,
  2248. T.NM,
  2249. T.LOC AS LOCATION,
  2250. A.AD_FULL_NAME,
  2251. case when B.state is not null then B.state else '0' end STATE,
  2252. T.ID,
  2253. T.PRJ_TYPE,
  2254. T.PRJ_CTGY,
  2255. T.PRJ_RISK,
  2256. T.AD_CODE,
  2257. T.AD_NAME,
  2258. T.LOC,
  2259. T.NOTE,
  2260. T.CENTER_X,
  2261. T.CENTER_Y,
  2262. T.GD_X,
  2263. T.GD_Y,
  2264. T.INTM,
  2265. T.UPTM,
  2266. T.DATA_STAT
  2267. FROM ATT_WTPRJ_BASE T
  2268. LEFT JOIN ATT_AD_BASE A ON A.AD_CODE = T.AD_CODE
  2269. LEFT JOIN (
  2270. SELECT a.ID, '1' as state
  2271. FROM ATT_WTPRJ_BASE a
  2272. WHERE Exists (SELECT CODE FROM BIS_INSP_ALL_OBJ O WHERE O.CODE = A.ID AND O.PTYPE = #{objType})
  2273. ) B ON T.ID = B.ID
  2274. WHERE
  2275. T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  2276. ) w
  2277. <where>
  2278. <if test="province !=null and province !=''">
  2279. and AD_CODE like '${province}%'
  2280. </if>
  2281. <if test="nm != null and nm != ''">
  2282. and nm like '%' || #{nm} || '%'
  2283. </if>
  2284. <if test="adCode != null and adCode != ''">
  2285. and ${adCode}
  2286. </if>
  2287. </where>
  2288. ORDER BY
  2289. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  2290. ad_code
  2291. </select>
  2292. <select id="getUnwtListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  2293. SELECT DISTINCT * FROM (
  2294. SELECT
  2295. T.ID AS CODE,
  2296. T.NM,
  2297. T.LOC AS LOCATION,
  2298. A.AD_FULL_NAME,
  2299. case when B.state is not null then B.state else '0' end AS STATE,
  2300. T.ID,
  2301. T.AD_CODE,
  2302. T.AD_NAME,
  2303. T.LOC,
  2304. T.CENTER_X,
  2305. T.CENTER_Y,
  2306. T.GD_X,
  2307. T.GD_Y,
  2308. T.INTM,
  2309. T.UPTM,
  2310. T.DATA_STAT
  2311. FROM ATT_UNWT_BASE T
  2312. LEFT JOIN ATT_AD_BASE A ON A.AD_CODE = T.AD_CODE
  2313. LEFT JOIN (
  2314. SELECT a.ID, '1' as state
  2315. FROM ATT_UNWT_BASE a
  2316. WHERE Exists (SELECT CODE FROM BIS_INSP_ALL_OBJ O WHERE O.CODE = A.ID AND O.PTYPE = #{objType})
  2317. ) B ON T.ID = B.ID
  2318. WHERE
  2319. T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  2320. ) w
  2321. <where>
  2322. <if test="province !=null and province !=''">
  2323. and AD_CODE like '${province}%'
  2324. </if>
  2325. <if test="nm != null and nm != ''">
  2326. and nm like '%' || #{nm} || '%'
  2327. </if>
  2328. <if test="adCode != null and adCode != ''">
  2329. and ${adCode}
  2330. </if>
  2331. </where>
  2332. ORDER BY
  2333. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  2334. ad_code
  2335. </select>
  2336. <select id="getFloodqhListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  2337. SELECT DISTINCT * FROM (
  2338. SELECT
  2339. T.ID AS CODE,
  2340. T.LOC AS LOCATION,
  2341. A.AD_FULL_NAME,
  2342. case when B.state is not null then B.state else '0' end STATE,
  2343. T.ID,
  2344. T.NM,
  2345. T.FLOOD_TYPE,
  2346. T.AD_CODE,
  2347. T.AD_NAME,
  2348. T.LOC,
  2349. T.CENTER_X,
  2350. T.CENTER_Y,
  2351. T.GD_X,
  2352. T.GD_Y,
  2353. T.INTM,
  2354. T.UPTM,
  2355. T.DATA_STAT
  2356. FROM ATT_FLOODQH_BASE T
  2357. LEFT JOIN ATT_AD_BASE A ON A.AD_CODE = T.AD_CODE
  2358. LEFT JOIN (
  2359. SELECT a.ID, '1' as state
  2360. FROM ATT_FLOODQH_BASE a
  2361. WHERE Exists (SELECT CODE FROM BIS_INSP_ALL_OBJ O WHERE O.CODE = A.ID AND O.PTYPE = #{objType})
  2362. ) B ON T.ID = B.ID
  2363. WHERE
  2364. T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  2365. ) w
  2366. <where>
  2367. <if test="province !=null and province !=''">
  2368. and AD_CODE like '${province}%'
  2369. </if>
  2370. <if test="nm != null and nm != ''">
  2371. and nm like '%' || #{nm} || '%'
  2372. </if>
  2373. <if test="adCode != null and adCode != ''">
  2374. and ${adCode}
  2375. </if>
  2376. </where>
  2377. ORDER BY
  2378. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  2379. ad_code
  2380. </select>
  2381. <select id="getDstfldqhListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  2382. SELECT DISTINCT * FROM (
  2383. SELECT
  2384. T.ID AS CODE,
  2385. T.LOC AS LOCATION,
  2386. A.AD_FULL_NAME,
  2387. case when B.state is not null then B.state else '0' end STATE,
  2388. T.ID,
  2389. T.NM,
  2390. T.NM AS NAME,
  2391. T.PRJT_TYPE AS PRJ_TYPE,
  2392. T.AD_CODE,
  2393. T.AD_NAME,
  2394. T.LOC,
  2395. T.UNIT,
  2396. T.CONTENT,
  2397. T.NOTE,
  2398. T.CENTER_X,
  2399. T.CENTER_Y,
  2400. T.GD_X,
  2401. T.GD_Y,
  2402. T.INTM,
  2403. T.UPTM,
  2404. T.DATA_STAT
  2405. FROM ATT_DSTFLDQH_BASE T
  2406. LEFT JOIN ATT_AD_BASE A ON A.AD_CODE = T.AD_CODE
  2407. LEFT JOIN (
  2408. SELECT a.ID, '1' as state
  2409. FROM ATT_DSTFLDQH_BASE a
  2410. WHERE Exists (SELECT CODE FROM BIS_INSP_ALL_OBJ O WHERE O.CODE = A.ID AND O.PTYPE = #{objType})
  2411. ) B ON T.ID = B.ID
  2412. WHERE
  2413. T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  2414. ) w
  2415. <where>
  2416. <if test="province !=null and province !=''">
  2417. and AD_CODE like '${province}%'
  2418. </if>
  2419. <if test="nm != null and nm != ''">
  2420. and nm like '%' || #{nm} || '%'
  2421. </if>
  2422. <if test="adCode != null and adCode != ''">
  2423. and ${adCode}
  2424. </if>
  2425. </where>
  2426. ORDER BY
  2427. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  2428. ad_code
  2429. </select>
  2430. <select id="getAddAxListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.AttSupAdBase">
  2431. select distinct * from (
  2432. SELECT A.GUID,
  2433. A.AD_CODE code,
  2434. A.AD_NAME name,
  2435. A.LOW_LEFT_LONG,
  2436. A.LOW_LEFT_LAT,
  2437. A.UP_RIGHT_LONG,
  2438. A.UP_RIGHT_LAT,
  2439. A.UP_AD_NAME,
  2440. A.AD_GRAD,
  2441. A.AD_ABBR_NAME,
  2442. A.AD_STAT,
  2443. A.AD_AREA,
  2444. A.AD_FULL_NAME,
  2445. A.NOTE,
  2446. A.EFF_DATE,
  2447. A.EXPR_DATE,
  2448. A.AD_STAT_LONG,
  2449. A.AD_STAT_LAT,
  2450. A.DOMAIN_CODE,
  2451. A.AD_SIGN,
  2452. A.MODIFIER_PEOPLE,
  2453. A.UPD_DATE,
  2454. A.IS_REPORT,
  2455. A.AD_FCODE,
  2456. (case when A.IS_POVERYT is null then '0' else A.IS_POVERYT end) IS_POVERYT,
  2457. A.SRC,
  2458. A.REMARK,
  2459. A.AD_LONG,
  2460. A.AD_LAT,
  2461. A.LGTD,
  2462. A.LTTD,
  2463. A.LGTDPC,
  2464. A.LTTDPC
  2465. FROM ATT_AD_BASE A
  2466. WHERE A.AD_GRAD='4'
  2467. AND A.AD_CODE IN (SELECT DISTINCT T.AD_CODE FROM ATT_HYST_BASE T WHERE T.AD_CODE IS NOT NULL)
  2468. AND A.AD_CODE NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%')
  2469. <if test="province !=null and province !=''">and ad_code like '${province}%'</if>
  2470. )
  2471. <if test="adName != null and adName != ''">and A.AD_NAME LIKE '%${adName}%'</if>
  2472. <if test="nm != null and nm != ''">and AD_NAME like '%${nm}%'</if>
  2473. <if test="adCode != null and adCode != ''">and ${adCode}</if>
  2474. <if test="isPkx != null and isPkx != ''">and A.IS_POVERYT =#{isPkx}</if>
  2475. ORDER BY
  2476. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  2477. AD_CODE
  2478. ) w
  2479. </select>
  2480. <select id="getStstnListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  2481. SELECT DISTINCT * FROM (
  2482. SELECT
  2483. T.ID AS CODE,
  2484. T.LOC AS LOCATION,
  2485. A.AD_FULL_NAME,
  2486. case when B.state is not null then B.state else '0' end STATE,
  2487. T.ID,
  2488. T.NM,
  2489. T.NM AS NAME,
  2490. T.PRJC_TYPE AS PRJ_TYPE,
  2491. T.AD_CODE,
  2492. T.AD_NAME,
  2493. T.LOC,
  2494. T.COST,
  2495. T.COST_YEAR,
  2496. T.MGR,
  2497. T.OWNER,
  2498. T.QUALITY,
  2499. T.DESIGN,
  2500. T.SUPERVISOR,
  2501. T.BUILD,
  2502. T.PRJC_PERS,
  2503. T.PRJC_PRES_TEL,
  2504. T.CENTER_X,
  2505. T.CENTER_Y,
  2506. T.GD_X,
  2507. T.GD_Y,
  2508. T.INTM,
  2509. T.UPTM,
  2510. T.DATA_STAT
  2511. FROM ATT_STSTN_BASE T
  2512. LEFT JOIN ATT_AD_BASE A ON A.AD_CODE = T.AD_CODE
  2513. LEFT JOIN (
  2514. SELECT a.ID, '1' as state
  2515. FROM ATT_STSTN_BASE a
  2516. WHERE Exists (SELECT CODE FROM BIS_INSP_ALL_OBJ O WHERE O.CODE = A.ID AND O.PTYPE = #{objType})
  2517. ) B ON T.ID = B.ID
  2518. WHERE
  2519. T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  2520. ) w
  2521. <where>
  2522. <if test="province !=null and province !=''">
  2523. and AD_CODE like '${province}%'
  2524. </if>
  2525. <if test="nm != null and nm != ''">
  2526. and nm like '%' || #{nm} || '%'
  2527. </if>
  2528. <if test="adCode != null and adCode != ''">
  2529. and ${adCode}
  2530. </if>
  2531. </where>
  2532. ORDER BY
  2533. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  2534. ad_code
  2535. </select>
  2536. <select id="getGnrlListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  2537. SELECT DISTINCT * FROM (
  2538. SELECT
  2539. T.ID AS CODE,
  2540. T.LOC AS LOCATION,
  2541. A.AD_FULL_NAME,
  2542. T.SECT_NAME,
  2543. case when B.state is not null then B.state else '0' end STATE,
  2544. T.ID,
  2545. T.NM,
  2546. T.NM AS NAME,
  2547. T.AD_CODE,
  2548. T.AD_NAME,
  2549. T.LOC,
  2550. T.NOTE,
  2551. T.CENTER_X, T.CENTER_Y, T.GD_X, T.GD_Y, T.INTM, T.UPTM, T.OBJ_TYPE
  2552. FROM ATT_GNRL_BASE T
  2553. LEFT JOIN ATT_AD_BASE A ON A.AD_CODE = T.AD_CODE
  2554. LEFT JOIN (
  2555. SELECT a.ID, '1' as state
  2556. FROM ATT_GNRL_BASE a
  2557. WHERE Exists (SELECT CODE FROM BIS_INSP_ALL_OBJ O WHERE O.CODE = A.ID AND O.PTYPE = #{objType})
  2558. ) B ON T.ID = B.ID
  2559. WHERE
  2560. T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  2561. ) w
  2562. <where>
  2563. <if test="province !=null and province !=''">
  2564. and AD_CODE like '${province}%'
  2565. </if>
  2566. <if test="nm != null and nm != ''">
  2567. and nm like '%' || #{nm} || '%'
  2568. </if>
  2569. <if test="adCode != null and adCode != ''">
  2570. and ${adCode}
  2571. </if>
  2572. <if test="type != null and type != ''">
  2573. and OBJ_TYPE = #{type}
  2574. </if>
  2575. </where>
  2576. ORDER BY
  2577. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  2578. ad_code
  2579. </select>
  2580. <select id="getSwhsjsListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  2581. SELECT DISTINCT * FROM (
  2582. SELECT
  2583. T.ID AS CODE, T.WAIN_LOC AS LOCATION, A.AD_FULL_NAME,
  2584. case when B.state is not null then B.state else '0' end STATE, T.ID,
  2585. T.SWHS_NAME AS NM,
  2586. T.SWHS_NAME AS NAME,
  2587. T.AD_CODE,
  2588. T.AD_NAME,
  2589. T.NOTE,
  2590. T.CENTER_X,
  2591. T.CENTER_Y,
  2592. T.GD_X,
  2593. T.GD_Y,
  2594. T.INTM,
  2595. T.UPTM,
  2596. T.DATA_STAT,
  2597. T.SWHS_CODE,
  2598. T.SWHS_NAME,
  2599. T.WAIN_WASO_TYPE,
  2600. T.SWHS_USE,
  2601. T.SWHS_LEVEL,
  2602. T.WAIN_LOC,
  2603. T.INS_NAME,
  2604. T.INS_PER,
  2605. T.INS_PER_PHONE,
  2606. T.DEPT,
  2607. T.DEPT_PER,
  2608. T.DEPT_PER_PHONE
  2609. FROM ATT_SWHSJS_BASE T
  2610. LEFT JOIN ATT_AD_BASE A ON A.AD_CODE = T.AD_CODE
  2611. LEFT JOIN (
  2612. SELECT a.ID, '1' as state
  2613. FROM ATT_SWHSJS_BASE a
  2614. WHERE Exists (SELECT CODE FROM BIS_INSP_ALL_OBJ O WHERE O.CODE = A.ID AND O.PTYPE = #{objType})
  2615. ) B ON T.ID = B.ID
  2616. WHERE
  2617. T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  2618. ) w
  2619. <where>
  2620. <if test="province !=null and province !=''">
  2621. and AD_CODE like '${province}%'
  2622. </if>
  2623. <if test="nm != null and nm != ''">
  2624. and nm like '%' || #{nm} || '%'
  2625. </if>
  2626. <if test="adCode != null and adCode != ''">
  2627. and ${adCode}
  2628. </if>
  2629. </where>
  2630. ORDER BY
  2631. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  2632. ad_code
  2633. </select>
  2634. <select id="getRsvrSdListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  2635. SELECT DISTINCT * FROM (
  2636. SELECT
  2637. T.rs_code AS CODE, T.LOCATION AS LOCATION, A.AD_FULL_NAME,
  2638. case when B.state is not null then B.state else '0' end STATE, T.rs_code ID,
  2639. T.rs_name AS NM,
  2640. T.rs_name AS RS_NAME,
  2641. T.rs_name AS NAME,
  2642. T.adm_div AD_CODE,
  2643. T.location AD_NAME,
  2644. T.CENTER_X,
  2645. T.CENTER_Y,
  2646. T.CENTER_X_GD GD_X ,
  2647. T.CENTER_Y_GD GD_Y
  2648. FROM att_rs_base T
  2649. LEFT JOIN ATT_AD_BASE A ON A.AD_CODE = T.adm_div
  2650. LEFT JOIN (
  2651. SELECT a.rs_code , '1' as state
  2652. FROM att_rs_base a
  2653. WHERE Exists (SELECT CODE FROM BIS_INSP_ALL_OBJ O WHERE O.CODE = A.rs_code AND O.PTYPE = #{objType})
  2654. ) B ON T.rs_code = B.rs_code
  2655. WHERE
  2656. T.rs_code NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  2657. ) w
  2658. <where>
  2659. <if test="province !=null and province !=''">
  2660. and AD_CODE like '${province}%'
  2661. </if>
  2662. <if test="nm != null and nm != ''">
  2663. and nm like '%' || #{nm} || '%'
  2664. </if>
  2665. <if test="adCode != null and adCode != ''">
  2666. and ${adCode}
  2667. </if>
  2668. </where>
  2669. ORDER BY
  2670. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  2671. ad_code
  2672. </select>
  2673. <select id="getXsdyhglListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  2674. SELECT DISTINCT * FROM (
  2675. SELECT
  2676. T . ID AS CODE,
  2677. T .LOC AS LOCATION,
  2678. A .AD_FULL_NAME,
  2679. case when B.state is not null then B.state else '0' end STATE,
  2680. T . ID,
  2681. T .NM AS NM,
  2682. T .NM AS NAME,
  2683. T .AD_CODE,
  2684. T .AD_NAME,
  2685. T .NOTE,
  2686. T .CENTER_X,
  2687. T .CENTER_Y,
  2688. T .GD_X,
  2689. T .GD_Y,
  2690. T .INTM,
  2691. T .UPTM,
  2692. T .DATA_STAT
  2693. FROM ATT_HYSTP_BASE T
  2694. LEFT JOIN ATT_AD_BASE A ON A.AD_CODE = T.AD_CODE
  2695. LEFT JOIN (
  2696. SELECT a.ID, '1' as state
  2697. FROM ATT_HYSTP_BASE a
  2698. WHERE Exists (SELECT CODE FROM BIS_INSP_ALL_OBJ O WHERE O.CODE = A.ID AND O.PTYPE = #{objType})
  2699. ) B ON T.ID = B.ID
  2700. WHERE
  2701. T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  2702. ) w
  2703. <where>
  2704. <if test="province !=null and province !=''">
  2705. and AD_CODE like '${province}%'
  2706. </if>
  2707. <if test="nm != null and nm != ''">
  2708. and nm like '%' || #{nm} || '%'
  2709. </if>
  2710. <if test="adCode != null and adCode != ''">
  2711. and ${adCode}
  2712. </if>
  2713. </where>
  2714. ORDER BY
  2715. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  2716. ad_code
  2717. </select>
  2718. <select id="getRdwpGdListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  2719. SELECT DISTINCT *
  2720. FROM (
  2721. SELECT T.ID AS CODE
  2722. , T.SITE_OF_PRJ AS LOCATION
  2723. , A.AD_FULL_NAME
  2724. , case when B.state is not null then B.state else '0' end STATE
  2725. , T.ID
  2726. , T.PRJ_NAME AS NM
  2727. , T.PRJ_NAME AS NAME
  2728. , T.PRJ_TYPE
  2729. , T.AD_CODE
  2730. , T.AD_NAME
  2731. , T.INTM
  2732. , T.UPTM
  2733. , T.DATA_STAT
  2734. FROM ATT_RDWPGD_BASE T
  2735. LEFT JOIN ATT_AD_BASE A ON A.AD_CODE = T.AD_CODE
  2736. LEFT JOIN (
  2737. SELECT a.ID, '1' AS state
  2738. FROM ATT_RDWPGD_BASE a
  2739. WHERE EXISTS(
  2740. SELECT CODE
  2741. FROM BIS_INSP_ALL_OBJ O
  2742. WHERE O.CODE = A.ID
  2743. AND O.PTYPE = #{objType}
  2744. )
  2745. ) B
  2746. ON T.ID = B.ID
  2747. WHERE T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  2748. ) w
  2749. <where>
  2750. <if test="province !=null and province !=''">
  2751. and AD_CODE like '${province}%'
  2752. </if>
  2753. <if test="nm != null and nm != ''">
  2754. and nm like '%' || #{nm} || '%'
  2755. </if>
  2756. <if test="adCode != null and adCode != ''">
  2757. and ${adCode}
  2758. </if>
  2759. <if test="prjType != null and prjType != ''">
  2760. and PRJ_TYPE = #{prjType}
  2761. </if>
  2762. </where>
  2763. ORDER BY
  2764. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  2765. ad_code
  2766. </select>
  2767. <select id="getYearMonth" resultType="java.util.Map">
  2768. 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
  2769. </select>
  2770. <select id="getPersAllDtoByIdsList" resultType="cn.com.goldenwater.dcproj.dto.PersAllDto">
  2771. SELECT DISTINCT A.GUID, A.PERS_NAME, B.PERTYPE persType
  2772. FROM BIS_INSP_ALL_RLATION_PERS A
  2773. LEFT JOIN BIS_INSP_ALL_RLATION B
  2774. ON A.GUID = B.PERSID
  2775. WHERE B.ID IN (${ids})
  2776. </select>
  2777. <select id="getPersAllAreaDtoByIdsList" resultType="cn.com.goldenwater.dcproj.dto.PersAllAreaDto">
  2778. SELECT DISTINCT A.AD_CODE, A.AD_NAME
  2779. FROM BIS_INSP_SEL_AREA A
  2780. WHERE A.ID IN (${ids})
  2781. </select>
  2782. <select id="getPersAllObjDtoByIdList" parameterType="String"
  2783. resultType="cn.com.goldenwater.dcproj.dto.PersAllObjDto">
  2784. select B.CODE, B.NM name, B.PTYPE, B.OBJ_ID
  2785. from BIS_INSP_ALL_OBJ B
  2786. WHERE B.ID = #{id}
  2787. </select>
  2788. <select id="getJsPwiuListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  2789. SELECT DISTINCT * FROM (
  2790. SELECT
  2791. T .ID AS CODE,
  2792. A .AD_FULL_NAME,
  2793. case when B.state is not null then B.state else '0' end STATE,
  2794. T .ID,
  2795. T .NAME AS NM,
  2796. T .NAME AS NAME,
  2797. T .AD_CODE,
  2798. T .AD_NAME,
  2799. T.DEP_TYPE as utType,
  2800. T.TMP_TYPE as trdType,
  2801. T .NOTE,
  2802. T .CENTER_X,
  2803. T .CENTER_Y,
  2804. T .GD_X,
  2805. T .GD_Y,
  2806. T .INTM,
  2807. T .UPTM,
  2808. T .DATA_STAT
  2809. FROM ATT_JSPWIU_BASE T
  2810. LEFT JOIN ATT_AD_BASE A ON A.AD_CODE = T.AD_CODE
  2811. LEFT JOIN (
  2812. SELECT a.ID, '1' as state
  2813. FROM ATT_JSPWIU_BASE a
  2814. WHERE Exists (SELECT CODE FROM BIS_INSP_ALL_OBJ O WHERE O.CODE = A.ID AND O.PTYPE = #{objType})
  2815. ) B ON T.ID = B.ID
  2816. WHERE
  2817. T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  2818. ) w
  2819. <where>
  2820. <if test="province !=null and province !=''">
  2821. and AD_CODE like '${province}%'
  2822. </if>
  2823. <if test="nm != null and nm != ''">
  2824. and NM like '%' || #{nm} || '%'
  2825. </if>
  2826. <if test="adCode != null and adCode != ''">
  2827. and ${adCode}
  2828. </if>
  2829. </where>
  2830. ORDER BY
  2831. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  2832. ad_code
  2833. </select>
  2834. <select id="getJsPwiu2024ListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  2835. SELECT DISTINCT * FROM (
  2836. SELECT
  2837. T .ID AS CODE,
  2838. A .AD_FULL_NAME,
  2839. case when B.state is not null then B.state else '0' end STATE,
  2840. T .ID,
  2841. T .NAME AS NM,
  2842. T .NAME AS NAME,
  2843. T .AD_CODE,
  2844. T .AD_NAME,
  2845. T .NOTE,
  2846. T .CENTER_X,
  2847. T .CENTER_Y,
  2848. T .GD_X,
  2849. T .GD_Y,
  2850. T .INTM,
  2851. T .UPTM,
  2852. T .DATA_STAT
  2853. FROM ATT_JSPWIU2024_BASE T
  2854. LEFT JOIN ATT_AD_BASE A ON A.AD_CODE = T.AD_CODE
  2855. LEFT JOIN (
  2856. SELECT a.ID, '1' as state
  2857. FROM ATT_JSPWIU2024_BASE a
  2858. WHERE Exists (SELECT CODE FROM BIS_INSP_ALL_OBJ O WHERE O.CODE = A.ID AND O.PTYPE = #{objType})
  2859. ) B ON T.ID = B.ID
  2860. WHERE
  2861. T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  2862. ) w
  2863. <where>
  2864. <if test="province !=null and province !=''">
  2865. and AD_CODE like '${province}%'
  2866. </if>
  2867. <if test="nm != null and nm != ''">
  2868. and NM like '%' || #{nm} || '%'
  2869. </if>
  2870. <if test="adCode != null and adCode != ''">
  2871. and ${adCode}
  2872. </if>
  2873. </where>
  2874. ORDER BY
  2875. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  2876. ad_code
  2877. </select>
  2878. <select id="getFjgnrlListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  2879. SELECT DISTINCT * FROM (
  2880. SELECT
  2881. T .ID AS CODE,
  2882. A .AD_FULL_NAME,
  2883. case when B.state is not null then B.state else '0' end STATE,
  2884. T .ID,
  2885. T .NM,
  2886. T .NM AS NAME,
  2887. T .AD_CODE,
  2888. T .AD_NAME,
  2889. T .NOTE,
  2890. T .CENTER_X,
  2891. T .CENTER_Y,
  2892. T .GD_X,
  2893. T .GD_Y,
  2894. T .INTM,
  2895. T .UPTM,
  2896. T .DATA_STAT
  2897. FROM BIS_INSP_BASE_NEW T
  2898. LEFT JOIN ATT_AD_BASE A ON A.AD_CODE = T.AD_CODE
  2899. LEFT JOIN (
  2900. SELECT a.ID, '1' as state
  2901. FROM BIS_INSP_BASE_NEW a
  2902. WHERE Exists (SELECT CODE FROM BIS_INSP_ALL_OBJ O WHERE O.CODE = A.ID AND O.PTYPE = #{objType})
  2903. ) B ON T.ID = B.ID
  2904. WHERE
  2905. T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  2906. ) w
  2907. <where>
  2908. <if test="province !=null and province !=''">
  2909. and AD_CODE like '${province}%'
  2910. </if>
  2911. <if test="nm != null and nm != ''">
  2912. and NM like '%' || #{nm} || '%'
  2913. </if>
  2914. <if test="adCode != null and adCode != ''">
  2915. and ${adCode}
  2916. </if>
  2917. </where>
  2918. ORDER BY
  2919. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  2920. ad_code
  2921. </select>
  2922. <select id="getFpjlglListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  2923. SELECT DISTINCT * FROM (
  2924. SELECT
  2925. T.ID AS CODE,
  2926. A.AD_FULL_NAME,
  2927. case when B.state is not null then B.state else '0' end STATE,
  2928. T.ID,
  2929. T.NAME AS NM,
  2930. T.NAME AS NAME,
  2931. T.AD_CODE,
  2932. T.AD_NAME,
  2933. T.BUS_ADDR,
  2934. T.CON_PERS,
  2935. T.CON_PERS_TEL,
  2936. T.CENTER_X,
  2937. T.CENTER_Y,
  2938. T.GD_X,
  2939. T.GD_Y,
  2940. T.INTM,
  2941. T.UPTM,
  2942. T.DATA_STAT
  2943. FROM ATT_FJPJLGL_BASE T
  2944. LEFT JOIN ATT_AD_BASE A ON A.AD_CODE = T.AD_CODE
  2945. LEFT JOIN (
  2946. SELECT a.ID, '1' as state
  2947. FROM ATT_FJPJLGL_BASE a
  2948. WHERE Exists (SELECT CODE FROM BIS_INSP_ALL_OBJ O WHERE O.CODE = A.ID AND O.PTYPE = #{objType})
  2949. ) B ON T.ID = B.ID
  2950. WHERE
  2951. T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  2952. ) w
  2953. <where>
  2954. <if test="province !=null and province !=''">
  2955. and AD_CODE like '${province}%'
  2956. </if>
  2957. <if test="nm != null and nm != ''">
  2958. and nm like '%' || #{nm} || '%'
  2959. </if>
  2960. <if test="adCode != null and adCode != ''">
  2961. and ${adCode}
  2962. </if>
  2963. </where>
  2964. ORDER BY
  2965. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  2966. ad_code
  2967. </select>
  2968. <select id="getFjpjmgdpListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  2969. SELECT DISTINCT * FROM (
  2970. SELECT
  2971. T.ID AS CODE,
  2972. A.AD_FULL_NAME,
  2973. case when B.state is not null then B.state else '0' end STATE,
  2974. T.ID,
  2975. T.NAME AS NM,
  2976. T.NAME AS NAME,
  2977. T.AD_CODE,
  2978. T.AD_NAME,
  2979. T.BUS_ADDR,
  2980. T.CON_PERS,
  2981. T.CON_PERS_TEL,
  2982. T.CENTER_X,
  2983. T.CENTER_Y,
  2984. T.GD_X,
  2985. T.GD_Y,
  2986. T.INTM,
  2987. T.UPTM,
  2988. T.DATA_STAT
  2989. FROM ATT_FJPJMGDP_BASE T
  2990. LEFT JOIN ATT_AD_BASE A ON A.AD_CODE = T.AD_CODE
  2991. LEFT JOIN (
  2992. SELECT a.ID, '1' as state
  2993. FROM ATT_FJPJMGDP_BASE a
  2994. WHERE Exists (SELECT CODE FROM BIS_INSP_ALL_OBJ O WHERE O.CODE = A.ID AND O.PTYPE = #{objType})
  2995. ) B ON T.ID = B.ID
  2996. WHERE
  2997. T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  2998. ) w
  2999. <where>
  3000. <if test="province !=null and province !=''">
  3001. and AD_CODE like '${province}%'
  3002. </if>
  3003. <if test="nm != null and nm != ''">
  3004. and nm like '%' || #{nm} || '%'
  3005. </if>
  3006. <if test="adCode != null and adCode != ''">
  3007. and ${adCode}
  3008. </if>
  3009. </where>
  3010. ORDER BY
  3011. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  3012. ad_code
  3013. </select>
  3014. <select id="getFjaccpListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  3015. SELECT DISTINCT * FROM (
  3016. SELECT
  3017. T.ID AS CODE,
  3018. A.AD_FULL_NAME,
  3019. case when B.state is not null then B.state else '0' end STATE,
  3020. T.ID,
  3021. T.NAME AS NM,
  3022. T.NAME AS NAME,
  3023. T.AD_CODE,
  3024. T.AD_NAME,
  3025. T.BUS_ADDR,
  3026. T.CON_PERS,
  3027. T.CON_PERS_TEL,
  3028. T.CENTER_X,
  3029. T.CENTER_Y,
  3030. T.GD_X,
  3031. T.GD_Y,
  3032. T.INTM,
  3033. T.UPTM,
  3034. T.DATA_STAT
  3035. FROM ATT_FJACCP_BASE T
  3036. LEFT JOIN ATT_AD_BASE A ON A.AD_CODE = T.AD_CODE
  3037. LEFT JOIN (
  3038. SELECT a.ID, '1' as state
  3039. FROM ATT_FJACCP_BASE a
  3040. WHERE Exists (SELECT CODE FROM BIS_INSP_ALL_OBJ O WHERE O.CODE = A.ID AND O.PTYPE = #{objType})
  3041. ) B ON T.ID = B.ID
  3042. WHERE
  3043. T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  3044. ) w
  3045. <where>
  3046. <if test="province !=null and province !=''">
  3047. and AD_CODE like '${province}%'
  3048. </if>
  3049. <if test="nm != null and nm != ''">
  3050. and nm like '%' || #{nm} || '%'
  3051. </if>
  3052. <if test="adCode != null and adCode != ''">
  3053. and ${adCode}
  3054. </if>
  3055. </where>
  3056. ORDER BY
  3057. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  3058. ad_code
  3059. </select>
  3060. <select id="getFjsduListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  3061. SELECT DISTINCT * FROM (
  3062. SELECT
  3063. T.ID AS CODE,
  3064. A.AD_FULL_NAME,
  3065. case when B.state is not null then B.state else '0' end STATE,
  3066. T.ID,
  3067. T.NAME AS NM,
  3068. T.NAME AS NAME,
  3069. T.AD_CODE,
  3070. T.AD_NAME,
  3071. T.BUS_ADDR,
  3072. T.CON_PERS,
  3073. T.CON_PERS_TEL,
  3074. T.CENTER_X,
  3075. T.CENTER_Y,
  3076. T.GD_X,
  3077. T.GD_Y,
  3078. T.INTM,
  3079. T.UPTM,
  3080. T.DATA_STAT
  3081. FROM ATT_FJSDU_BASE T
  3082. LEFT JOIN ATT_AD_BASE A ON A.AD_CODE = T.AD_CODE
  3083. LEFT JOIN (
  3084. SELECT a.ID, '1' as state
  3085. FROM ATT_FJSDU_BASE a
  3086. WHERE Exists (SELECT CODE FROM BIS_INSP_ALL_OBJ O WHERE O.CODE = A.ID AND O.PTYPE = #{objType})
  3087. ) B ON T.ID = B.ID
  3088. WHERE
  3089. T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  3090. ) w
  3091. <where>
  3092. <if test="province !=null and province !=''">
  3093. and AD_CODE like '${province}%'
  3094. </if>
  3095. <if test="nm != null and nm != ''">
  3096. and nm like '%' || #{nm} || '%'
  3097. </if>
  3098. <if test="adCode != null and adCode != ''">
  3099. and ${adCode}
  3100. </if>
  3101. </where>
  3102. ORDER BY
  3103. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  3104. ad_code
  3105. </select>
  3106. <select id="getFjpjcsuListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  3107. SELECT DISTINCT * FROM (
  3108. SELECT
  3109. T.ID AS CODE,
  3110. A.AD_FULL_NAME,
  3111. NVL(B.STATE, 0) AS STATE,
  3112. T.ID,
  3113. T.NAME AS NM,
  3114. T.NAME AS NAME,
  3115. T.AD_CODE,
  3116. T.AD_NAME,
  3117. T.BUS_ADDR,
  3118. T.CON_PERS,
  3119. T.CON_PERS_TEL,
  3120. T.CENTER_X,
  3121. T.CENTER_Y,
  3122. T.GD_X,
  3123. T.GD_Y,
  3124. T.INTM,
  3125. T.UPTM,
  3126. T.DATA_STAT
  3127. FROM ATT_FJPJCSU_BASE T
  3128. LEFT JOIN ATT_AD_BASE A ON A.AD_CODE = T.AD_CODE
  3129. LEFT JOIN (
  3130. SELECT a.ID, '1' as state
  3131. FROM ATT_FJPJCSU_BASE a
  3132. WHERE Exists (SELECT CODE FROM BIS_INSP_ALL_OBJ O WHERE O.CODE = A.ID AND O.PTYPE = #{objType})
  3133. ) B ON T.ID = B.ID
  3134. WHERE
  3135. T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  3136. ) w
  3137. <where>
  3138. <if test="province !=null and province !=''">
  3139. and AD_CODE like '${province}%'
  3140. </if>
  3141. <if test="nm != null and nm != ''">
  3142. and nm like '%' || #{nm} || '%'
  3143. </if>
  3144. <if test="adCode != null and adCode != ''">
  3145. and ${adCode}
  3146. </if>
  3147. </where>
  3148. ORDER BY
  3149. <if test="orderBy != null and orderBy != ''">${orderBy},</if>
  3150. ad_code
  3151. </select>
  3152. </mapper>