SupervisionPlanDao.xml 104 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876
  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,1,3) PTYPE,DATE_FORMAT(A.STTM,'%Y-%m-%d')
  31. STTM,DATE_FORMAT(A.ENTM,'%Y-%m-%d') 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 c.*
  81. FROM (SELECT A.rs_code code,
  82. A.rs_name as name,
  83. A.rs_name as nm,
  84. IFNULL(B.state, 0) as state,
  85. IFNULL(B.state, 0) as hst_insp,
  86. A.RS_NAME,
  87. A.BUILD_STAT,
  88. A.LONGITUDE,
  89. A.LATITUDE,
  90. A.LOCATION,
  91. A.ENG_SCAL,
  92. A.LIM_STAG,
  93. A.TOT_CAP,
  94. A.RS_ADM_NAME,
  95. A.RS_ADM_CODE,
  96. A.RS_ADM_DEP,
  97. A.ADM_ATT_REL,
  98. A.ADM_DIV,
  99. A.ADM_DIV AS AD_CODE,
  100. A.RS_TYPE,
  101. A.DAM_TYPE_MAT,
  102. A.DAM_TYPE_STR,
  103. A.DAM_SIZE_HIG,
  104. A.CENTER_X,
  105. A.CENTER_Y,
  106. A.SRC,
  107. A.DATA_QUALITY,
  108. A.CENTER_X_GD,
  109. A.CENTER_Y_GD,
  110. A.RS_LOC,
  111. A.REG_CODE,
  112. A.COMP_DATE,
  113. A.INTM,
  114. A.REG_NO,
  115. A.PERS_ID,
  116. A.UPTM,
  117. A.CHK_STATE,
  118. A.EDTR_PESR,
  119. A.SLPC_ADM_DIV,
  120. A.ADM_DIV_NAME,
  121. A.ADM_DIV_NAME AS AD_NAME,
  122. AD.AD_FULL_NAME,
  123. A.PROVINCIAL
  124. FROM ATT_RS_BASE A
  125. LEFT JOIN (
  126. SELECT a.RS_CODE, '1' as state
  127. FROM ATT_RS_BASE a
  128. WHERE Exists (select code FROM BIS_INSP_ALL_OBJ o
  129. where o.code = a.RS_CODE
  130. and o.ptype = #{pType}
  131. and DATE_FORMAT(o.OBJ_INTM,'%Y')=DATE_FORMAT(now(),'%Y')
  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 c.adm_div like '${province}%'</if>
  144. <if test="adnm != null and adnm != ''">and c.ADM_DIV_NAME LIKE '%${adnm}%'</if>
  145. <if test="rsName != null and rsName != ''">and c.RS_NAME LIKE '%${rsName}%'</if>
  146. <if test='nm != null and nm != "" '>and c.RS_NAME LIKE '%${nm}%'</if>
  147. <if test="engScal != null and engScal != ''">and c.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 c.state = #{isSupn}</if>
  151. </where>
  152. ORDER BY
  153. <if test='orderBy != null and orderBy != "" '>${orderBy} ,</if>
  154. c.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 c.*
  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. IFNULL(B.state, 0) as state,
  339. A.LOW_LEFT_LONG,
  340. A.LOW_LEFT_LAT,
  341. A.UP_RIGHT_LONG,
  342. A.UP_RIGHT_LAT,
  343. A.UP_AD_NAME,
  344. A.AD_GRAD,
  345. A.AD_ABBR_NAME,
  346. A.AD_STAT,
  347. A.AD_AREA,
  348. A.AD_FULL_NAME,
  349. A.NOTE,
  350. A.EFF_DATE,
  351. A.EXPR_DATE,
  352. A.AD_STAT_LONG,
  353. A.AD_STAT_LAT,
  354. A.DOMAIN_CODE,
  355. A.AD_SIGN,
  356. A.MODIFIER_PEOPLE,
  357. A.UPD_DATE,
  358. A.IS_REPORT,
  359. A.AD_FCODE,
  360. A.IS_POVERYT,
  361. A.SRC,
  362. A.REMARK,
  363. A.AD_LONG,
  364. A.AD_LAT,
  365. A.LGTD,
  366. A.LTTD,
  367. A.LGTDPC,
  368. A.LTTDPC
  369. FROM ATT_AD_X_BASE A
  370. LEFT JOIN (
  371. SELECT a.AD_CODE, '1' as state
  372. FROM ATT_AD_X_BASE a
  373. WHERE Exists (select code FROM BIS_INSP_ALL_OBJ o
  374. where o.code = a.AD_CODE
  375. and o.ptype = #{objType}
  376. and DATE_FORMAT(o.OBJ_INTM,'%Y')=DATE_FORMAT(now(),'%Y')
  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 c.* FROM
  506. (SELECT t.id code,t.id,
  507. IFNULL(B.state, 0) as state,
  508. t.ptype,
  509. t.ad_code,
  510. t.nm name,t.nm,
  511. t.stwktm,
  512. t.plantm,
  513. t.estapp,
  514. t.lgtd,
  515. t.lttd,
  516. t.lgtd_pc,
  517. t.lttd_pc,
  518. t.intm,
  519. t.uptm,
  520. t.note,
  521. t.unit_id,
  522. t.unit_nm,
  523. t.ad_name,
  524. t.eng_sta,
  525. t.buid_time_year
  526. FROM ATT_EMPWTPRJ_BASE t
  527. LEFT JOIN (
  528. SELECT a.ID, '1' as state
  529. FROM ATT_EMPWTPRJ_BASE a
  530. WHERE Exists (select code FROM BIS_INSP_ALL_OBJ o where o.code = a.id and o.ptype = #{objType})
  531. ) B ON T.ID = B.ID
  532. where t.ID NOT in (
  533. select CODE from BIS_INSP_ALL_OBJ B where id like concat(#{inspGroupId},'%')
  534. <if test="objType !=null and objType !=''">
  535. and pType=#{objType}
  536. </if>
  537. )
  538. <if test='nm != null and nm != "" '>and t.NM LIKE '%${nm}%'</if>
  539. <if test='province !=null and province !="" '>
  540. and t.AD_CODE like '${province}%'
  541. </if>
  542. AND t.ENG_STA = #{engSta}
  543. ) c
  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. c.ad_code
  549. </select>
  550. <!--获取不在督查组范围内的稽察项目-->
  551. <select id="getSupPawpListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.model.TacAttPawpBase">
  552. SELECT distinct c.* 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. ) c
  564. WHERE c.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. c.ad_code,c.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 w.* 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. IFNULL(b.state, '0') AS STATE
  678. FROM ATT_WAGA_BASE t
  679. LEFT JOIN (
  680. SELECT a.OBJ_CODE, '1' as state
  681. FROM ATT_WAGA_BASE a
  682. WHERE Exists (select code FROM BIS_INSP_ALL_OBJ o
  683. where o.code = a.OBJ_CODE
  684. and o.ptype = #{objType}
  685. and DATE_FORMAT(o.OBJ_INTM,'%Y')=DATE_FORMAT(now(),'%Y')
  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. ) w
  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 ro.* 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}) ro
  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}) ro
  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}) ro
  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}) ro
  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}) ro
  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}) ro
  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}) ro
  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}) ro
  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}) ro
  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}) ro
  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}) ro
  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}) ro
  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}) ro
  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}) ro
  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}) ro
  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}) ro
  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}) ro
  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}) ro
  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}) ro
  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}) ro
  813. </when>
  814. <when test="type == '030'">
  815. (select ID code, NAME,TYPE, AD_CODE FROM ATT_EFP_BASE WHERE ID = #{code}) ro
  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}) ro
  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}) ro
  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}) ro
  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}) ro
  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}) ro
  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}) ro
  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}) ro
  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}) ro
  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}) ro
  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}) ro
  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}) ro
  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}) ro
  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}) ro
  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}) ro
  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}) ro
  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}) ro
  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}) ro
  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}) ro
  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}) ro
  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}) ro
  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}) ro
  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}) ro
  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}) ro
  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}) ro
  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}) ro
  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,1,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 t.CODE id,t.NAME from ATT_INSP_TYPE t,bis_insp_all_rlation r
  985. where t.code=substr(r.id,1,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 cast(t.code as unsigned)
  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} limit 1
  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. str_to_date(#{sttm},'%Y-%m-%d %H:%i:%s'),
  1034. str_to_date(#{entm},'%Y-%m-%d %H:%i:%s'),
  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 = STR_TO_DATE(#{sttm},'%Y-%m-%d'),</if>
  1057. <if test="entm != null">ENTM = STR_TO_DATE(#{entm},'%Y-%m-%d'),</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 w.* 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. ) w 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. w.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 w.* 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. IFNULL(B.state, 0) as 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 DATE_FORMAT(o.OBJ_INTM,'%Y')=DATE_FORMAT(now(),'%Y')
  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 str_to_date(date_format(now(), '%Y0101'), '%Y%m%d') from dual )
  1203. </when>
  1204. <otherwise>
  1205. and t.INTM >= (select str_to_date(date_format(now(), '%Y0101'), '%Y%m%d') 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 (DATE_FORMAT(INTM,'%Y') <![CDATA[ < ]]> DATE_FORMAT(now(),'%Y') or INTM IS NULL)
  1222. </when>
  1223. <otherwise>
  1224. and DATE_FORMAT(INTM,'%Y') = DATE_FORMAT(now(),'%Y')
  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 w.* 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. ) w 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 w.* 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. ) w 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 w.* 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. ) w 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 w.* 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. ) w
  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, IFNULL(B.state, '0') 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. IFNULL(B.state, 0) as 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. <select id="getWintuBaseListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.model.BisInspWintRgstr">
  1605. select distinct * from (
  1606. SELECT
  1607. t.id AS id,
  1608. t.id as code,
  1609. t.WINT_NAME as nm,
  1610. t.WINT_NAME as name,
  1611. IFNULL(B.state, 0) as state,
  1612. t.WAIN_TYPE wainIntType,
  1613. t.AD_CODE,
  1614. t.AD_NAME adName,
  1615. t.AD_NAME loc,
  1616. t.WIU_NAME bChkUnit,
  1617. t.WIU_CONTACT contact,
  1618. t.WIU_CONTACT_TEL contactTel,
  1619. t.WIU_PRINCIPAL principal,
  1620. t.WIU_PRINCIPAL_TEL principalTel
  1621. FROM ATT_WINT_BASE T
  1622. LEFT JOIN (
  1623. SELECT a.ID, '1' as state
  1624. FROM ATT_WINT_BASE a
  1625. WHERE Exists (select code FROM BIS_INSP_ALL_OBJ o where o.code = a.id and o.ptype = #{objType})
  1626. ) B ON T.ID = B.ID
  1627. WHERE T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  1628. ) w
  1629. where
  1630. 1=1
  1631. <if test='province !=null and province !="" '>
  1632. and AD_CODE like '${province}%'
  1633. </if>
  1634. <if test='nm != null and nm != "" '>
  1635. and NM like '%${nm}%'
  1636. </if>
  1637. <if test="type != null and type != ''">
  1638. and type = #{type}
  1639. </if>
  1640. <if test='adCode != null and adCode != "" '>and ${adCode}</if>
  1641. </select>
  1642. <select id="getWuntuBaseListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.model.BisInspSvwtWuntRgstr">
  1643. select distinct * from (
  1644. SELECT
  1645. t.id AS id,
  1646. t.WINT_CODE as code,
  1647. t.WINT_NAME as nm,
  1648. t.WINT_NAME as name,
  1649. t.WAIN_TYPE wainIntType,
  1650. t.AD_CODE,
  1651. t.AD_NAME adName,
  1652. t.AD_NAME loc,
  1653. t.WIU_NAME bChkUnit,
  1654. t.WIU_CONTACT contact,
  1655. t.WIU_CONTACT_TEL contactTel,
  1656. t.WIU_PRINCIPAL principal,
  1657. t.WIU_PRINCIPAL_TEL principalTel,
  1658. B.OBJ_ID,CASE WHEN B.CODE IS NULL then '' else '1' end state
  1659. FROM ATT_WINT_BASE T
  1660. LEFT JOIN (select * FROM BIS_INSP_ALL_OBJ o where o.ptype = #{objType}) B ON T.id = B.CODE
  1661. WHERE T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  1662. ) w
  1663. where
  1664. 1=1
  1665. <if test='province !=null and province !="" '>
  1666. and AD_CODE like '${province}%'
  1667. </if>
  1668. <if test='nm != null and nm != "" '>
  1669. and NM like '%${nm}%'
  1670. </if>
  1671. <if test="type != null and type != ''">
  1672. and type = #{type}
  1673. </if>
  1674. <if test='adCode != null and adCode != "" '>and ${adCode}</if>
  1675. </select>
  1676. <select id="getWtuntBaseListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  1677. select distinct * from (
  1678. SELECT
  1679. t.id AS id, t.id as code,
  1680. t.UT_NAME as nm,
  1681. t.ad_code, t.ad_name as adName,T.PRINCIPAL_TEL, T.NOTE,
  1682. B.OBJ_ID,CASE WHEN B.CODE IS NULL then '' else '1' end state,AD.AD_GRAD,
  1683. T.UT_TYPE type
  1684. FROM ATT_WTUNT_BASE T
  1685. LEFT JOIN (select * FROM BIS_INSP_ALL_OBJ o where o.ptype = #{objType}) B ON T.id = B.CODE
  1686. LEFT JOIN ATT_AD_BASE AD ON t.AD_CODE = AD.AD_CODE
  1687. WHERE
  1688. T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  1689. ) w
  1690. where 1=1
  1691. <if test='province !=null and province !="" '>and ad_code like '${province}%'</if>
  1692. <if test='nm != null and nm != "" '>and NM like '%${nm}%'</if>
  1693. <if test='adCode != null and adCode != "" '>and ${adCode}</if>
  1694. <if test="type != null and type != ''">AND TYPE = #{type}</if>
  1695. <if test="adGrad != null and adGrad != ''">and AD_GRAD = #{adGrad}</if>
  1696. </select>
  1697. <select id="getWtgtBaseListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  1698. select distinct * from (
  1699. SELECT
  1700. B.OBJ_ID,CASE WHEN B.CODE IS NULL then '' else '1' end state, AD.AD_GRAD,
  1701. t.id AS id,
  1702. t.id as code,
  1703. t.DEP_NAME as nm,
  1704. t.AD_CODE, t.AD_NAME,
  1705. T.WINT_CODE,
  1706. T.DEP_PERS,
  1707. T.DEP_PERS_TEL,T.PRINCIPAL_TEL, T.NOTE,
  1708. T.LOC location
  1709. FROM ATT_WTGT_BASE T
  1710. LEFT JOIN (select * FROM BIS_INSP_ALL_OBJ o where o.ptype = #{objType}) B ON T.id = B.CODE
  1711. LEFT JOIN ATT_AD_BASE AD ON t.AD_CODE = AD.AD_CODE
  1712. WHERE T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  1713. ) w
  1714. <where>
  1715. <if test='province !=null and province !="" '>
  1716. and ad_code like '${province}%'
  1717. </if>
  1718. <if test='nm != null and nm != "" '>
  1719. and NM like '%${nm}%'
  1720. </if>
  1721. <if test='adCode != null and adCode != "" '>and ${adCode}</if>
  1722. <if test="adGrad != null and adGrad != ''">and AD_GRAD = #{adGrad}</if>
  1723. </where>
  1724. </select>
  1725. <select id="getAdBaseMunicipalLevelListNotInspGroupIds" parameterType="cn.com.goldenwater.dcproj.param.InspObjParam"
  1726. resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  1727. select distinct *
  1728. from (
  1729. select
  1730. t.ad_code as id, t.ad_code as code, t.ad_name as nm, t.ad_full_name as location,
  1731. t.lgtd as gdX, t.lttd as gdY, t.ad_code, t.AD_GRAD,
  1732. t.ad_long as pcX,t.ad_lat as pcY
  1733. FROM ATT_AD_BASE T
  1734. LEFT JOIN
  1735. (select * FROM BIS_INSP_ALL_OBJ o where o.ptype = #{objType}) B ON T.AD_CODE = B.CODE
  1736. WHERE
  1737. T.ad_code NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  1738. <if test='province !=null and province !="" '>
  1739. and t.ad_code like '${province}%'
  1740. </if>
  1741. ) w where w.AD_GRAD = '3'
  1742. <if test='nm != null and nm != "" '>
  1743. and nm like '%${nm}%'
  1744. </if>
  1745. <if test='adCode != null and adCode != "" '>and ${adCode}</if>
  1746. ORDER BY
  1747. <if test='orderBy != null and orderBy != "" '>${orderBy},</if>
  1748. ad_code
  1749. </select>
  1750. <select id="getAdBaseCountyLevelListNotInspGroupIds" parameterType="cn.com.goldenwater.dcproj.param.InspObjParam"
  1751. resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  1752. select distinct *
  1753. from (
  1754. select
  1755. t.ad_code as id, t.ad_code as code, t.ad_name as nm, t.ad_full_name as location,
  1756. t.lgtd as gdX, t.lttd as gdY, t.ad_code, t.AD_GRAD,
  1757. t.ad_long as pcX,t.ad_lat as pcY
  1758. FROM ATT_AD_BASE T
  1759. LEFT JOIN
  1760. (select * FROM BIS_INSP_ALL_OBJ o where o.ptype = #{objType}) B ON T.AD_CODE = B.CODE
  1761. WHERE
  1762. T.ad_code NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  1763. <if test='province !=null and province !="" '>
  1764. and t.ad_code like '${province}%'
  1765. </if>
  1766. ) w
  1767. where w.AD_GRAD = '4'
  1768. <if test='nm != null and nm != "" '>
  1769. and nm like '%${nm}%'
  1770. </if>
  1771. <if test='adCode != null and adCode != "" '>and ${adCode}</if>
  1772. ORDER BY
  1773. <if test='orderBy != null and orderBy != "" '>${orderBy},</if>
  1774. ad_code
  1775. </select>
  1776. <select id="getRsListNotInGroup" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  1777. select distinct * from (
  1778. select t.rs_code as id,T.Rs_Code as code,t.rs_name as nm,
  1779. t.ENG_SCAL,t.build_stat,t.location,t.adm_div as
  1780. ad_code,t.adm_div_name as ad_name
  1781. ,B.OBJ_ID,
  1782. CASE WHEN B.CODE IS NULL then '' else '1' end state
  1783. from ATT_RS_BASE t
  1784. LEFT JOIN (select * FROM BIS_INSP_ALL_OBJ o where o.ptype = #{objType}) B ON T.RS_CODE = B.CODE
  1785. WHERE t.rs_code NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  1786. and t.build_stat in ('2','3')
  1787. ) w where 1=1
  1788. <if test='province !=null and province !="" '>
  1789. and AD_CODE like '${province}%'
  1790. </if>
  1791. <if test='nm != null and nm != "" '>
  1792. and NM like '%${nm}%'
  1793. </if>
  1794. <if test='adCode != null and adCode != "" '>and ${adCode}</if>
  1795. <if test="engScal != null and engScal != ''"></if>
  1796. ORDER BY
  1797. <if test='orderBy != null and orderBy != "" '>${orderBy},</if>
  1798. ad_code
  1799. </select>
  1800. <select id="getSamListNotInGroup" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  1801. select distinct * from (
  1802. select T.id,T.id as code,t.prj_name as nm,t.ad_code,t.ad_name,t.addr as location
  1803. ,B.OBJ_ID,CASE WHEN B.CODE IS NULL then '' else '1' end state
  1804. from ATT_SAMRMP_BASE T
  1805. LEFT JOIN (select * FROM BIS_INSP_ALL_OBJ o where o.ptype = #{objType}) B ON T.ID = B.CODE
  1806. WHERE t.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  1807. ) w where 1=1
  1808. <if test='province !=null and province !="" '>
  1809. and AD_CODE like '${province}%'
  1810. </if>
  1811. <if test='nm != null and nm != "" '>
  1812. and NM like '%${nm}%'
  1813. </if>
  1814. <if test='adCode != null and adCode != "" '>and ${adCode}</if>
  1815. ORDER BY
  1816. <if test='orderBy != null and orderBy != "" '>${orderBy},</if>
  1817. ad_code
  1818. </select>
  1819. <select id="getSupCdepListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  1820. select distinct * from (
  1821. SELECT
  1822. t.id AS id,
  1823. t.id AS code,
  1824. t.DEP_CODE as depCode,
  1825. t.DEP_NAME as nm,
  1826. t.AD_CODE as AD_CODE,
  1827. t.AD_NAME as adName,
  1828. t.LOC as location,
  1829. t.PRINCIPAL principal,
  1830. t.CONTACT as depPers,
  1831. B.OBJ_ID,CASE WHEN B.CODE IS NULL then '' else '1' end state
  1832. FROM ATT_CDEP_BASE T
  1833. LEFT JOIN (select * FROM BIS_INSP_ALL_OBJ o where o.ptype = #{objType}) B ON T.id = B.CODE
  1834. WHERE T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  1835. ) w
  1836. where
  1837. 1=1
  1838. <if test='province !=null and province !="" '>
  1839. and AD_CODE like '${province}%'
  1840. </if>
  1841. <if test='nm != null and nm != "" '>
  1842. and nm like '%${nm}%'
  1843. </if>
  1844. <if test='adCode != null and adCode != "" '>and ${adCode}</if>
  1845. ORDER BY
  1846. <if test='orderBy != null and orderBy != "" '>${orderBy},</if>
  1847. ad_code
  1848. </select>
  1849. <select id="getSupBidListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  1850. select distinct * from (
  1851. SELECT
  1852. t.id AS id,
  1853. t.id AS code,
  1854. t.BID_CODE as bidCode,
  1855. t.BID_NAME as nm,
  1856. t.AD_CODE as AD_CODE,
  1857. t.AD_NAME as adName,
  1858. t.LOC as location,
  1859. t.LEGAL_PERS as legalPers,
  1860. t.CONTACT as depPers,
  1861. B.OBJ_ID,CASE WHEN B.CODE IS NULL then '' else '1' end state
  1862. FROM ATT_BID_BASE T
  1863. LEFT JOIN (select * FROM BIS_INSP_ALL_OBJ o where o.ptype = #{objType}) B ON T.id = B.CODE
  1864. WHERE T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  1865. ) w
  1866. where
  1867. 1=1
  1868. <if test='province !=null and province !="" '>
  1869. and AD_CODE like '${province}%'
  1870. </if>
  1871. <if test='nm != null and nm != "" '>
  1872. and nm like concat('%' , #{nm} , '%')
  1873. </if>
  1874. <if test='adCode != null and adCode != "" '>and ${adCode}</if>
  1875. ORDER BY
  1876. <if test='orderBy != null and orderBy != "" '>${orderBy},</if>
  1877. ad_code
  1878. </select>
  1879. <select id="getSupRlrwListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  1880. select distinct * from (
  1881. SELECT
  1882. t.LAND_CODE AS id,
  1883. t.LAND_CODE AS code,
  1884. t.LAND_NAME as nm,
  1885. t.AD_CODE as AD_CODE,
  1886. t.AD_NAME as adName,
  1887. t.CONTACT as depPers,
  1888. B.OBJ_ID,CASE WHEN B.CODE IS NULL then '' else '1' end state
  1889. FROM ATT_RLRW_BASE T
  1890. LEFT JOIN (select * FROM BIS_INSP_ALL_OBJ o where o.ptype = #{objType}) B ON T.LAND_CODE = B.CODE
  1891. WHERE T.LAND_CODE NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  1892. ) w
  1893. where
  1894. 1=1
  1895. <if test='province !=null and province !="" '>
  1896. and AD_CODE like '${province}%'
  1897. </if>
  1898. <if test='nm != null and nm != "" '>
  1899. and nm like '%${depName}%'
  1900. </if>
  1901. <if test='adCode != null and adCode != "" '>and ${adCode}</if>
  1902. ORDER BY
  1903. <if test='orderBy != null and orderBy != "" '>${orderBy},</if>
  1904. ad_code
  1905. </select>
  1906. <select id="getSupDrdmpListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  1907. select distinct * from (
  1908. SELECT
  1909. t.id AS code,
  1910. t.DEP_NAME as nm,
  1911. t.LOC as location,
  1912. IFNULL(B.state, 0) as state,
  1913. t.DEP_NAME,
  1914. t.AD_CODE,
  1915. t.AD_NAME,
  1916. t.WINT_CODE,
  1917. t.LOC
  1918. FROM ATT_DEP_BASE T
  1919. LEFT JOIN (
  1920. SELECT a.ID, '1' as state FROM ATT_DEP_BASE a
  1921. WHERE Exists (select code FROM BIS_INSP_ALL_OBJ o where o.code = a.id and o.ptype = #{objType})
  1922. ) B ON T.ID = B.ID
  1923. WHERE T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  1924. ) w
  1925. <where>
  1926. <if test='province !=null and province !="" '>
  1927. and AD_CODE like '${province}%'
  1928. </if>
  1929. <if test='nm != null and nm != "" '>
  1930. and nm like concat('%' , #{nm} , '%')
  1931. </if>
  1932. <if test='adCode != null and adCode != "" '>
  1933. and ${adCode}
  1934. </if>
  1935. </where>
  1936. ORDER BY
  1937. <if test='orderBy != null and orderBy != "" '>${orderBy},</if>
  1938. ad_code
  1939. </select>
  1940. <select id="getSupGrowListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  1941. select distinct * from (
  1942. SELECT
  1943. t.id AS id,
  1944. IFNULL(B.state, 0) as state,
  1945. t.id AS code,
  1946. t.WELL_NAME AS nm,
  1947. t.AD_CODE as AD_CODE,
  1948. t.AD_NAME as adName,
  1949. t.CONTACT as depPers,
  1950. t.well_type as type
  1951. FROM ATT_GROW_BASE T
  1952. LEFT JOIN (
  1953. SELECT a.ID, '1' as state
  1954. FROM ATT_GROW_BASE a
  1955. WHERE Exists (select code FROM BIS_INSP_ALL_OBJ o where o.code = a.id and o.ptype = #{objType})
  1956. ) B ON T.ID = B.ID
  1957. WHERE T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  1958. ) w
  1959. where
  1960. 1=1
  1961. <if test='province !=null and province !="" '>
  1962. and AD_CODE like '${province}%'
  1963. </if>
  1964. <if test='nm != null and nm != "" '>
  1965. and nm like '%${nm}%'
  1966. </if>
  1967. <if test="type != null and type != ''">
  1968. and w.type = #{type}
  1969. </if>
  1970. <if test='adCode != null and adCode != "" '>and ${adCode}</if>
  1971. ORDER BY
  1972. <if test='orderBy != null and orderBy != "" '>${orderBy},</if>
  1973. ad_code
  1974. </select>
  1975. <select id="getSupFundListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  1976. select distinct * from (
  1977. SELECT
  1978. t.id AS id,
  1979. IFNULL(B.state, 0) as state,
  1980. t.id AS code,
  1981. t.Proj_Name AS nm,
  1982. t.AD_CODE as AD_CODE,
  1983. t.AD_NAME as adName,
  1984. t.plan_funds as planFunds,
  1985. (case cast(t.Proj_Type as char) when '1' then '中小河流治理' when '2' then '新建小型水库' when '3' then '中型灌区' when '4' then '水土保持'
  1986. when '5' then '山洪灾害防治' when '6' then '农村饮水工程维修养护' when '7' then '小型水库维修养护' when '8' then '山洪灾害防治设施维修养护项目'
  1987. when '9' then '农业水价综合改革' when '10' then '大中型水库移民' when '11' then '其他' else t.Proj_Type end)
  1988. as type
  1989. FROM ATT_FUND_BASE T
  1990. LEFT JOIN (
  1991. SELECT a.ID, '1' as state
  1992. FROM ATT_FUND_BASE a
  1993. WHERE Exists (select code FROM BIS_INSP_ALL_OBJ o where o.code = a.id and o.ptype = #{objType})
  1994. ) B ON T.ID = B.ID
  1995. WHERE T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  1996. ) w
  1997. where
  1998. 1=1
  1999. <if test='province !=null and province !="" '>
  2000. and AD_CODE like '${province}%'
  2001. </if>
  2002. <if test='nm != null and nm != "" '>
  2003. and nm like '%${nm}%'
  2004. </if>
  2005. <if test="type != null and type != ''">
  2006. and w.type = #{type}
  2007. </if>
  2008. <if test='adCode != null and adCode != "" '>and ${adCode}</if>
  2009. ORDER BY
  2010. <if test='orderBy != null and orderBy != "" '>${orderBy},</if>
  2011. ad_code
  2012. </select>
  2013. <select id="getSupWiuqhListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  2014. select distinct * from (
  2015. SELECT
  2016. t.id AS code,
  2017. t.NM,
  2018. t.LOC as location,
  2019. IFNULL(B.state, 0) as state,
  2020. t.AD_CODE, t.AD_NAME, t.APP_NO, t.WT_APP_NO,
  2021. t.APP_DEP, t.WT_TYPE, t.WT_MSR, t.WT_TM,
  2022. t.WT_SUR, t.WT_USR, t.DEP_PERS, t.PERS_PHONE,
  2023. t.DEP_CNT_PERS, t.DEP_CNT_PERS_PHONE, t.NOTE,
  2024. t.CENTER_X, t.CENTER_Y,
  2025. t.GD_X, t.GD_Y, t.INTM, t.UPTM, t.DATA_STAT
  2026. FROM ATT_WIUQH_BASE T
  2027. LEFT JOIN (
  2028. SELECT a.ID, '1' as state
  2029. FROM ATT_WIUQH_BASE a
  2030. WHERE Exists (select code FROM BIS_INSP_ALL_OBJ o where o.code = a.id and o.ptype = #{objType})
  2031. ) B ON T.ID = B.ID
  2032. WHERE
  2033. T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  2034. ) w
  2035. <where>
  2036. <if test='province !=null and province !="" '>
  2037. and AD_CODE like '${province}%'
  2038. </if>
  2039. <if test='nm != null and nm != "" '>
  2040. and nm like concat('%' , #{nm} , '%')
  2041. </if>
  2042. <if test='adCode != null and adCode != "" '>
  2043. and ${adCode}
  2044. </if>
  2045. </where>
  2046. ORDER BY
  2047. <if test='orderBy != null and orderBy != "" '>${orderBy},</if>
  2048. ad_code
  2049. </select>
  2050. <select id="getSafetyListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  2051. select distinct * from (
  2052. SELECT
  2053. t.id,
  2054. t.id AS code,
  2055. t.NAME AS NM,
  2056. t.LOC as location,
  2057. IFNULL(B.state, 0) as state,
  2058. t.NAME,
  2059. t.MG_PERS,
  2060. t.MG_PERS_TEL,
  2061. t.AD_CODE,
  2062. t.AD_NAME,
  2063. t.LOC,
  2064. t.NOTE,
  2065. t.CENTER_X,
  2066. t.CENTER_Y,
  2067. t.GD_X,
  2068. t.GD_Y,
  2069. t.INTM,
  2070. t.UPTM,
  2071. t.DATA_STAT
  2072. FROM ATT_SAFETY_BASE T
  2073. LEFT JOIN (
  2074. SELECT a.ID, '1' as state
  2075. FROM ATT_SAFETY_BASE a
  2076. WHERE Exists (select code FROM BIS_INSP_ALL_OBJ o where o.code = a.id and o.ptype = #{objType})
  2077. ) B ON T.ID = B.ID
  2078. WHERE
  2079. T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  2080. ) w
  2081. <where>
  2082. <if test='province !=null and province !="" '>
  2083. and AD_CODE like '${province}%'
  2084. </if>
  2085. <if test='nm != null and nm != "" '>
  2086. and nm like concat('%' , #{nm} , '%')
  2087. </if>
  2088. <if test='adCode != null and adCode != "" '>
  2089. and ${adCode}
  2090. </if>
  2091. </where>
  2092. ORDER BY
  2093. <if test='orderBy != null and orderBy != "" '>${orderBy},</if>
  2094. ad_code
  2095. </select>
  2096. <select id="getYndepListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  2097. select distinct * from (
  2098. SELECT
  2099. t.id AS code,
  2100. t.AD_NAME AS NM,
  2101. t.LOC as location,
  2102. REPLACE(A.AD_FULL_NAME, '-', '') AS AD_FULL_NAME,
  2103. IFNULL(B.state, 0) as state,
  2104. t.DEP_NAME,
  2105. t.UT_LEAD,
  2106. t.PRINCIPAL_TEL,
  2107. t.DEP_PERS,
  2108. t.DEP_PERS_TEL,
  2109. t.AD_CODE,
  2110. t.AD_NAME,
  2111. t.LOC,
  2112. t.NOTE,
  2113. t.CENTER_X,
  2114. t.CENTER_Y,
  2115. t.GD_X,
  2116. t.GD_Y,
  2117. t.INTM,
  2118. t.UPTM,
  2119. t.DATA_STAT
  2120. FROM ATT_YNDEP_BASE T
  2121. LEFT JOIN ATT_AD_BASE A ON A.AD_CODE = T.AD_CODE
  2122. LEFT JOIN (
  2123. SELECT a.ID, '1' as state
  2124. FROM ATT_YNDEP_BASE a
  2125. WHERE Exists (select code FROM BIS_INSP_ALL_OBJ o where o.code = a.id and o.ptype = #{objType})
  2126. ) B ON T.ID = B.ID
  2127. WHERE
  2128. T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  2129. ) w
  2130. <where>
  2131. <if test='province !=null and province !="" '>
  2132. and AD_CODE like '${province}%'
  2133. </if>
  2134. <if test='nm != null and nm != "" '>
  2135. and nm like concat('%' , #{nm} , '%')
  2136. </if>
  2137. <if test='adCode != null and adCode != "" '>
  2138. and ${adCode}
  2139. </if>
  2140. </where>
  2141. ORDER BY
  2142. <if test='orderBy != null and orderBy != "" '>${orderBy},</if>
  2143. ad_code
  2144. </select>
  2145. <select id="getRvgmListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  2146. select distinct * from (
  2147. SELECT
  2148. t.id AS code,
  2149. t.DEP_NAME AS NM,
  2150. t.LOC as location,
  2151. A.AD_FULL_NAME,
  2152. IFNULL(B.state, 0) as state,
  2153. t.DEP_NAME,
  2154. t.UT_LEAD,
  2155. t.PRINCIPAL_TEL,
  2156. t.DEP_PERS,
  2157. t.DEP_PERS_TEL,
  2158. t.AD_CODE,
  2159. t.AD_NAME,
  2160. t.LOC,
  2161. t.NOTE,
  2162. t.CENTER_X,
  2163. t.CENTER_Y,
  2164. t.GD_X,
  2165. t.GD_Y,
  2166. t.INTM,
  2167. t.UPTM,
  2168. t.DATA_STAT
  2169. FROM ATT_RVGM_BASE T
  2170. LEFT JOIN ATT_AD_BASE A ON A.AD_CODE = T.AD_CODE
  2171. LEFT JOIN (
  2172. SELECT a.ID, '1' as state
  2173. FROM ATT_RVGM_BASE a
  2174. WHERE Exists (select code FROM BIS_INSP_ALL_OBJ o where o.code = a.id and o.ptype = #{objType})
  2175. ) B ON T.ID = B.ID
  2176. WHERE
  2177. T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  2178. ) w
  2179. <where>
  2180. <if test='province !=null and province !="" '>
  2181. and AD_CODE like '${province}%'
  2182. </if>
  2183. <if test='nm != null and nm != "" '>
  2184. and nm like concat('%' , #{nm} , '%')
  2185. </if>
  2186. <if test='adCode != null and adCode != "" '>
  2187. and ${adCode}
  2188. </if>
  2189. </where>
  2190. ORDER BY
  2191. <if test='orderBy != null and orderBy != "" '>${orderBy},</if>
  2192. ad_code
  2193. </select>
  2194. <select id="getDpgmListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  2195. SELECT DISTINCT * FROM (
  2196. SELECT
  2197. T.ID AS CODE,
  2198. T.NM,
  2199. T.LOC AS LOCATION,
  2200. A.AD_FULL_NAME,
  2201. IFNULL(B.STATE, 0) AS STATE,
  2202. T.ID,
  2203. T.RV_PERS,
  2204. T.GM_DUTIES,
  2205. T.RV_PERS_TEL,
  2206. T.PERS_ID,
  2207. T.AD_CODE,
  2208. T.AD_NAME,
  2209. T.LOC,
  2210. T.NOTE,
  2211. T.CENTER_X,
  2212. T.CENTER_Y,
  2213. T.GD_X,
  2214. T.GD_Y,
  2215. T.INTM,
  2216. T.UPTM,
  2217. T.DATA_STAT
  2218. FROM ATT_DPGM_BASE T
  2219. LEFT JOIN ATT_AD_BASE A ON A.AD_CODE = T.AD_CODE
  2220. LEFT JOIN (
  2221. SELECT a.ID, '1' as state
  2222. FROM ATT_DPGM_BASE a
  2223. WHERE Exists (select code FROM BIS_INSP_ALL_OBJ o where o.code = a.id and o.ptype = #{objType})
  2224. ) B ON T.ID = B.ID
  2225. WHERE
  2226. T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  2227. ) w
  2228. <where>
  2229. <if test='province !=null and province !="" '>
  2230. and AD_CODE like '${province}%'
  2231. </if>
  2232. <if test='nm != null and nm != "" '>
  2233. and nm like concat('%' , #{nm} , '%')
  2234. </if>
  2235. <if test='adCode != null and adCode != "" '>
  2236. and ${adCode}
  2237. </if>
  2238. </where>
  2239. ORDER BY
  2240. <if test='orderBy != null and orderBy != "" '>${orderBy},</if>
  2241. ad_code
  2242. </select>
  2243. <select id="getWtprjListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  2244. SELECT DISTINCT * FROM (
  2245. SELECT
  2246. T.ID AS CODE,
  2247. T.NM,
  2248. T.LOC AS LOCATION,
  2249. A.AD_FULL_NAME,
  2250. IFNULL(B.STATE, 0) AS STATE,
  2251. T.ID,
  2252. T.PRJ_TYPE,
  2253. T.PRJ_CTGY,
  2254. T.PRJ_RISK,
  2255. T.AD_CODE,
  2256. T.AD_NAME,
  2257. T.LOC,
  2258. T.NOTE,
  2259. T.CENTER_X,
  2260. T.CENTER_Y,
  2261. T.GD_X,
  2262. T.GD_Y,
  2263. T.INTM,
  2264. T.UPTM,
  2265. T.DATA_STAT
  2266. FROM ATT_WTPRJ_BASE T
  2267. LEFT JOIN ATT_AD_BASE A ON A.AD_CODE = T.AD_CODE
  2268. LEFT JOIN (
  2269. SELECT a.ID, '1' as state
  2270. FROM ATT_WTPRJ_BASE a
  2271. WHERE Exists (SELECT CODE FROM BIS_INSP_ALL_OBJ O WHERE O.CODE = A.ID AND O.PTYPE = #{objType})
  2272. ) B ON T.ID = B.ID
  2273. WHERE
  2274. T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  2275. ) w
  2276. <where>
  2277. <if test='province !=null and province !="" '>
  2278. and AD_CODE like '${province}%'
  2279. </if>
  2280. <if test='nm != null and nm != "" '>
  2281. and nm like concat('%' , #{nm} , '%')
  2282. </if>
  2283. <if test='adCode != null and adCode != "" '>
  2284. and ${adCode}
  2285. </if>
  2286. </where>
  2287. ORDER BY
  2288. <if test='orderBy != null and orderBy != "" '>${orderBy},</if>
  2289. ad_code
  2290. </select>
  2291. <select id="getUnwtListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  2292. SELECT DISTINCT * FROM (
  2293. SELECT
  2294. T.ID AS CODE,
  2295. T.NM,
  2296. T.LOC AS LOCATION,
  2297. A.AD_FULL_NAME,
  2298. IFNULL(B.STATE, 0) AS STATE,
  2299. T.ID,
  2300. T.AD_CODE,
  2301. T.AD_NAME,
  2302. T.LOC,
  2303. T.CENTER_X,
  2304. T.CENTER_Y,
  2305. T.GD_X,
  2306. T.GD_Y,
  2307. T.INTM,
  2308. T.UPTM,
  2309. T.DATA_STAT
  2310. FROM ATT_UNWT_BASE T
  2311. LEFT JOIN ATT_AD_BASE A ON A.AD_CODE = T.AD_CODE
  2312. LEFT JOIN (
  2313. SELECT a.ID, '1' as state
  2314. FROM ATT_UNWT_BASE a
  2315. WHERE Exists (SELECT CODE FROM BIS_INSP_ALL_OBJ O WHERE O.CODE = A.ID AND O.PTYPE = #{objType})
  2316. ) B ON T.ID = B.ID
  2317. WHERE
  2318. T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  2319. ) w
  2320. <where>
  2321. <if test='province !=null and province !="" '>
  2322. and AD_CODE like '${province}%'
  2323. </if>
  2324. <if test='nm != null and nm != "" '>
  2325. and nm like concat('%' , #{nm} , '%')
  2326. </if>
  2327. <if test='adCode != null and adCode != "" '>
  2328. and ${adCode}
  2329. </if>
  2330. </where>
  2331. ORDER BY
  2332. <if test='orderBy != null and orderBy != "" '>${orderBy},</if>
  2333. ad_code
  2334. </select>
  2335. <select id="getFloodqhListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  2336. SELECT DISTINCT * FROM (
  2337. SELECT
  2338. T.ID AS CODE,
  2339. T.LOC AS LOCATION,
  2340. A.AD_FULL_NAME,
  2341. IFNULL(B.STATE, 0) AS STATE,
  2342. T.ID,
  2343. T.NM,
  2344. T.FLOOD_TYPE,
  2345. T.AD_CODE,
  2346. T.AD_NAME,
  2347. T.LOC,
  2348. T.CENTER_X,
  2349. T.CENTER_Y,
  2350. T.GD_X,
  2351. T.GD_Y,
  2352. T.INTM,
  2353. T.UPTM,
  2354. T.DATA_STAT
  2355. FROM ATT_FLOODQH_BASE T
  2356. LEFT JOIN ATT_AD_BASE A ON A.AD_CODE = T.AD_CODE
  2357. LEFT JOIN (
  2358. SELECT a.ID, '1' as state
  2359. FROM ATT_FLOODQH_BASE a
  2360. WHERE Exists (SELECT CODE FROM BIS_INSP_ALL_OBJ O WHERE O.CODE = A.ID AND O.PTYPE = #{objType})
  2361. ) B ON T.ID = B.ID
  2362. WHERE
  2363. T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  2364. ) w
  2365. <where>
  2366. <if test='province !=null and province !="" '>
  2367. and AD_CODE like '${province}%'
  2368. </if>
  2369. <if test='nm != null and nm != "" '>
  2370. and nm like concat('%' , #{nm} , '%')
  2371. </if>
  2372. <if test='adCode != null and adCode != "" '>
  2373. and ${adCode}
  2374. </if>
  2375. </where>
  2376. ORDER BY
  2377. <if test='orderBy != null and orderBy != "" '>${orderBy},</if>
  2378. ad_code
  2379. </select>
  2380. <select id="getDstfldqhListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  2381. SELECT DISTINCT * FROM (
  2382. SELECT
  2383. T.ID AS CODE,
  2384. T.LOC AS LOCATION,
  2385. A.AD_FULL_NAME,
  2386. IFNULL(B.STATE, 0) AS STATE,
  2387. T.ID,
  2388. T.NM,
  2389. T.NM AS NAME,
  2390. T.PRJT_TYPE AS PRJ_TYPE,
  2391. T.AD_CODE,
  2392. T.AD_NAME,
  2393. T.LOC,
  2394. T.UNIT,
  2395. T.CONTENT,
  2396. T.NOTE,
  2397. T.CENTER_X,
  2398. T.CENTER_Y,
  2399. T.GD_X,
  2400. T.GD_Y,
  2401. T.INTM,
  2402. T.UPTM,
  2403. T.DATA_STAT
  2404. FROM ATT_DSTFLDQH_BASE T
  2405. LEFT JOIN ATT_AD_BASE A ON A.AD_CODE = T.AD_CODE
  2406. LEFT JOIN (
  2407. SELECT a.ID, '1' as state
  2408. FROM ATT_DSTFLDQH_BASE a
  2409. WHERE Exists (SELECT CODE FROM BIS_INSP_ALL_OBJ O WHERE O.CODE = A.ID AND O.PTYPE = #{objType})
  2410. ) B ON T.ID = B.ID
  2411. WHERE
  2412. T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  2413. ) w
  2414. <where>
  2415. <if test='province !=null and province !="" '>
  2416. and AD_CODE like '${province}%'
  2417. </if>
  2418. <if test='nm != null and nm != "" '>
  2419. and nm like concat('%' , #{nm} , '%')
  2420. </if>
  2421. <if test='adCode != null and adCode != "" '>
  2422. and ${adCode}
  2423. </if>
  2424. </where>
  2425. ORDER BY
  2426. <if test='orderBy != null and orderBy != "" '>${orderBy},</if>
  2427. ad_code
  2428. </select>
  2429. <select id="getAddAxListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.AttSupAdBase">
  2430. select distinct * from (
  2431. SELECT A.GUID,
  2432. A.AD_CODE code,
  2433. A.AD_NAME name,
  2434. A.LOW_LEFT_LONG,
  2435. A.LOW_LEFT_LAT,
  2436. A.UP_RIGHT_LONG,
  2437. A.UP_RIGHT_LAT,
  2438. A.UP_AD_NAME,
  2439. A.AD_GRAD,
  2440. A.AD_ABBR_NAME,
  2441. A.AD_STAT,
  2442. A.AD_AREA,
  2443. A.AD_FULL_NAME,
  2444. A.NOTE,
  2445. A.EFF_DATE,
  2446. A.EXPR_DATE,
  2447. A.AD_STAT_LONG,
  2448. A.AD_STAT_LAT,
  2449. A.DOMAIN_CODE,
  2450. A.AD_SIGN,
  2451. A.MODIFIER_PEOPLE,
  2452. A.UPD_DATE,
  2453. A.IS_REPORT,
  2454. A.AD_FCODE,
  2455. (case when A.IS_POVERYT is null then '0' else A.IS_POVERYT end) IS_POVERYT,
  2456. A.SRC,
  2457. A.REMARK,
  2458. A.AD_LONG,
  2459. A.AD_LAT,
  2460. A.LGTD,
  2461. A.LTTD,
  2462. A.LGTDPC,
  2463. A.LTTDPC
  2464. FROM ATT_AD_BASE A
  2465. WHERE A.AD_GRAD='4'
  2466. AND A.AD_CODE IN (SELECT DISTINCT T.AD_CODE FROM ATT_HYST_BASE T WHERE T.AD_CODE IS NOT NULL)
  2467. AND A.AD_CODE NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%')
  2468. <if test='province !=null and province !="" '>and ad_code like '${province}%'</if>
  2469. )
  2470. <if test="adName != null and adName != ''">and A.AD_NAME LIKE '%${adName}%'</if>
  2471. <if test='nm != null and nm != "" '>and AD_NAME like '%${nm}%'</if>
  2472. <if test='adCode != null and adCode != "" '>and ${adCode}</if>
  2473. <if test="isPkx != null and isPkx != ''">and A.IS_POVERYT =#{isPkx}</if>
  2474. ORDER BY
  2475. <if test='orderBy != null and orderBy != "" '>${orderBy},</if>
  2476. AD_CODE
  2477. ) w
  2478. </select>
  2479. <select id="getStstnListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  2480. SELECT DISTINCT * FROM (
  2481. SELECT
  2482. T.ID AS CODE,
  2483. T.LOC AS LOCATION,
  2484. A.AD_FULL_NAME,
  2485. IFNULL(B.STATE, 0) AS STATE,
  2486. T.ID,
  2487. T.NM,
  2488. T.NM AS NAME,
  2489. T.PRJC_TYPE AS PRJ_TYPE,
  2490. T.AD_CODE,
  2491. T.AD_NAME,
  2492. T.LOC,
  2493. T.COST,
  2494. T.COST_YEAR,
  2495. T.MGR,
  2496. T.OWNER,
  2497. T.QUALITY,
  2498. T.DESIGN,
  2499. T.SUPERVISOR,
  2500. T.BUILD,
  2501. T.PRJC_PERS,
  2502. T.PRJC_PRES_TEL,
  2503. T.CENTER_X,
  2504. T.CENTER_Y,
  2505. T.GD_X,
  2506. T.GD_Y,
  2507. T.INTM,
  2508. T.UPTM,
  2509. T.DATA_STAT
  2510. FROM ATT_STSTN_BASE T
  2511. LEFT JOIN ATT_AD_BASE A ON A.AD_CODE = T.AD_CODE
  2512. LEFT JOIN (
  2513. SELECT a.ID, '1' as state
  2514. FROM ATT_STSTN_BASE a
  2515. WHERE Exists (SELECT CODE FROM BIS_INSP_ALL_OBJ O WHERE O.CODE = A.ID AND O.PTYPE = #{objType})
  2516. ) B ON T.ID = B.ID
  2517. WHERE
  2518. T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  2519. ) w
  2520. <where>
  2521. <if test='province !=null and province !="" '>
  2522. and AD_CODE like '${province}%'
  2523. </if>
  2524. <if test='nm != null and nm != "" '>
  2525. and nm like concat('%' , #{nm} , '%')
  2526. </if>
  2527. <if test='adCode != null and adCode != "" '>
  2528. and ${adCode}
  2529. </if>
  2530. </where>
  2531. ORDER BY
  2532. <if test='orderBy != null and orderBy != "" '>${orderBy},</if>
  2533. ad_code
  2534. </select>
  2535. <select id="getGnrlListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  2536. SELECT DISTINCT * FROM (
  2537. SELECT
  2538. T.ID AS CODE,
  2539. T.LOC AS LOCATION,
  2540. A.AD_FULL_NAME,
  2541. IFNULL(B.STATE, 0) AS STATE,
  2542. T.ID,
  2543. T.NM,
  2544. T.NM AS NAME,
  2545. T.AD_CODE,
  2546. T.AD_NAME,
  2547. T.LOC,
  2548. T.NOTE,
  2549. T.CENTER_X, T.CENTER_Y, T.GD_X, T.GD_Y, T.INTM, T.UPTM, T.OBJ_TYPE
  2550. FROM ATT_GNRL_BASE T
  2551. LEFT JOIN ATT_AD_BASE A ON A.AD_CODE = T.AD_CODE
  2552. LEFT JOIN (
  2553. SELECT a.ID, '1' as state
  2554. FROM ATT_GNRL_BASE a
  2555. WHERE Exists (SELECT CODE FROM BIS_INSP_ALL_OBJ O WHERE O.CODE = A.ID AND O.PTYPE = #{objType})
  2556. ) B ON T.ID = B.ID
  2557. WHERE
  2558. T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  2559. ) w
  2560. <where>
  2561. <if test='province !=null and province !="" '>
  2562. and AD_CODE like '${province}%'
  2563. </if>
  2564. <if test='nm != null and nm != "" '>
  2565. and nm like concat('%' , #{nm} , '%')
  2566. </if>
  2567. <if test='adCode != null and adCode != "" '>
  2568. and ${adCode}
  2569. </if>
  2570. <if test="type != null and type != ''">
  2571. and OBJ_TYPE = #{type}
  2572. </if>
  2573. </where>
  2574. ORDER BY
  2575. <if test='orderBy != null and orderBy != "" '>${orderBy},</if>
  2576. ad_code
  2577. </select>
  2578. <select id="getSwhsjsListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  2579. SELECT DISTINCT * FROM (
  2580. SELECT
  2581. T.ID AS CODE, T.WAIN_LOC AS LOCATION, A.AD_FULL_NAME,
  2582. IFNULL(B.STATE, 0) AS STATE, T.ID,
  2583. T.SWHS_NAME AS NM,
  2584. T.SWHS_NAME AS NAME,
  2585. T.AD_CODE,
  2586. T.AD_NAME,
  2587. T.NOTE,
  2588. T.CENTER_X,
  2589. T.CENTER_Y,
  2590. T.GD_X,
  2591. T.GD_Y,
  2592. T.INTM,
  2593. T.UPTM,
  2594. T.DATA_STAT,
  2595. T.SWHS_CODE,
  2596. T.SWHS_NAME,
  2597. T.WAIN_WASO_TYPE,
  2598. T.SWHS_USE,
  2599. T.SWHS_LEVEL,
  2600. T.WAIN_LOC,
  2601. T.INS_NAME,
  2602. T.INS_PER,
  2603. T.INS_PER_PHONE,
  2604. T.DEPT,
  2605. T.DEPT_PER,
  2606. T.DEPT_PER_PHONE
  2607. FROM ATT_SWHSJS_BASE T
  2608. LEFT JOIN ATT_AD_BASE A ON A.AD_CODE = T.AD_CODE
  2609. LEFT JOIN (
  2610. SELECT a.ID, '1' as state
  2611. FROM ATT_SWHSJS_BASE a
  2612. WHERE Exists (SELECT CODE FROM BIS_INSP_ALL_OBJ O WHERE O.CODE = A.ID AND O.PTYPE = #{objType})
  2613. ) B ON T.ID = B.ID
  2614. WHERE
  2615. T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  2616. ) w
  2617. <where>
  2618. <if test='province !=null and province !="" '>
  2619. and AD_CODE like '${province}%'
  2620. </if>
  2621. <if test='nm != null and nm != "" '>
  2622. and nm like concat('%' , #{nm} , '%')
  2623. </if>
  2624. <if test='adCode != null and adCode != "" '>
  2625. and ${adCode}
  2626. </if>
  2627. </where>
  2628. ORDER BY
  2629. <if test='orderBy != null and orderBy != "" '>${orderBy},</if>
  2630. ad_code
  2631. </select>
  2632. <select id="getRsvrSdListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  2633. SELECT DISTINCT * FROM (
  2634. SELECT
  2635. T.rs_code AS CODE, T.LOCATION AS LOCATION, A.AD_FULL_NAME,
  2636. IFNULL(B.STATE, 0) AS STATE, T.rs_code ID,
  2637. T.rs_name AS NM,
  2638. T.rs_name AS RS_NAME,
  2639. T.rs_name AS NAME,
  2640. T.adm_div AD_CODE,
  2641. T.location AD_NAME,
  2642. T.CENTER_X,
  2643. T.CENTER_Y,
  2644. T.CENTER_X_GD GD_X ,
  2645. T.CENTER_Y_GD GD_Y
  2646. FROM att_rs_base T
  2647. LEFT JOIN ATT_AD_BASE A ON A.AD_CODE = T.adm_div
  2648. LEFT JOIN (
  2649. SELECT a.rs_code , '1' as state
  2650. FROM att_rs_base a
  2651. WHERE Exists (SELECT CODE FROM BIS_INSP_ALL_OBJ O WHERE O.CODE = A.rs_code AND O.PTYPE = #{objType})
  2652. ) B ON T.rs_code = B.rs_code
  2653. WHERE
  2654. T.rs_code NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  2655. ) w
  2656. <where>
  2657. <if test='province !=null and province !="" '>
  2658. and AD_CODE like '${province}%'
  2659. </if>
  2660. <if test='nm != null and nm != "" '>
  2661. and nm like concat('%' , #{nm} , '%')
  2662. </if>
  2663. <if test='adCode != null and adCode != "" '>
  2664. and ${adCode}
  2665. </if>
  2666. </where>
  2667. ORDER BY
  2668. <if test='orderBy != null and orderBy != "" '>${orderBy},</if>
  2669. ad_code
  2670. </select>
  2671. <select id="getXsdyhglListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  2672. SELECT DISTINCT * FROM (
  2673. SELECT
  2674. T . ID AS CODE,
  2675. T .LOC AS LOCATION,
  2676. A .AD_FULL_NAME,
  2677. IFNULL (B.STATE, 0) AS STATE,
  2678. T . ID,
  2679. T .NM AS NM,
  2680. T .NM AS NAME,
  2681. T .AD_CODE,
  2682. T .AD_NAME,
  2683. T .NOTE,
  2684. T .CENTER_X,
  2685. T .CENTER_Y,
  2686. T .GD_X,
  2687. T .GD_Y,
  2688. T .INTM,
  2689. T .UPTM,
  2690. T .DATA_STAT
  2691. FROM ATT_HYSTP_BASE T
  2692. LEFT JOIN ATT_AD_BASE A ON A.AD_CODE = T.AD_CODE
  2693. LEFT JOIN (
  2694. SELECT a.ID, '1' as state
  2695. FROM ATT_HYSTP_BASE a
  2696. WHERE Exists (SELECT CODE FROM BIS_INSP_ALL_OBJ O WHERE O.CODE = A.ID AND O.PTYPE = #{objType})
  2697. ) B ON T.ID = B.ID
  2698. WHERE
  2699. T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  2700. ) w
  2701. <where>
  2702. <if test='province !=null and province !="" '>
  2703. and AD_CODE like '${province}%'
  2704. </if>
  2705. <if test='nm != null and nm != ""'>
  2706. and nm like concat('%' , #{nm} , '%')
  2707. </if>
  2708. <if test='adCode != null and adCode != ""'>
  2709. and ${adCode}
  2710. </if>
  2711. </where>
  2712. ORDER BY
  2713. <if test='orderBy != null and orderBy != "" '>${orderBy},</if>
  2714. ad_code
  2715. </select>
  2716. <select id="getRdwpGdListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.dto.SupervisionPlanDto">
  2717. SELECT DISTINCT *
  2718. FROM (
  2719. SELECT T.ID AS CODE
  2720. , T.SITE_OF_PRJ AS LOCATION
  2721. , A.AD_FULL_NAME
  2722. , IFNULL(B.STATE, 0) AS STATE
  2723. , T.ID
  2724. , T.PRJ_NAME AS NM
  2725. , T.PRJ_NAME AS NAME
  2726. , T.PRJ_TYPE
  2727. , T.AD_CODE
  2728. , T.AD_NAME
  2729. , T.INTM
  2730. , T.UPTM
  2731. , T.DATA_STAT
  2732. FROM ATT_RDWPGD_BASE T
  2733. LEFT JOIN ATT_AD_BASE A ON A.AD_CODE = T.AD_CODE
  2734. LEFT JOIN (
  2735. SELECT a.ID, '1' AS state
  2736. FROM ATT_RDWPGD_BASE a
  2737. WHERE EXISTS(
  2738. SELECT CODE
  2739. FROM BIS_INSP_ALL_OBJ O
  2740. WHERE O.CODE = A.ID
  2741. AND O.PTYPE = #{objType}
  2742. )
  2743. ) B
  2744. ON T.ID = B.ID
  2745. WHERE T.id NOT IN (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE ID LIKE CONCAT(#{inspGroupId},'%'))
  2746. ) w
  2747. <where>
  2748. <if test='province !=null and province !=""'>
  2749. and AD_CODE like '${province}%'
  2750. </if>
  2751. <if test='nm != null and nm != ""'>
  2752. and nm concat(like '%' , #{nm} , '%')
  2753. </if>
  2754. <if test='adCode != null and adCode != ""'>
  2755. and ${adCode}
  2756. </if>
  2757. <if test='prjType != null and prjType != ""'>
  2758. and PRJ_TYPE = #{prjType}
  2759. </if>
  2760. </where>
  2761. ORDER BY
  2762. <if test='orderBy != null and orderBy != "" '>${orderBy},</if>
  2763. ad_code
  2764. </select>
  2765. <select id="getYearMonth" resultType="java.util.Map">
  2766. SELECT A.ID,A.PNM,A.INSP_YEAR,A.INSP_MNTH, DATE_FORMAT(A.STTM,'%Y-%m-%d') STTM,DATE_FORMAT(A.ENTM,'%Y-%m-%d') 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
  2767. </select>
  2768. <select id="getPersAllDtoByIdsList" resultType="cn.com.goldenwater.dcproj.dto.PersAllDto">
  2769. SELECT DISTINCT A.GUID, A.PERS_NAME, B.PERTYPE persType
  2770. FROM BIS_INSP_ALL_RLATION_PERS A
  2771. LEFT JOIN BIS_INSP_ALL_RLATION B
  2772. ON A.GUID = B.PERSID
  2773. WHERE B.ID IN (${ids})
  2774. </select>
  2775. <select id="getPersAllAreaDtoByIdsList" resultType="cn.com.goldenwater.dcproj.dto.PersAllAreaDto">
  2776. SELECT DISTINCT A.AD_CODE, A.AD_NAME
  2777. FROM BIS_INSP_SEL_AREA A
  2778. WHERE A.ID IN (${ids})
  2779. </select>
  2780. <select id="getPersAllObjDtoByIdList" parameterType="String"
  2781. resultType="cn.com.goldenwater.dcproj.dto.PersAllObjDto">
  2782. select B.CODE, B.NM name, B.PTYPE, B.OBJ_ID
  2783. from BIS_INSP_ALL_OBJ B
  2784. WHERE B.ID = #{id}
  2785. </select>
  2786. </mapper>