| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993 |
- <?xml version="1.0" encoding="UTF-8" ?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="cn.com.goldenwater.dcproj.dao.BriefReportDao">
- <resultMap type="cn.com.goldenwater.dcproj.model.BriefReport" id="brief">
- <result property="adCode" column="AD_CODE"/>
- <result property="adName" column="AD_NAME"/>
- <result property="code" column="CODE"/>
- <result property="pnm" column="PNM"/>
- <result property="num" column="NUM"/>
- </resultMap>
- <select id="getGroupCountByType" resultType="int" parameterType="String">
- select count(*)
- from BIS_INSP_ALL t
- where length(id) = 12 and id like '${type}${orgId}%'
- </select>
- <select id="getGroupCountListByType" resultMap="brief" parameterType="java.util.Map">
- select a.code, b.pnm, a.num
- from (select substr(t.id, 1, 6) as code, count(t.id) as num
- from BIS_INSP_ALL t,bis_insp_all_rlation o
- where t.id=o.id and length(t.id) = 12
- <include refid="ochoseSql"/>
- <if test="type != null and type != ''">
- and t.id like CONCAT(#{type},CONCAT(#{orgId},'%'))
- </if>
- <if test="sttm != null and sttm != '' and entm != null and entm != ''">
- AND ((STTM >= TO_DATE(#{sttm},'YYYY-MM-DD') AND ENTM < TO_DATE(#{entm},'YYYY-MM-DD') + 1)
- or( STTM >= TO_DATE(#{sttm},'yyyy-MM-dd') and STTM < TO_DATE(#{entm},'yyyy-MM-dd')+1)
- or( ENTM >= TO_DATE(#{sttm},'yyyy-MM-dd') and ENTM < TO_DATE(#{entm},'yyyy-MM-dd')+1)
- or( STTM <= TO_DATE(#{sttm},'yyyy-MM-dd') and ENTM >= TO_DATE(#{entm},'yyyy-MM-dd')+1))
- </if>
- group by substr(t.id, 1, 6)) a
- left join BIS_INSP_ALL b
- on a.code = b.id
- where 1=1
- <if test="orgName != null and orgName != ''">
- and b.pnm like CONCAT('%',CONCAT(#{orgName}, '%'))
- </if>
- <if test="orgId !=null and orgId !=''">
- and b.id like '___${orgId}%'
- </if>
- order by to_number(a.code)
- </select>
- <select id="getPersCountByType" resultType="int" parameterType="String">
- select count(distinct persid)
- from bis_insp_all_rlation t
- where length(id) = 12 and id like '${type}${orgId}%'
- <include refid="choseSql"/>
- </select>
- <sql id="choseSql">
- <choose>
- <when test="province !=null and province !=''">
- and t.ad_code =#{province}
- </when>
- <otherwise>
- and t.ad_code is null
- </otherwise>
- </choose>
- </sql>
- <select id="getPersCountListByType" resultMap="brief" parameterType="java.util.Map">
- select a.code, b.pnm, a.num
- from (select substr(id, 1, 6) as code, count(distinct persid) as num
- from bis_insp_all_rlation t
- where length(id) = 12
- <include refid="choseSql"/>
- <if test="type != null and type != ''">
- and id like CONCAT(#{type}, '%')
- </if>
- group by substr(id, 1, 6)) a
- left join BIS_INSP_ALL b
- on a.code = b.id
- where 1=1
- <if test="orgName != null and orgName != ''">
- and b.pnm like CONCAT('%',CONCAT(#{orgName}, '%'))
- </if>
- order by to_number(a.code)
- </select>
- <select id="getProCount" resultType="int" parameterType="String">
- select count(distinct ad_code) as num
- from (select distinct substr(ad_code, 1, 2) as ad_code
- from bis_insp_sel_area
- where length(id) > 3
- union all
- select distinct substr(code, 1, 2) as ad_code
- from bis_insp_all_obj t
- where t.ptype = '2'
- union all
- select distinct substr(b.loc_ad, 1, 2) as ad_code
- from bis_insp_all_obj a
- left join BIS_INSP_WTDST b
- on a.code = b.wtdst_id
- where a.ptype = '3'
- ) t
- where ad_code != '00'
- <include refid="choseSql"/>
- </select>
- <select id="getRectProCount" resultType="int" parameterType="String">
- select count(distinct substr(b.loc_ad, 1, 2)) as num
- from bis_insp_all_obj t
- left join BIS_INSP_WTDST b
- on t.code = b.wtdst_id
- where t.ptype = '3'
- <include refid="choseSql"/>
- </select>
- <select id="getRectProCountList" resultMap="brief">
- select a.code, b.pnm, a.num
- from (select q.id as code, count(distinct q.code) as num
- from (select substr(o.id, 1, 6) as id,
- substr(b.loc_ad, 1, 2) as code,o.ad_code
- from BIS_INSP_WTDST_TRACK t
- left join bis_insp_all_obj o
- on t.obj_id = o.obj_id
- left join BIS_INSP_WTDST b
- on o.code = b.wtdst_id
- where length(o.id) > 3
- <if test="state != null and state != ''">
- AND case when t.state is null then '0' else t.state end = #{state}
- </if>
- ) q where 1=1 <include refid="qchose"/>
- group by q.id) a
- left join BIS_INSP_ALL b
- on a.code = b.id
- where 1=1
- <if test="orgName != null and orgName != ''">
- and b.pnm like CONCAT('%',CONCAT(#{orgName}, '%'))
- </if>
- order by to_number(a.code)
- </select>
- <select id="getWagaProCountList" resultMap="brief">
- select a.code, b.pnm, a.num
- from (select q.id as code, count(distinct q.code) as num
- from (select substr(o.id, 1, 6) as id,
- substr(b.AD_CODE, 1, 2) as code
- from ATT_WAGA_RGSTR t
- left join bis_insp_all_obj o
- on t.obj_id = o.obj_id
- left join ATT_WAGA_BASE b
- on o.code = b.OBJ_CODE
- where length(o.id) > 3
- <include refid="ochoseSql"/>
- <if test="state != null and state != ''">
- AND case when t.state is null then '0' else t.state end = #{state}
- </if>
- ) q
- group by q.id) a
- left join BIS_INSP_ALL b
- on a.code = b.id
- where 1=1
- <if test="orgName != null and orgName != ''">
- and b.pnm like CONCAT('%',CONCAT(#{orgName}, '%'))
- </if>
- order by to_number(a.code)
- </select>
- <select id="getEmpwtProCountList" resultMap="brief">
- select a.code, b.pnm, a.num
- from (select q.id as code, count(distinct q.code) as num
- from (select substr(o.id, 1, 6) as id,
- substr(b.AD_CODE, 1, 2) as code
- from BIS_INSP_KEY_REGISTER t
- left join bis_insp_all_obj o
- on t.obj_id = o.obj_id
- left join ATT_EMPWTPRJ_BASE b
- on o.code = b.ID
- where length(o.id) > 3 and b.eng_sta = #{engSta}
- <include refid="ochoseSql"/>
- <if test="state != null and state != ''">
- AND case when t.state is null then '0' else t.state end = #{state}
- </if>
- ) q
- group by q.id) a
- left join BIS_INSP_ALL b
- on a.code = b.id
- where 1=1
- <if test="orgName != null and orgName != ''">
- and b.pnm like CONCAT('%',CONCAT(#{orgName}, '%'))
- </if>
- order by to_number(a.code)
- </select>
- <select id="getRectCtCountList" resultMap="brief" parameterType="String">
- select a.code, b.pnm, a.num
- from (select q.id as code, count(distinct q.code) as num
- from (select substr(o.id, 1, 6) as id,
- substr(b.loc_ad, 1, 6) as code,o.ad_code
- from BIS_INSP_WTDST_TRACK t
- left join bis_insp_all_obj o
- on t.obj_id = o.obj_id
- left join BIS_INSP_WTDST b
- on o.code = b.wtdst_id
- where length(o.id) > 3
- <if test="state != null and state != ''">
- AND case when t.state is null then '0' else t.state end = #{state}
- </if>
- ) q where 1=1 <include refid="qchose"/>
- group by q.id) a
- left join BIS_INSP_ALL b
- on a.code = b.id
- where 1=1
- <if test="orgName != null and orgName != ''">
- and b.pnm like CONCAT('%',CONCAT(#{orgName}, '%'))
- </if>
- order by to_number(a.code)
- </select>
- <select id="getRectCountList" resultMap="brief" parameterType="String">
- select a.code, b.pnm, a.num
- from (select q.id as code, count(q.code) as num
- from (select substr(o.id, 1, 6) as id,
- substr(b.loc_ad, 1, 6) as code,o.ad_code
- from BIS_INSP_WTDST_TRACK t
- left join bis_insp_all_obj o
- on t.obj_id = o.obj_id
- left join BIS_INSP_WTDST b
- on o.code = b.wtdst_id
- where length(o.id) > 3
- <if test="sttm != null and sttm != '' and entm != null and entm != ''">
- AND t.INTM >= TO_DATE(#{sttm},'YYYY-MM-DD') AND t.INTM < TO_DATE(#{entm},'YYYY-MM-DD') + 1
- </if>
- <if test="state != null and state != ''">
- AND case when t.state is null then '0' else t.state end = #{state}
- </if>
- ) q where 1=1 <include refid="qchose"/>
- group by q.id) a
- left join BIS_INSP_ALL b
- on a.code = b.id
- where 1=1
- <if test="orgName != null and orgName != ''">
- and b.pnm like CONCAT('%',CONCAT(#{orgName}, '%'))
- </if>
- order by to_number(a.code)
- </select>
- <select id="getRsvrProCount" resultType="int" parameterType="String">
- select count(distinct substr(ad_code, 1, 2)) as num
- from bis_insp_sel_area
- where length(id) > 3
- <choose>
- <when test="province !=null and province !=''">
- and ad_code like '${province}%'
- </when>
- </choose>
- </select>
- <select id="getRsvrProCountList" resultMap="brief" parameterType="String">
- select a.code, b.pnm, a.num
- from (select t.id as code, count(distinct t.code) as num
- from (select substr(o.id, 1, 6) as id,
- substr(t.ad_code, 1, 2) as code,o.ad_code
- from BIS_INSP_RSVR_RGSTR t
- left join bis_insp_all_obj o
- on t.obj_id = o.obj_id
- where
- o.id not like '001016%'
- and o.id not like '001017%'
- <include refid="ochoseSql"/>
- and length(o.id) > 3
- <if test="state != null and state != ''">
- AND case when t.state is null then '0' else t.state end = #{state}
- </if>
- ) t
- group by t.id) a
- left join BIS_INSP_ALL b
- on a.code = b.id
- where 1=1
- <if test="orgName != null and orgName != ''">
- and b.pnm like CONCAT('%',CONCAT(#{orgName}, '%'))
- </if>
- order by to_number(a.code)
- </select>
- <select id="getRsvrCtCountList" resultMap="brief" parameterType="String">
- select a.code, b.pnm, a.num
- from (select t.id as code, count(distinct t.code) as num
- from (select substr(o.id, 1, 6) as id,
- substr(t.ad_code, 1, 6) as code,o.ad_code
- from BIS_INSP_RSVR_RGSTR t
- left join bis_insp_all_obj o
- on t.obj_id = o.obj_id
- where
- o.id not like '001016%'
- and o.id not like '001017%'
- and length(o.id) > 3
- <include refid="ochoseSql"/>
- <if test="state != null and state != ''">
- AND case when t.state is null then '0' else t.state end = #{state}
- </if>
- ) t
- group by t.id) a
- left join BIS_INSP_ALL b
- on a.code = b.id
- where 1=1
- <if test="orgName != null and orgName != ''">
- and b.pnm like CONCAT('%',CONCAT(#{orgName}, '%'))
- </if>
- order by to_number(a.code)
- </select>
- <select id="getWagaCtCountList" resultMap="brief" parameterType="String">
- select a.code, b.pnm, a.num
- from (select q.id as code, count(distinct q.code) as num
- from (select substr(o.id, 1, 6) as id,
- substr(t.ad_code, 1, 6) as code
- from ATT_WAGA_RGSTR t
- left join bis_insp_all_obj o
- on t.obj_id = o.obj_id
- where length(o.id) > 3
- <include refid="ochoseSql"/>
- <if test="state != null and state != ''">
- AND case when t.state is null then '0' else t.state end = #{state}
- </if>
- ) q
- group by q.id) a
- left join BIS_INSP_ALL b
- on a.code = b.id
- where 1=1
- <if test="orgName != null and orgName != ''">
- and b.pnm like CONCAT('%',CONCAT(#{orgName}, '%'))
- </if>
- order by to_number(a.code)
- </select>
- <select id="getEmpwtCtCountList" resultMap="brief" parameterType="String">
- select a.code, b.pnm, a.num
- from (select q.id as code, count(distinct q.code) as num
- from (select substr(o.id, 1, 6) as id,
- substr(t.ad_code, 1, 6) as code
- from BIS_INSP_KEY_REGISTER t
- left join bis_insp_all_obj o
- on t.obj_id = o.obj_id
- where length(o.id) > 3 and t.eng_sta = #{engSta}
- <include refid="ochoseSql"/>
- <if test="state != null and state != ''">
- AND case when t.state is null then '0' else t.state end = #{state}
- </if>
- ) q
- group by q.id) a
- left join BIS_INSP_ALL b
- on a.code = b.id
- where 1=1
- <if test="orgName != null and orgName != ''">
- and b.pnm like CONCAT('%',CONCAT(#{orgName}, '%'))
- </if>
- order by to_number(a.code)
- </select>
- <select id="getRsvrCountByType" resultType="int" parameterType="String">
- select count(*)
- from bis_insp_all_obj t
- left join att_rs_base b
- on t.code = b.rs_code
- where t.id not like '001016%'
- and t.id not like '001017%'
- and length(t.id) > 3
- and t.ptype = '1'
- <if test="eng_scal != null and eng_scal != ''">
- and b.eng_scal = #{eng_scal}
- </if>
- <include refid="choseSql"/>
- </select>
- <select id="getRsvrCountListByType" resultMap="brief" parameterType="String">
- select a.code, b.pnm, a.num
- from (select q.id as code, count(q.code) as num
- from (select substr(o.id, 1, 6) as id,
- substr(t.ad_code, 1, 6) as code,o.ad_code
- from BIS_INSP_RSVR_RGSTR t
- left join bis_insp_all_obj o
- on t.obj_id = o.obj_id
- where
- length(o.id) > 3
- <include refid="choseSql"/>
- <if test="state != null and state != ''">
- AND case when t.state is null then '0' else t.state end = #{state}
- </if>
- <if test="eng_scal != null and eng_scal != ''">
- and t.eng_scal = #{eng_scal}
- </if>
- <if test="sttm != null and sttm != '' and entm != null and entm != ''">
- AND t.INTM >= TO_DATE(#{sttm},'YYYY-MM-DD') AND t.INTM < TO_DATE(#{entm},'YYYY-MM-DD') + 1
- </if>
- ) q
- where 1=1 <include refid="qchose"/>
- group by q.id) a
- left join BIS_INSP_ALL b
- on a.code = b.id
- where 1=1
- <if test="orgName != null and orgName != ''">
- and b.pnm like CONCAT('%',CONCAT(#{orgName}, '%'))
- </if>
- order by to_number(a.code)
- </select>
- <sql id="qchose">
- <choose>
- <when test="province !=null and province !=''">
- and q.ad_code =#{province}
- </when>
- <otherwise>
- and q.ad_code is null
- </otherwise>
- </choose>
- </sql>
- <select id="getWagaCountListByType" resultMap="brief" parameterType="String">
- select a.code, b.pnm, a.num
- from (select q.id as code, count(q.code) as num
- from (select substr(o.id, 1, 6) as id,
- substr(t.ad_code, 1, 6) as code
- from ATT_WAGA_RGSTR t
- left join bis_insp_all_obj o
- on t.obj_id = o.obj_id
- where length(o.id) > 3
- <include refid="ochoseSql"/>
- <if test="engScal != null and engScal != ''">
- and t.eng_scal = #{engScal}
- </if>
- <if test='engScal == null'>
- and t.eng_scal IS NULL
- </if>
- <if test="sttm != null and sttm != '' and entm != null and entm != ''">
- AND t.INTM >= TO_DATE(#{sttm},'YYYY-MM-DD') AND t.INTM < TO_DATE(#{entm},'YYYY-MM-DD') + 1
- </if>
- <if test="state != null and state != ''">
- AND case when t.state is null then '0' else t.state end = #{state}
- </if>
- ) q
- group by q.id) a
- left join BIS_INSP_ALL b
- on a.code = b.id
- where 1=1
- <if test="orgName != null and orgName != ''">
- and b.pnm like CONCAT('%',CONCAT(#{orgName}, '%'))
- </if>
- order by to_number(a.code)
- </select>
- <select id="getEmpwtCountListByType" resultMap="brief" parameterType="String">
- select a.code, b.pnm, a.num
- from (select q.id as code, count(q.code) as num
- from (select substr(o.id, 1, 6) as id,
- substr(t.ad_code, 1, 6) as code
- from BIS_INSP_KEY_REGISTER t
- left join bis_insp_all_obj o
- on t.obj_id = o.obj_id
- where length(o.id) > 3
- and t.eng_sta = #{engSta}
- <include refid="ochoseSql"/>
- <if test="sttm != null and sttm != '' and entm != null and entm != ''">
- AND t.INTM >= TO_DATE(#{sttm},'YYYY-MM-DD') AND t.INTM < TO_DATE(#{entm},'YYYY-MM-DD') + 1
- </if>
- <if test="state != null and state != ''">
- AND case when t.state is null then '0' else t.state end = #{state}
- </if>
- ) q
- group by q.id) a
- left join BIS_INSP_ALL b
- on a.code = b.id
- where 1=1
- <if test="orgName != null and orgName != ''">
- and b.pnm like CONCAT('%',CONCAT(#{orgName}, '%'))
- </if>
- order by to_number(a.code)
- </select>
- <select id="getVillProCount" resultType="int" parameterType="String">
- select count(distinct substr(code, 1, 2)) as num
- from bis_insp_all_obj t
- where t.ptype = '2'
- <include refid="choseSql"/>
- </select>
- <select id="getVillProCountList" resultMap="brief" parameterType="String">
- select b.code, c.pnm, b.num
- from (select a.id as code, count(distinct a.code) as num
- from (select substr(id, 1, 6) as id, substr(code, 1, 2) as code
- from bis_insp_all_obj t
- where t.ptype = '2'
- <include refid="choseSql"/>
- and t.id not like '002%') a
- group by a.id) b
- left join BIS_INSP_ALL c
- on b.code = c.id
- where 1=1
- <if test="orgName != null and orgName != ''">
- and c.pnm like CONCAT('%',CONCAT(#{orgName}, '%'))
- </if>
- order by to_number(b.code)
- </select>
- <select id="getVillCtCount" resultType="int" parameterType="String">
- select count(distinct substr(code, 1, 6)) as num
- from bis_insp_all_obj t
- where t.ptype = '2'
- <include refid="choseSql"/>
- </select>
- <select id="getVillCtCountList" resultMap="brief" parameterType="String">
- select b.code, c.pnm, b.num
- from (select a.id as code, count(distinct a.code) as num
- from (select substr(id, 1, 6) as id, substr(code, 1, 6) as code
- from bis_insp_all_obj t
- where t.ptype = '2'
- <include refid="choseSql"/>
- and t.id not like '002011%') a
- group by a.id) b
- left join BIS_INSP_ALL c
- on b.code = c.id
- where 1=1
- <if test="orgName != null and orgName != ''">
- and c.pnm like CONCAT('%',CONCAT(#{orgName}, '%'))
- </if>
- order by to_number(b.code)
- </select>
- <select id="getVillVillCount" resultType="int" parameterType="String">
- select count(distinct t.village_code) as num
- from BIS_INSP_SECSURVEY_VLG t
- where 1=1
- <choose>
- <when test="province !=null and province !=''">
- and t.village_code like '${province}%'
- </when>
- </choose>
- </select>
- <select id="getVillVillCountList" resultMap="brief" parameterType="String">
- select q.code, w.pnm, q.num
- from (select substr(t.id, 1, 6) as code,
- count( t.village_code) as num
- from (select t.village_code, o.id, o.nm, o.code,o.ad_code
- from BIS_INSP_SECSURVEY_VLG t
- join BIS_INSP_VILL_RGSTR r
- on t.eng_id = r.eng_id
- join bis_insp_all_obj o
- on r.obj_id = o.obj_id
- WHERE 1 = 1
- <include refid="ochoseSql"/>
- <if test="sttm != null and sttm != '' and entm != null and entm != ''">
- AND t.CREATE_TIME >= TO_DATE(#{sttm},'YYYY-MM-DD') AND t.CREATE_TIME < TO_DATE(#{entm},'YYYY-MM-DD') + 1
- </if>
- <if test="state != null and state != ''">
- AND case when r.state is null then '0' ELSE r.state end = #{state}
- </if>
- ) t where 1=1
- group by substr(t.id, 1, 6)) q
- left join BIS_INSP_ALL w
- on q.code = w.id
- where 1=1
- <if test="orgName != null and orgName != ''">
- and w.pnm like CONCAT('%',CONCAT(#{orgName}, '%'))
- </if>
- order by to_number(q.code)
- </select>
- <select id="getVillPersCount" resultType="int" parameterType="String">
- select count(*)
- from BIS_INSP_WATERUSER_INFO a
- where 1=1
- <choose>
- <when test="province !=null and province !=''">
- and a.village_code like '${province}%'
- </when>
- </choose>
- </select>
- <select id="getVillPersCountList" resultMap="brief" parameterType="String">
- select q.code, w.pnm, q.num
- from (select substr(t.id, 1, 6) as code,
- count(t.village_code) as num
- from (select t.village_code, o.id, o.nm, o.code,o.ad_code
- from BIS_INSP_WATERUSER_INFO t
- join BIS_INSP_VILL_RGSTR r
- on t.eng_id = r.eng_id
- join bis_insp_all_obj o
- on r.obj_id = o.obj_id
- WHERE 1 = 1
- <include refid="ochoseSql"/>
- <if test="sttm != null and sttm != '' and entm != null and entm != ''">
- AND t.CREATE_TIME >= TO_DATE(#{sttm},'YYYY-MM-DD') AND t.CREATE_TIME < TO_DATE(#{entm},'YYYY-MM-DD') + 1
- </if>
- <if test="state != null and state != ''">
- AND case when r.state is null then '0' ELSE r.state end = #{state}
- </if>
- ) t where 1=1
- group by substr(t.id, 1, 6)) q
- left join BIS_INSP_ALL w
- on q.code = w.id
- where 1=1
- <if test="orgName != null and orgName != ''">
- and w.pnm like CONCAT('%',CONCAT(#{orgName}, '%'))
- </if>
- order by to_number(q.code)
- </select>
- <select id="getVillCwsCountList" resultMap="brief" parameterType="String">
- select q.code, w.pnm, q.num
- from (select substr(t.id, 1, 6) as code,
- count(t.CWS_CODE) as num
- from (select t.CWS_CODE, o.id, o.nm, o.code,o.ad_code
- from BIS_INSP_VLGDRINK_PROJ_MANAGE t
- join BIS_INSP_VILL_RGSTR r
- on t.eng_id = r.eng_id
- join bis_insp_all_obj o
- on r.obj_id = o.obj_id
- WHERE 1 = 1
- <include refid="ochoseSql"/>
- <if test="sttm != null and sttm != '' and entm != null and entm != ''">
- AND t.CREATE_TIME >= TO_DATE(#{sttm},'YYYY-MM-DD') AND t.CREATE_TIME < TO_DATE(#{entm},'YYYY-MM-DD') + 1
- </if>
- <if test="state != null and state != ''">
- AND case when r.state is null then '0' ELSE r.state end = #{state}
- </if>
- ) t where 1=1
- group by substr(t.id, 1, 6)) q
- left join BIS_INSP_ALL w
- on q.code = w.id
- where 1=1
- <if test="orgName != null and orgName != ''">
- and w.pnm like CONCAT('%',CONCAT(#{orgName}, '%'))
- </if>
- order by to_number(q.code)
- </select>
- <select id="getVillWaterCountList" resultMap="brief">
- select q.code, w.pnm, q.num
- from (select substr(t.id, 1, 6) as code,
- count(t.WATER_SOURCE_NM) as num
- from (select t.WATER_SOURCE_NM, o.id, o.nm, o.code,o.ad_code
- from BIS_INSP_PRO_SOURCE_PROTECT t
- join BIS_INSP_VILL_RGSTR r
- on t.eng_id = r.eng_id
- join bis_insp_all_obj o
- on r.obj_id = o.obj_id
- WHERE 1 = 1
- <include refid="ochoseSql"/>
- <if test="sttm != null and sttm != '' and entm != null and entm != ''">
- AND t.CREATE_TIME >= TO_DATE(#{sttm},'YYYY-MM-DD') AND t.CREATE_TIME < TO_DATE(#{entm},'YYYY-MM-DD') + 1
- </if>
- <if test="state != null and state != ''">
- AND case when r.state is null then '0' ELSE r.state end = #{state}
- </if>
- ) t where 1=1
- group by substr(t.id, 1, 6)) q
- left join BIS_INSP_ALL w
- on q.code = w.id
- where 1=1
- <if test="orgName != null and orgName != ''">
- and w.pnm like CONCAT('%',CONCAT(#{orgName}, '%'))
- </if>
- order by to_number(q.code)
- </select>
- <select id="getPblmCountList" resultMap="brief" parameterType="java.util.Map">
- select a.code, b.pnm, a.num
- from (select t.code, count(t.pblm_id) as num
- from (select substr(o.id, 1, 6) as code, t.pblm_id,o.ad_code
- from BIS_INSP_PBLM t
- join bis_insp_all_obj o
- on t.obj_id = o.obj_id
- left join
- <if test='objType == "1" or objType=="36"'>
- BIS_INSP_RSVR_RGSTR
- </if>
- <if test='objType == "2"'>
- BIS_INSP_VILL_RGSTR
- </if>
- <if test='objType == "3"'>
- BIS_INSP_WTDST_TRACK
- </if>
- <if test='objType == "4"'>
- BIS_INSP_KEY_REGISTER
- </if>
- <if test='objType == "6"'>
- ATT_WAGA_RGSTR
- </if>
- <if test='objType == "7"'>
- BIS_INSP_KEY_REGISTER
- </if>
- B ON t.OBJ_ID = B.OBJ_ID
- where 1=1
- <include refid="ochoseSql"/>
- <if test="sttm != null and sttm != ''">
- and t.coll_time >= to_date(#{sttm}, 'yyyy-MM-dd')
- </if>
- <if test="entm != null and entm != ''">
- and t.coll_time < to_date(#{entm}, 'yyyy-MM-dd') + 1
- </if>
- <if test="cate != null and cate != ''">
- and t.insp_pblm_cate = #{cate}
- </if>
- <if test="objType != null and objType != ''">
- and t.obj_type = #{objType}
- </if>
- <if test="stat != null and stat != ''">
- and t.PBLM_STAT = #{stat}
- </if>
- <if test="state != null and state != ''">
- AND case when B.state is null then '0' else B.state end = #{state}
- </if>
- ) t
- group by t.code) a
- left join BIS_INSP_ALL b
- on a.code = b.id
- where a.code is not null
- <if test="orgName != null and orgName != ''">
- and b.pnm like CONCAT('%',CONCAT(#{orgName}, '%'))
- </if>
- order by to_number(a.code)
- </select>
- <select id="getPblmCount" resultType="int" parameterType="java.util.Map">
- select count(*)
- from BIS_INSP_PBLM t,BIS_INSP_ALL_OBJ o
- where t.OBJ_ID=o.OBJ_ID
- <if test="sttm != null and sttm != ''">
- and t.coll_time >= to_date(#{sttm}, 'yyyy-MM-dd')
- </if>
- <if test="entm != null and entm != ''">
- and t.coll_time < to_date(#{entm}, 'yyyy-MM-dd') + 1
- </if>
- <if test="cate != null and cate != ''">
- and t.insp_pblm_cate = #{cate}
- </if>
- <if test="objType != null and objType != ''">
- and t.obj_type = #{objType}
- </if>
- <if test="stat != null and stat != ''">
- and t.PBLM_STAT = #{stat}
- </if>
- <include refid="ochoseSql"/>
- </select>
- <sql id="ochoseSql">
- <choose>
- <when test="province !=null and province !=''">
- and o.ad_code =#{province}
- </when>
- <otherwise>
- and o.ad_code is null
- </otherwise>
- </choose>
- </sql>
- <select id="getPblmList" resultType="java.util.Map" parameterType="java.util.Map">
- select c.ad_full_name, t.pblm_id,t.obj_id,t.obj_type,t.insp_pblm_code,t.insp_pblm_name,t.insp_pblm_desc,t.if_case_pblm,t.insp_pblm_cate,t.pblm_stat,t.data_stat,to_char(t.coll_time,'yyyy-MM-dd HH24') as coll_time,t.rec_pers,t.note,t.regid,t.pblms_id,t.pblms_type_id,t.vill_type,t.cws_code,t.village_code,to_char(d.file_path) as file_path
- from BIS_INSP_PBLM t
- join BIS_INSP_ALL_OBJ o
- on t.OBJ_ID=o.OBJ_ID
- left join att_ad_x_base c
- on t.village_code = c.ad_code
- LEFT JOIN (SELECT BIZ_ID, LISTAGG(FILE_PATH, ',') AS file_path
- FROM gw_com_file
- GROUP BY BIZ_ID) d
- on t.pblm_id = d.biz_id
- where 1=1
- <if test="sttm != null and sttm != ''">
- and t.coll_time >= to_date(#{sttm}, 'yyyy-MM-dd')
- </if>
- <if test="entm != null and entm != ''">
- and t.coll_time < to_date(#{entm}, 'yyyy-MM-dd') + 1
- </if>
- <if test="cate != null and cate != ''">
- and t.insp_pblm_cate = #{cate}
- </if>
- <if test="objType != null and objType != ''">
- and t.obj_type = #{objType}
- </if>
- <if test="stat != null and stat != ''">
- and t.PBLM_STAT = #{stat}
- </if>
- <if test="ifCase != null and ifCase != ''">
- and t.IF_CASE_PBLM = #{ifCase}
- </if>
- <if test="villType != null and villType != ''">
- and t.vill_type = #{villType}
- </if>
- <include refid="ochoseSql"/>
- </select>
- <!--省加单位-组-->
- <select id="getOrgProGroupList" resultMap="brief" parameterType="String">
- SELECT CONCAT(H.AD_CODE, '${zero}') AS AD_CODE,
- G.AD_NAME,
- H.ID AS CODE,
- E.PNM,
- H.NUM
- FROM (SELECT SUBSTR(F.AD_CODE, 1, ${length}) AS AD_CODE,
- SUBSTR(F.ID, 1, 6) AS ID,
- COUNT(DISTINCT F.ID) AS NUM
- FROM (SELECT J.ID,J.PNM,
- A.PTYPE,A.AD_CODE as province,
- <if test='type == "001" or type=="036"'>
- OB.ADM_DIV AS AD_CODE
- FROM BIS_INSP_ALL J
- LEFT JOIN BIS_INSP_ALL_OBJ A ON J.ID=A.ID
- left join ATT_RS_BASE OB ON A.CODE = OB.RS_CODE
- </if>
- <if test='type == "002"'>
- A.CODE AS AD_CODE
- FROM BIS_INSP_ALL J
- LEFT JOIN BIS_INSP_ALL_OBJ A ON J.ID=A.ID
- </if>
- <if test='type == "003"'>
- OB.LOC_AD AS AD_CODE
- FROM BIS_INSP_ALL J
- LEFT JOIN BIS_INSP_ALL_OBJ A ON J.ID=A.ID
- left join BIS_INSP_WTDST OB ON A.CODE = OB.WTDST_ID
- </if>
- <if test='type == "004"'>
- OB.AD_CODE AS AD_CODE
- FROM BIS_INSP_ALL J
- LEFT JOIN BIS_INSP_ALL_OBJ A ON J.ID=A.ID
- left join ATT_EMPWTPRJ_BASE OB ON A.CODE = OB.ID
- </if>
- <if test='type == "005"'>
- OB.ADCD AS AD_CODE
- FROM BIS_INSP_ALL J
- LEFT JOIN BIS_INSP_ALL_OBJ A ON J.ID=A.ID
- left join ATT_GRW_BASE OB ON A.CODE = OB.STCD
- </if>
- <if test='type == "006"'>
- OB.AD_CODE AS AD_CODE
- FROM BIS_INSP_ALL J
- LEFT JOIN BIS_INSP_ALL_OBJ A ON J.ID=A.ID
- left join ATT_WAGA_BASE OB ON A.CODE = OB.OBJ_CODE
- </if>
- <if test='type == "007"'>
- OB.AD_CODE AS AD_CODE
- FROM BIS_INSP_ALL J
- LEFT JOIN BIS_INSP_ALL_OBJ A ON J.ID=A.ID
- left join ATT_EMPWTPRJ_BASE OB ON A.CODE = OB.ID
- </if>
- <if test='type == "009"'>
- r.AD_CODE AS AD_CODE
- FROM BIS_INSP_ALL J
- LEFT JOIN BIS_INSP_ALL_OBJ A ON J.ID=A.ID
- LEFT JOIN BIS_INSP_FSC_RGSTR r ON r.OBJ_ID = A.OBJ_ID
- </if>
- <if test='type == "010"'>
- r.AD_CODE AS AD_CODE
- FROM BIS_INSP_ALL J
- LEFT JOIN BIS_INSP_ALL_OBJ A ON J.ID=A.ID
- LEFT JOIN BIS_INSP_OTHER_RGSTR r ON r.OBJ_ID = A.OBJ_ID
- </if>
- <if test='type == "011"'>
- r.AD_CODE AS AD_CODE
- FROM BIS_INSP_ALL J
- LEFT JOIN BIS_INSP_ALL_OBJ A ON J.ID=A.ID
- LEFT JOIN BIS_INSP_SD_RGSTR r ON r.OBJ_ID = A.OBJ_ID
- </if>
- <if test='type == "012"'>
- r.AD_CODE AS AD_CODE
- FROM BIS_INSP_ALL J
- LEFT JOIN BIS_INSP_ALL_OBJ A ON J.ID=A.ID
- LEFT JOIN BIS_INSP_WIU_RGSTR r ON r.OBJ_ID = A.OBJ_ID
- </if>
- <if test='type == "013"'>
- r.AD_CODE AS AD_CODE
- FROM BIS_INSP_ALL J
- LEFT JOIN BIS_INSP_ALL_OBJ A ON J.ID=A.ID
- LEFT JOIN BIS_INSP_SWHS_RGSTR r ON r.OBJ_ID = A.OBJ_ID
- </if>
- <if test='type == "014"'>
- r.AD_CODE AS AD_CODE
- FROM BIS_INSP_ALL J
- LEFT JOIN BIS_INSP_ALL_OBJ A ON J.ID=A.ID
- LEFT JOIN BIS_INSP_WINT_RGSTR r ON r.OBJ_ID = A.OBJ_ID
- </if>
- <if test='type == "015"'>
- r.AD_CODE AS AD_CODE
- FROM BIS_INSP_ALL J
- LEFT JOIN BIS_INSP_ALL_OBJ A ON J.ID=A.ID
- LEFT JOIN BIS_INSP_SVWT_AREA_RGSTR r ON r.OBJ_ID = A.OBJ_ID
- </if>
- <if test='type == "016"'>
- r.AD_CODE AS AD_CODE
- FROM BIS_INSP_ALL J
- LEFT JOIN BIS_INSP_ALL_OBJ A ON J.ID=A.ID
- LEFT JOIN BIS_INSP_SVWT_WUNT_RGSTR r ON r.OBJ_ID = A.OBJ_ID
- </if>
- WHERE LENGTH(J.ID) = 12
- <if test="type != null and type != ''">
- AND J.ID LIKE CONCAT(#{type}, '%')
- </if>
- <if test="sttm != null and sttm != '' and entm != null and entm != ''">
- AND J.STTM >= TO_DATE(#{sttm},'YYYY-MM-DD') AND J.ENTM < TO_DATE(#{entm},'YYYY-MM-DD') + 1
- </if>
- ) F where 1=1
- <include refid="fchose"/>
- GROUP BY SUBSTR(F.AD_CODE, 1, ${length}), SUBSTR(F.ID, 1, 6)) H
- LEFT JOIN BIS_INSP_ALL E
- ON H.ID = E.ID
- LEFT JOIN ATT_AD_X_BASE G
- ON CONCAT(H.AD_CODE, '${zero}') = G.AD_CODE
- where 1=1
- <if test="orgName != null and orgName != ''">
- and E.pnm like CONCAT('%',CONCAT(#{orgName}, '%'))
- </if>
- <if test="adName != null and adName != ''">
- and G.ad_name like CONCAT('%',CONCAT(#{adName}, '%'))
- </if>
- ORDER BY H.AD_CODE, H.ID
- </select>
- <!--省加单位-人-->
- <select id="getOrgProPersList" resultMap="brief" parameterType="String">
- SELECT CONCAT(H.AD_CODE, '${zero}') AS AD_CODE,
- G.AD_NAME,
- H.ID AS CODE,
- E.PNM,
- H.NUM
- FROM (SELECT SUBSTR(F.AD_CODE, 1, ${length}) AS AD_CODE,
- SUBSTR(F.ID, 1, 6) AS ID,
- COUNT(DISTINCT F.PERSID) AS NUM
- FROM (SELECT J.ID,
- A.PTYPE,J.PERSID,A.AD_CODE as province,
- <if test='type == "001" or type="036"'>
- OB.ADM_DIV AS AD_CODE
- FROM BIS_INSP_ALL_RLATION J
- LEFT JOIN BIS_INSP_ALL_OBJ A ON J.ID=A.ID
- left join ATT_RS_BASE OB ON A.CODE = OB.RS_CODE
- </if>
- <if test='type == "002"'>
- A.CODE AS AD_CODE
- FROM BIS_INSP_ALL_RLATION J
- LEFT JOIN BIS_INSP_ALL_OBJ A ON J.ID=A.ID
- </if>
- <if test='type == "003"'>
- OB.LOC_AD AS AD_CODE
- FROM BIS_INSP_ALL_RLATION J
- LEFT JOIN BIS_INSP_ALL_OBJ A ON J.ID=A.ID
- left join BIS_INSP_WTDST OB ON A.CODE = OB.WTDST_ID
- </if>
- <if test='type == "004"'>
- OB.AD_CODE AS AD_CODE
- FROM BIS_INSP_ALL_RLATION J
- LEFT JOIN BIS_INSP_ALL_OBJ A ON J.ID=A.ID
- left join ATT_EMPWTPRJ_BASE OB ON A.CODE = OB.ID
- </if>
- <if test='type == "005"'>
- OB.ADCD AS AD_CODE
- FROM BIS_INSP_ALL_RLATION J
- LEFT JOIN BIS_INSP_ALL_OBJ A ON J.ID=A.ID
- left join ATT_GRW_BASE OB ON A.CODE = OB.STCD
- </if>
- <if test='type == "006"'>
- OB.AD_CODE AS AD_CODE
- FROM BIS_INSP_ALL_RLATION J
- LEFT JOIN BIS_INSP_ALL_OBJ A ON J.ID=A.ID
- left join ATT_WAGA_BASE OB ON A.CODE = OB.OBJ_CODE
- </if>
- <if test='type == "007"'>
- OB.AD_CODE AS AD_CODE
- FROM BIS_INSP_ALL_RLATION J
- LEFT JOIN BIS_INSP_ALL_OBJ A ON J.ID=A.ID
- left join ATT_EMPWTPRJ_BASE OB ON A.CODE = OB.ID
- </if>
- <if test='type == "009"'>
- r.AD_CODE AS AD_CODE
- FROM BIS_INSP_ALL_RLATION J
- LEFT JOIN BIS_INSP_ALL_OBJ A ON J.ID=A.ID
- LEFT JOIN BIS_INSP_FSC_RGSTR r ON r.OBJ_ID = A.OBJ_ID
- </if>
- <if test='type == "010"'>
- r.AD_CODE AS AD_CODE
- FROM BIS_INSP_ALL_RLATION J
- LEFT JOIN BIS_INSP_ALL_OBJ A ON J.ID=A.ID
- LEFT JOIN BIS_INSP_OTHER_RGSTR r ON r.OBJ_ID = A.OBJ_ID
- </if>
- <if test='type == "011"'>
- r.AD_CODE AS AD_CODE
- FROM BIS_INSP_ALL_RLATION J
- LEFT JOIN BIS_INSP_ALL_OBJ A ON J.ID=A.ID
- LEFT JOIN BIS_INSP_SD_RGSTR r ON r.OBJ_ID = A.OBJ_ID
- </if>
- <if test='type == "012"'>
- r.AD_CODE AS AD_CODE
- FROM BIS_INSP_ALL_RLATION J
- LEFT JOIN BIS_INSP_ALL_OBJ A ON J.ID=A.ID
- LEFT JOIN BIS_INSP_WIU_RGSTR r ON r.OBJ_ID = A.OBJ_ID
- </if>
- <if test='type == "013"'>
- r.AD_CODE AS AD_CODE
- FROM BIS_INSP_ALL_RLATION J
- LEFT JOIN BIS_INSP_ALL_OBJ A ON J.ID=A.ID
- LEFT JOIN BIS_INSP_SWHS_RGSTR r ON r.OBJ_ID = A.OBJ_ID
- </if>
- <if test='type == "014"'>
- r.AD_CODE AS AD_CODE
- FROM BIS_INSP_ALL_RLATION J
- LEFT JOIN BIS_INSP_ALL_OBJ A ON J.ID=A.ID
- LEFT JOIN BIS_INSP_WINT_RGSTR r ON r.OBJ_ID = A.OBJ_ID
- </if>
- <if test='type == "015"'>
- r.AD_CODE AS AD_CODE
- FROM BIS_INSP_ALL_RLATION J
- LEFT JOIN BIS_INSP_ALL_OBJ A ON J.ID=A.ID
- LEFT JOIN BIS_INSP_SVWT_AREA_RGSTR r ON r.OBJ_ID = A.OBJ_ID
- </if>
- <if test='type == "016"'>
- r.AD_CODE AS AD_CODE
- FROM BIS_INSP_ALL_RLATION J
- LEFT JOIN BIS_INSP_ALL_OBJ A ON J.ID=A.ID
- LEFT JOIN BIS_INSP_SVWT_WUNT_RGSTR r ON r.OBJ_ID = A.OBJ_ID
- </if>
- WHERE LENGTH(J.ID) = 12
- <if test="type != null and type != ''">
- AND J.ID LIKE CONCAT(#{type}, '%')
- </if>
- ) F where 1=1
- <include refid="repeatSql"/>
- GROUP BY SUBSTR(F.AD_CODE, 1, ${length}), SUBSTR(F.ID, 1, 6)) H
- LEFT JOIN BIS_INSP_ALL E
- ON H.ID = E.ID
- LEFT JOIN ATT_AD_X_BASE G
- ON CONCAT(H.AD_CODE, '${zero}') = G.AD_CODE
- where 1=1
- <if test="orgName != null and orgName != ''">
- and e.pnm like CONCAT('%',CONCAT(#{orgName}, '%'))
- </if>
- <if test="adName != null and adName != ''">
- and G.ad_name like CONCAT('%',CONCAT(#{adName}, '%'))
- </if>
- order by to_number(G.ad_code),to_number(e.id)
- </select>
- <sql id="repeatSql">
- <choose>
- <when test="province !=null and province !=''">
- and F.province =#{province}
- </when>
- <otherwise>
- and F.province is null
- </otherwise>
- </choose>
- </sql>
- <!--省加单位-小水库-县-->
- <select id="getOrgProCountryList" resultMap="brief" parameterType="String">
- select ad.ad_code,ad.ad_name,a.code, b.pnm, a.num
- from (select q.id as code,q.code as ad_code, count(distinct q.xian) as num
- from (select substr(o.id, 1, 6) as id,
- substr(t.ad_code, 1, ${length}) as code,substr(t.ad_code, 1, 6) as xian,o.ad_code
- from BIS_INSP_RSVR_RGSTR t
- left join bis_insp_all_obj o
- on t.obj_id = o.obj_id
- where length(o.id) > 3
- <if test="state != null and state != ''">
- AND case when t.state is null then '0' else t.state end = #{state}
- </if>
- ) q where 1=1
- <include refid="qchose"/>
- group by q.id,q.code) a
- left join BIS_INSP_ALL b
- on a.code = b.id
- left join att_ad_base ad on concat(a.ad_code,'${zero}') = ad.ad_code
- where 1=1
- <if test="orgName != null and orgName != ''">
- and b.pnm like CONCAT('%',CONCAT(#{orgName}, '%'))
- </if>
- <if test="adName != null and adName != ''">
- and ad.ad_name like CONCAT('%',CONCAT(#{adName}, '%'))
- </if>
- order by to_number(ad.ad_code),to_number(a.code)
- </select>
- <!--省加单位-小水库-水库-->
- <select id="getOrgProRsvrList" resultMap="brief" parameterType="String">
- select ad.ad_code, ad.ad_name, a.code, b.pnm, a.num
- from (select q.id as code,
- q.code as ad_code,
- count( q.rs_code) as num
- from (select substr(o.id, 1, 6) as id,
- substr(t.ad_code, 1, ${length}) as code,
- t.rs_code,o.ad_code
- from BIS_INSP_RSVR_RGSTR t
- left join bis_insp_all_obj o
- on t.obj_id = o.obj_id
- where length(o.id) > 3
- <if test="state != null and state != ''">
- AND case when t.state is null then '0' else t.state end = #{state}
- </if>
- <if test="eng_scal != null and eng_scal != ''">
- and t.eng_scal = #{eng_scal}
- </if>
- <if test="sttm != null and sttm != '' and entm != null and entm != ''">
- AND t.INTM >= TO_DATE(#{sttm},'YYYY-MM-DD') AND t.INTM < TO_DATE(#{entm},'YYYY-MM-DD') + 1
- </if>
- ) q where 1=1 <include refid="qchose"/>
- group by q.id, q.code) a
- left join BIS_INSP_ALL b
- on a.code = b.id
- left join att_ad_base ad
- on concat(a.ad_code, '${zero}') = ad.ad_code
- where 1=1
- <if test="orgName != null and orgName != ''">
- and b.pnm like CONCAT('%',CONCAT(#{orgName}, '%'))
- </if>
- <if test="adName != null and adName != ''">
- and ad.ad_name like CONCAT('%',CONCAT(#{adName}, '%'))
- </if>
- order by to_number(ad.ad_code),to_number(a.code)
- </select>
- <!--省加单位-水闸数量-->
- <select id="getOrgProWagaList" resultMap="brief" parameterType="String">
- select ad.ad_code, ad.ad_name, a.code, b.pnm, a.num
- from (select q.id as code,
- q.code as ad_code,
- count( q.OBJ_code) as num
- from (select substr(o.id, 1, 6) as id,
- substr(t.ad_code, 1, 2) as code,
- t.OBJ_code
- from ATT_WAGA_RGSTR t
- left join bis_insp_all_obj o
- on t.obj_id = o.obj_id
- where length(o.id) > 3
- <include refid="ochoseSql"/>
- <if test="state != null and state != ''">
- AND case when t.state is null then '0' ELSE t.state end = #{state}
- </if>
- <if test="sttm != null and sttm != '' and entm != null and entm != ''">
- AND t.INTM >= TO_DATE(#{sttm},'YYYY-MM-DD') AND t.INTM < TO_DATE(#{entm},'YYYY-MM-DD') + 1
- </if>
- <if test="engScal != null and engScal != ''">
- and t.eng_scal = #{engScal}
- </if>
- <if test='engScal == null'>
- AND t.eng_scal IS NULL
- </if>
- ) q
- group by q.id, q.code) a
- left join BIS_INSP_ALL b
- on a.code = b.id
- left join att_ad_base ad
- on concat(a.ad_code, '0000000000') = ad.ad_code
- where 1=1
- <if test="orgName != null and orgName != ''">
- and b.pnm like CONCAT('%',CONCAT(#{orgName}, '%'))
- </if>
- <if test="adName != null and adName != ''">
- and ad.ad_name like CONCAT('%',CONCAT(#{adName}, '%'))
- </if>
- order by to_number(ad.ad_code),to_number(a.code)
- </select>
- <!--省加单位-问题列表-->
- <select id="getOrgProPblmList" resultMap="brief" parameterType="String">
- select AD.AD_CODE,AD.AD_NAME,a.code, b.pnm, a.num
- from (select SUBSTR(Q.AD_CODE,1,${length}) AS AD_CODE,q.code, count(q.pblm_id) as num
- from (select substr(o.id, 1, 6) as code,o.ad_code as province,t.pblm_id,
- <if test='objType == "1" or objType=="36"'>
- OB.ADM_DIV AS AD_CODE
- from BIS_INSP_PBLM t
- left join bis_insp_all_obj o
- on t.obj_id = o.obj_id
- left join ATT_RS_BASE OB ON O.CODE = OB.RS_CODE
- LEFT JOIN BIS_INSP_RSVR_RGSTR B ON t.OBJ_ID = B.OBJ_ID
- </if>
- <if test='objType == "2"'>
- o.CODE AS AD_CODE
- from BIS_INSP_PBLM t
- left join bis_insp_all_obj o
- on t.obj_id = o.obj_id
- LEFT JOIN BIS_INSP_VILL_RGSTR B ON t.OBJ_ID = B.OBJ_ID
- </if>
- <if test='objType == "3"'>
- OB.LOC_AD AS AD_CODE
- from BIS_INSP_PBLM t
- left join bis_insp_all_obj o
- on t.obj_id = o.obj_id
- left join BIS_INSP_WTDST OB ON O.CODE = OB.WTDST_ID
- LEFT JOIN BIS_INSP_WTDST_TRACK B ON t.OBJ_ID = B.OBJ_ID
- </if>
- <if test='objType == "4"'>
- OB.AD_CODE AS AD_CODE
- from BIS_INSP_PBLM t
- left join bis_insp_all_obj o
- on t.obj_id = o.obj_id
- left join ATT_EMPWTPRJ_BASE OB ON O.CODE = OB.ID
- LEFT JOIN BIS_INSP_KEY_REGISTER B ON t.OBJ_ID = B.OBJ_ID
- </if>
- <if test='objType == "5"'>
- OB.ADCD AS AD_CODE
- from BIS_INSP_PBLM t
- left join bis_insp_all_obj o
- on t.obj_id = o.obj_id
- left join ATT_GRW_BASE OB ON O.CODE = OB.STCD
- left join BIS_INSP_GRW B on t.obj_id = B.obj_id
- </if>
- <if test='objType == "6"'>
- OB.AD_CODE AS AD_CODE
- from BIS_INSP_PBLM t
- left join bis_insp_all_obj o
- on t.obj_id = o.obj_id
- left join ATT_WAGA_BASE OB ON O.CODE = OB.OBJ_CODE
- LEFT JOIN ATT_WAGA_RGSTR B ON t.OBJ_ID = B.OBJ_ID
- </if>
- <if test='objType == "7"'>
- OB.AD_CODE AS AD_CODE
- from BIS_INSP_PBLM t
- left join bis_insp_all_obj o
- on t.obj_id = o.obj_id
- left join ATT_EMPWTPRJ_BASE OB ON O.CODE = OB.ID
- LEFT JOIN BIS_INSP_KEY_REGISTER B ON t.OBJ_ID = B.OBJ_ID
- </if>
- where 1=1
- <if test="objType != null and objType != ''">
- and T.OBJ_TYPE = #{objType}
- </if>
- <if test="sttm != null and sttm != ''">
- and t.coll_time >= to_date(#{sttm}, 'yyyy-MM-dd')
- </if>
- <if test="entm != null and entm != ''">
- and t.coll_time < to_date(#{entm}, 'yyyy-MM-dd') + 1
- </if>
- <if test="cate != null and cate != ''">
- and t.insp_pblm_cate = #{cate}
- </if>
- <if test="state != null and state != ''">
- AND case when B.state is null then '0' ELSE B.state end = #{state}
- </if>
- ) q
- where 1=1
- <include refid="qchose"/>
- and length(q.code)=6
- group by SUBSTR(Q.AD_CODE,1,${length}),q.code) a
- left join BIS_INSP_ALL b
- on a.code = b.id
- LEFT JOIN ATT_AD_X_BASE AD ON CONCAT(A.AD_CODE,'${zero}') = AD.AD_CODE
- where a.code is not null
- <if test="orgName != null and orgName != ''">
- and b.pnm like CONCAT('%',CONCAT(#{orgName}, '%'))
- </if>
- <if test="adName != null and adName != ''">
- and ad.ad_name like CONCAT('%',CONCAT(#{adName}, '%'))
- </if>
- order by to_number(a.AD_CODE),to_number(a.code)
- </select>
- <!--省加单位-水毁县数-->
- <select id="getOrgProRectCountryList" resultMap="brief" parameterType="String">
- select AD.AD_CODE,AD.AD_NAME,a.code, b.pnm, a.num
- from (select SUBSTR(q.loc_ad,1,2) as ad_code,q.id as code, count(distinct q.code) as num
- from (select b.loc_ad,substr(o.id, 1, 6) as id,
- substr(b.loc_ad, 1, 6) as code
- from BIS_INSP_WTDST_TRACK t
- left join bis_insp_all_obj o
- on t.obj_id = o.obj_id
- left join BIS_INSP_WTDST b
- on o.code = b.wtdst_id
- where length(o.id) > 3
- <include refid="ochoseSql"/>
- <if test="state != null and state != ''">
- AND case when t.state is null then '0' else t.state end = #{state}
- </if>
- ) q
- group by SUBSTR(q.loc_ad,1,2),q.id) a
- left join BIS_INSP_ALL b
- on a.code = b.id
- left join ATT_AD_X_BASE AD ON CONCAT(A.AD_CODE,'0000000000') = AD.AD_CODE
- where 1=1
- <if test="adName != null and adName != ''">
- and AD.ad_name like CONCAT('%',CONCAT(#{adName}, '%'))
- </if>
- <if test="orgName != null and orgName != ''">
- and b.pnm like CONCAT('%',CONCAT(#{orgName}, '%'))
- </if>
- order by TO_NUMBER(AD.AD_CODE),to_number(a.code)
- </select>
- <!--172重点工程县-->
- <select id="getOrgProEmpwtCountryList" resultMap="brief" parameterType="String">
- select AD.AD_CODE,AD.AD_NAME,a.code, b.pnm, a.num
- from (select SUBSTR(q.AD_CODE,1,2) as ad_code,q.id as code, count(distinct q.code) as num
- from (select b.AD_CODE,substr(o.id, 1, 6) as id,
- substr(b.AD_CODE, 1, 6) as code
- from BIS_INSP_KEY_REGISTER t
- left join bis_insp_all_obj o
- on t.obj_id = o.obj_id
- left join ATT_EMPWTPRJ_BASE b
- on o.code = b.ID
- where length(o.id) > 3 AND b.ENG_STA = #{engSta}
- <include refid="ochoseSql"/>
- <if test="state != null and state != ''">
- AND case when t.state is null then '0' else t.state end = #{state}
- </if>
- ) q
- group by SUBSTR(q.AD_CODE,1,2),q.id) a
- left join BIS_INSP_ALL b
- on a.code = b.id
- left join ATT_AD_X_BASE AD ON CONCAT(A.AD_CODE,'0000000000') = AD.AD_CODE
- where 1=1
- <if test="adName != null and adName != ''">
- and AD.ad_name like CONCAT('%',CONCAT(#{adName}, '%'))
- </if>
- <if test="orgName != null and orgName != ''">
- and b.pnm like CONCAT('%',CONCAT(#{orgName}, '%'))
- </if>
- order by TO_NUMBER(AD.AD_CODE),to_number(a.code)
- </select>
- <!--水闸--县-->
- <select id="getOrgProWagaCountryList" resultMap="brief" parameterType="String">
- select AD.AD_CODE,AD.AD_NAME,a.code, b.pnm, a.num
- from (select SUBSTR(q.AD_CODE,1,2) as ad_code,q.id as code, count(distinct q.code) as num
- from (select b.AD_CODE,substr(o.id, 1, 6) as id,
- substr(b.AD_CODE, 1, 6) as code
- from ATT_WAGA_RGSTR t
- left join bis_insp_all_obj o
- on t.obj_id = o.obj_id
- left join ATT_WAGA_BASE b
- on o.code = b.OBJ_CODE
- where length(o.id) > 3
- <include refid="ochoseSql"/>
- <if test="state != null and state != ''">
- AND case when t.state is null then '0' ELSE t.state end = #{state}
- </if>
- ) q
- group by SUBSTR(q.AD_CODE,1,2),q.id) a
- left join BIS_INSP_ALL b
- on a.code = b.id
- left join ATT_AD_X_BASE AD ON CONCAT(A.AD_CODE,'0000000000') = AD.AD_CODE
- where 1=1
- <if test="adName != null and adName != ''">
- and AD.ad_name like CONCAT('%',CONCAT(#{adName}, '%'))
- </if>
- <if test="orgName != null and orgName != ''">
- and b.pnm like CONCAT('%',CONCAT(#{orgName}, '%'))
- </if>
- order by TO_NUMBER(AD.AD_CODE),to_number(a.code)
- </select>
- <!--省加单位-水毁项目数-->
- <select id="getOrgProRectList" resultMap="brief" parameterType="String">
- select AD.AD_CODE,AD.AD_NAME,a.code, b.pnm, a.num
- from (select SUBSTR(q.loc_ad,1,2) as ad_code,q.id as code, count(*) as num
- from (select b.loc_ad,substr(o.id, 1, 6) as id,
- substr(b.loc_ad, 1, 6) as code
- from BIS_INSP_WTDST_TRACK t
- left join bis_insp_all_obj o
- on t.obj_id = o.obj_id
- left join BIS_INSP_WTDST b
- on o.code = b.wtdst_id
- where length(o.id) > 3
- <include refid="ochoseSql"/>
- <if test="state != null and state != ''">
- AND case when t.state is null then '0' else t.state end = #{state}
- </if>
- ) q
- group by SUBSTR(q.loc_ad,1,2),q.id) a
- left join BIS_INSP_ALL b
- on a.code = b.id
- left join ATT_AD_X_BASE AD ON CONCAT(A.AD_CODE,'0000000000') = AD.AD_CODE
- where 1=1
- <if test="adName != null and adName != ''">
- and AD.ad_name like CONCAT('%',CONCAT(#{adName}, '%'))
- </if>
- <if test="orgName != null and orgName != ''">
- and b.pnm like CONCAT('%',CONCAT(#{orgName}, '%'))
- </if>
- order by TO_NUMBER(AD.AD_CODE),to_number(a.code)
- </select>
- <!--省加单位-172项目数-->
- <select id="getOrgProEmpwtList" resultMap="brief" parameterType="String">
- select AD.AD_CODE,AD.AD_NAME,a.code, b.pnm, a.num
- from (select SUBSTR(q.AD_CODE,1,2) as ad_code,q.id as code, count(*) as num
- from (select b.AD_CODE,substr(o.id, 1, 6) as id,
- substr(b.AD_CODE, 1, 6) as code
- from BIS_INSP_KEY_REGISTER t
- left join bis_insp_all_obj o
- on t.obj_id = o.obj_id
- left join ATT_EMPWTPRJ_BASE b
- on o.code = b.ID
- where length(o.id) > 3 AND b.ENG_STA = #{engSta}
- <include refid="ochoseSql"/>
- <if test="state != null and state != ''">
- AND case when t.state is null then '0' else t.state end = #{state}
- </if>
- ) q
- group by SUBSTR(q.AD_CODE,1,2),q.id) a
- left join BIS_INSP_ALL b
- on a.code = b.id
- left join ATT_AD_X_BASE AD ON CONCAT(A.AD_CODE,'0000000000') = AD.AD_CODE
- where 1=1
- <if test="adName != null and adName != ''">
- and AD.ad_name like CONCAT('%',CONCAT(#{adName}, '%'))
- </if>
- <if test="orgName != null and orgName != ''">
- and b.pnm like CONCAT('%',CONCAT(#{orgName}, '%'))
- </if>
- order by TO_NUMBER(AD.AD_CODE),to_number(a.code)
- </select>
- <select id="getOrgProVillCountryList" resultMap="brief" parameterType="String">
- select AD.AD_CODE,AD.AD_NAME,b.code, c.pnm, b.num
- from (select substr(a.code,1,2) as ad_code,a.id as code, count(distinct a.code) as num
- from (select substr(id, 1, 6) as id, substr(code, 1, 6) as code
- from bis_insp_all_obj t
- LEFT JOIN BIS_INSP_VILL_RGSTR VR ON t.OBJ_ID = VR.OBJ_ID
- WHERE 1 = 1
- <include refid="choseSql"/>
- <if test="sttm != null and sttm != '' and entm != null and entm != ''">
- AND VR.INTM >= TO_DATE(#{sttm},'YYYY-MM-DD') AND VR.INTM < TO_DATE(#{entm},'YYYY-MM-DD') + 1
- </if>
- <if test="state != null and state != ''">
- AND case when VR.state is null then '0' ELSE VR.state end = #{state}
- </if>
- AND t.ptype = '2') a
- group by substr(a.code,1,2),a.id) b
- left join BIS_INSP_ALL c
- on b.code = c.id
- left join ATT_AD_X_BASE AD ON CONCAT(B.AD_CODE,'0000000000') = AD.AD_CODE
- where 1=1
- <if test="adName != null and adName != ''">
- and AD.ad_name like CONCAT('%',CONCAT(#{adName}, '%'))
- </if>
- <if test="orgName != null and orgName != ''">
- and c.pnm like CONCAT('%',CONCAT(#{orgName}, '%'))
- </if>
- order by TO_NUMBER(AD.AD_CODE),to_number(b.code)
- </select>
- <select id="getOrgProVillVillList" resultMap="brief" parameterType="String">
- select AD.AD_CODE,AD.AD_NAME,q.code, w.pnm, q.num
- from (select substr(t.village_code, 1, 2) as AD_CODE,substr(t.id, 1, 6) as code,
- count( t.village_code) as num
- from (select t.village_code, o.id, o.nm, o.code,o.ad_code
- from BIS_INSP_SECSURVEY_VLG t
- left join BIS_INSP_VILL_RGSTR r
- on t.eng_id = r.eng_id
- left join bis_insp_all_obj o
- on r.obj_id = o.obj_id
- where 1=1
- <include refid="ochoseSql"/>
- <if test="sttm != null and sttm != '' and entm != null and entm != ''">
- AND t.CREATE_TIME >= TO_DATE(#{sttm},'YYYY-MM-DD') AND t.CREATE_TIME < TO_DATE(#{entm},'YYYY-MM-DD') + 1
- </if>
- <if test="state != null and state != ''">
- AND case when r.state is null then '0' ELSE r.state end = #{state}
- </if>
- ) t
- group by substr(t.village_code, 1, 2),substr(t.id, 1, 6)) q
- left join BIS_INSP_ALL w
- on q.code = w.id
- left join ATT_AD_X_BASE AD ON CONCAT(Q.AD_CODE,'0000000000') = AD.AD_CODE
- where 1=1
- <if test="adName != null and adName != ''">
- and AD.ad_name like CONCAT('%',CONCAT(#{adName}, '%'))
- </if>
- <if test="orgName != null and orgName != ''">
- and w.pnm like CONCAT('%',CONCAT(#{orgName}, '%'))
- </if>
- order by TO_NUMBER(AD.AD_CODE),to_number(q.code)
- </select>
- <select id="getOrgProVillPersList" resultMap="brief" parameterType="String">
- select AD.AD_CODE,AD.AD_NAME,q.code, w.pnm, q.num
- from (select substr(a.village_code, 1, 2) as AD_CODE,substr(a.id, 1, 6) as code,
- count(a.village_code) as num
- from (select t.village_code, o.id, o.nm, o.code,o.ad_code
- from BIS_INSP_WATERUSER_INFO t
- left join BIS_INSP_VILL_RGSTR r
- on t.eng_id = r.eng_id
- left join bis_insp_all_obj o
- on r.obj_id = o.obj_id
- where 1=1
- <include refid="ochoseSql"/>
- <if test="sttm != null and sttm != '' and entm != null and entm != ''">
- AND t.CREATE_TIME >= TO_DATE(#{sttm},'YYYY-MM-DD') AND t.CREATE_TIME < TO_DATE(#{entm},'YYYY-MM-DD') + 1
- </if>
- <if test="state != null and state != ''">
- AND case when r.state is null then '0' ELSE r.state end = #{state}
- </if>
- ) a
- group by substr(a.village_code, 1, 2),substr(a.id, 1, 6)) q
- left join BIS_INSP_ALL w
- on q.code = w.id
- left join ATT_AD_X_BASE AD ON CONCAT(Q.AD_CODE,'0000000000') = AD.AD_CODE
- where 1=1
- <if test="adName != null and adName != ''">
- and AD.ad_name like CONCAT('%',CONCAT(#{adName}, '%'))
- </if>
- <if test="orgName != null and orgName != ''">
- and w.pnm like CONCAT('%',CONCAT(#{orgName}, '%'))
- </if>
- order by TO_NUMBER(AD.AD_CODE),to_number(q.code)
- </select>
- <select id="getOrgProVillCwsList" resultMap="brief" parameterType="String">
- select AD.AD_CODE,AD.AD_NAME,q.code, w.pnm, q.num
- from (select substr(a.code, 1, 2) as AD_CODE,substr(a.id, 1, 6) as code,
- count(a.CWS_CODE) as num
- from (select t.CWS_CODE, o.id, o.nm, o.code
- from BIS_INSP_VLGDRINK_PROJ_MANAGE t
- left join BIS_INSP_VILL_RGSTR r
- on t.eng_id = r.eng_id
- left join bis_insp_all_obj o
- on r.obj_id = o.obj_id
- where 1=1
- <include refid="ochoseSql"/>
- <if test="sttm != null and sttm != '' and entm != null and entm != ''">
- AND t.CREATE_TIME >= TO_DATE(#{sttm},'YYYY-MM-DD') AND t.CREATE_TIME < TO_DATE(#{entm},'YYYY-MM-DD') + 1
- </if>
- <if test="state != null and state != ''">
- AND case when r.state is null then '0' ELSE r.state end = #{state}
- </if>
- ) a
- group by substr(a.code, 1, 2),substr(a.id, 1, 6)) q
- left join BIS_INSP_ALL w
- on q.code = w.id
- left join ATT_AD_X_BASE AD ON CONCAT(Q.AD_CODE,'0000000000') = AD.AD_CODE
- where 1=1
- <if test="adName != null and adName != ''">
- and AD.ad_name like CONCAT('%',CONCAT(#{adName}, '%'))
- </if>
- <if test="orgName != null and orgName != ''">
- and w.pnm like CONCAT('%',CONCAT(#{orgName}, '%'))
- </if>
- order by TO_NUMBER(AD.AD_CODE),to_number(q.code)
- </select>
- <select id="getOrgProVillWaterList" resultMap="brief">
- select AD.AD_CODE,AD.AD_NAME,q.code, w.pnm, q.num
- from (select substr(a.code, 1, 2) as ad_code,substr(a.id, 1, 6) as code,
- count(a.WATER_SOURCE_NM) as num
- from (select t.WATER_SOURCE_NM, o.id, o.nm, o.code
- from BIS_INSP_PRO_SOURCE_PROTECT t
- left join BIS_INSP_VILL_RGSTR r
- on t.eng_id = r.eng_id
- left join bis_insp_all_obj o
- on r.obj_id = o.obj_id
- where 1=1
- <include refid="ochoseSql"/>
- <if test="sttm != null and sttm != '' and entm != null and entm != ''">
- AND t.CREATE_TIME >= TO_DATE(#{sttm},'YYYY-MM-DD') AND t.CREATE_TIME < TO_DATE(#{entm},'YYYY-MM-DD') + 1
- </if>
- <if test="state != null and state != ''">
- AND case when r.state is null then '0' ELSE r.state end = #{state}
- </if>
- ) a
- group by substr(a.code, 1, 2),substr(a.id, 1, 6)) q
- left join BIS_INSP_ALL w
- on q.code = w.id
- left join ATT_AD_X_BASE AD ON CONCAT(Q.AD_CODE,'0000000000') = AD.AD_CODE
- where 1=1
- <if test="adName != null and adName != ''">
- and AD.ad_name like CONCAT('%',CONCAT(#{adName}, '%'))
- </if>
- <if test="orgName != null and orgName != ''">
- and w.pnm like CONCAT('%',CONCAT(#{orgName}, '%'))
- </if>
- order by TO_NUMBER(AD.AD_CODE),to_number(q.code)
- </select>
- <!--流域督查统计(农饮)-获取组id和组名称-->
- <select id="getRiverSupervisionCwsCount" parameterType="cn.com.goldenwater.dcproj.param.BriefReportParam" resultType="cn.com.goldenwater.dcproj.dto.RiverSupervisionCwsCount">
- select A.ID basinId,A.PNM basinName,C.ID groupId,C.PNM groupName from BIS_INSP_ALL A LEFT JOIN BIS_INSP_ALL B ON A.ID = B.PID
- LEFT JOIN BIS_INSP_ALL C ON B.ID = C.PID WHERE 1 = 1
- <if test="basinId != null and basinId != ''">
- AND A.ID = #{basinId}
- </if>
- <if test="sttm != null and sttm != '' and entm != null and entm != ''">
- AND C.STTM >= TO_DATE(#{sttm},'YYYY-MM-DD') AND C.ENTM < TO_DATE(#{entm},'YYYY-MM-DD') + 1
- </if>
- AND A.ID LIKE '002${orgId}'
- ORDER BY A.ID
- </select>
- <select id="getRiverSupervisionWtdCount" parameterType="cn.com.goldenwater.dcproj.param.BriefReportParam" resultType="cn.com.goldenwater.dcproj.dto.RiverSupervisionWtdCount">
- select A.ID basinId,A.PNM basinName,C.ID groupId,C.PNM groupName from BIS_INSP_ALL A LEFT JOIN BIS_INSP_ALL B ON A.ID = B.PID
- LEFT JOIN BIS_INSP_ALL C ON B.ID = C.PID WHERE 1 = 1
- <if test="basinId != null and basinId != ''">
- AND A.ID = #{basinId}
- </if>
- <if test="sttm != null and sttm != '' and entm != null and entm != ''">
- AND C.STTM >= TO_DATE(#{sttm},'YYYY-MM-DD') AND C.ENTM < TO_DATE(#{entm},'YYYY-MM-DD') + 1
- </if>
- AND A.ID LIKE '003${orgId}'
- ORDER BY A.ID
- </select>
- <select id="getRsCountByGroupId" resultType="cn.com.goldenwater.dcproj.dto.PersCountDto">
- SELECT A.ENG_SCAL as TYPE ,b.id,COUNT(A.RGSTR_ID) as count FROM BIS_INSP_RSVR_RGSTR A LEFT JOIN BIS_INSP_ALL_OBJ B ON A.OBJ_ID = B.OBJ_ID
- WHERE B.ID in (${groupId}) AND B.PTYPE = '1'
- <if test="state != null and state != ''">
- AND case when A.state is null then '0' else A.state end = #{state}
- </if>
- group by a.eng_scal,b.id
- </select>
- <select id="getRiverSupervisionRivCount" parameterType="cn.com.goldenwater.dcproj.param.BriefReportParam" resultType="cn.com.goldenwater.dcproj.dto.RiverSupervisionRivCount">
- select A.ID basinId,A.PNM basinName,C.ID groupId,C.PNM groupName from BIS_INSP_ALL A LEFT JOIN BIS_INSP_ALL B ON A.ID = B.PID
- LEFT JOIN BIS_INSP_ALL C ON B.ID = C.PID WHERE 1 = 1
- <if test="basinId != null and basinId != ''">
- AND A.ID = #{basinId}
- </if>
- <if test="sttm != null and sttm != '' and entm != null and entm != ''">
- AND C.STTM >= TO_DATE(#{sttm},'YYYY-MM-DD') AND C.ENTM < TO_DATE(#{entm},'YYYY-MM-DD') + 1
- </if>
- AND A.ID LIKE '001${orgId}'
- ORDER BY A.ID
- </select>
- <select id="getRivCountyCountById" resultType="cn.com.goldenwater.dcproj.dto.PersCountDto">
- SELECT t1.id,COUNT(AD.AD_NAME) as count FROM
- (SELECT distinct b.id,SUBSTR(A.ADM_DIV,0,6) subAd FROM ATT_RS_BASE A LEFT JOIN BIS_INSP_ALL_OBJ B ON A.RS_CODE = B.CODE
- WHERE B.PTYPE = '1' AND B.ID in (${groupId})) T1 LEFT JOIN ATT_AD_X_BASE AD ON
- CONCAT(T1.subAd,'000000') = AD.AD_CODE
- group by t1.id
- </select>
- <!--获取水库行政区划名称-->
- <select id="getRivAdNameDtoListByGroupIds" resultType="cn.com.goldenwater.dcproj.dto.AdNameDto">
- SELECT t1.id, AD.AD_NAME FROM
- (SELECT distinct b.id,SUBSTR(A.AD_CODE,0,2) subAd FROM BIS_INSP_RSVR_RGSTR A LEFT JOIN BIS_INSP_ALL_OBJ B ON A.OBJ_ID =
- B.OBJ_ID
- WHERE B.PTYPE = '1' AND B.ID in (${groupId})) T1 LEFT JOIN ATT_AD_X_BASE AD ON
- CONCAT(T1.subAd,'0000000000') = AD.AD_CODE
- where length(t1.id) = 12
- </select>
- <select id="getRiverSupervisionEmpwtConCount" parameterType="cn.com.goldenwater.dcproj.param.BriefReportParam" resultType="cn.com.goldenwater.dcproj.dto.RiverSupervisionEmpwtCount">
- select A.ID basinId,A.PNM basinName,C.ID groupId,C.PNM groupName from BIS_INSP_ALL A LEFT JOIN BIS_INSP_ALL B ON A.ID = B.PID
- LEFT JOIN BIS_INSP_ALL C ON B.ID = C.PID WHERE 1 = 1
- <if test="basinId != null and basinId != ''">
- AND A.ID = #{basinId}
- </if>
- <if test="sttm != null and sttm != '' and entm != null and entm != ''">
- AND C.STTM >= TO_DATE(#{sttm},'YYYY-MM-DD') AND C.ENTM < TO_DATE(#{entm},'YYYY-MM-DD') + 1
- </if>
- AND A.ID LIKE '004${orgId}'
- ORDER BY A.ID
- </select>
- <select id="getRiverSupervisionEmpwtRunCount" parameterType="cn.com.goldenwater.dcproj.param.BriefReportParam" resultType="cn.com.goldenwater.dcproj.dto.RiverSupervisionEmpwtCount">
- select A.ID basinId,A.PNM basinName,C.ID groupId,C.PNM groupName from BIS_INSP_ALL A LEFT JOIN BIS_INSP_ALL B ON A.ID = B.PID
- LEFT JOIN BIS_INSP_ALL C ON B.ID = C.PID WHERE 1 = 1
- <if test="basinId != null and basinId != ''">
- AND A.ID = #{basinId}
- </if>
- <if test="sttm != null and sttm != '' and entm != null and entm != ''">
- AND C.STTM >= TO_DATE(#{sttm},'YYYY-MM-DD') AND C.ENTM < TO_DATE(#{entm},'YYYY-MM-DD') + 1
- </if>
- AND A.ID LIKE '007___'
- ORDER BY A.ID
- </select>
- <select id="getRiverSupervisionWagaCount" parameterType="cn.com.goldenwater.dcproj.param.BriefReportParam" resultType="cn.com.goldenwater.dcproj.dto.RiverSupervisionWagaCount">
- select A.ID basinId,A.PNM basinName,C.ID groupId,C.PNM groupName from BIS_INSP_ALL A LEFT JOIN BIS_INSP_ALL B ON A.ID = B.PID
- LEFT JOIN BIS_INSP_ALL C ON B.ID = C.PID WHERE 1 = 1
- <if test="basinId != null and basinId != ''">
- AND A.ID = #{basinId}
- </if>
- <if test="sttm != null and sttm != '' and entm != null and entm != ''">
- AND C.STTM >= TO_DATE(#{sttm},'YYYY-MM-DD') AND C.ENTM < TO_DATE(#{entm},'YYYY-MM-DD') + 1
- </if>
- AND A.ID LIKE '006___'
- ORDER BY A.ID
- </select>
- <!--获取农饮行政区划名称-->
- <select id="getCwsAdNameDtoList" resultType="cn.com.goldenwater.dcproj.dto.AdNameDto">
- SELECT AD.AD_NAME FROM
- (SELECT SUBSTR(A.AD_CODE,0,2) subAd FROM ATT_AD_X_BASE A LEFT JOIN BIS_INSP_ALL_OBJ t ON A.AD_CODE = t.CODE
- WHERE t.PTYPE = '2'
- <include refid="choseSql"/>
- AND t.ID = #{groupId} GROUP BY SUBSTR(A.AD_CODE,0,2)) T1 LEFT JOIN ATT_AD_X_BASE AD ON CONCAT(T1.subAd,'0000000000') = AD.AD_CODE
- </select>
- <!--获取水库行政区划名称-->
- <select id="getRivAdNameDtoList" resultType="cn.com.goldenwater.dcproj.dto.AdNameDto">
- SELECT AD.AD_NAME FROM
- (SELECT SUBSTR(A.AD_CODE,0,2) subAd FROM BIS_INSP_RSVR_RGSTR A LEFT JOIN BIS_INSP_ALL_OBJ t ON A.OBJ_ID = t.OBJ_ID
- WHERE t.PTYPE = '1' AND t.ID = #{groupId}
- <include refid="choseSql"/>
- GROUP BY SUBSTR(A.AD_CODE,0,2)) T1 LEFT JOIN ATT_AD_X_BASE AD ON CONCAT(T1.subAd,'0000000000') = AD.AD_CODE
- </select>
- <!--获取水闸行政区划名称-->
- <select id="getWagaAdNameDtoList" resultType="cn.com.goldenwater.dcproj.dto.AdNameDto">
- SELECT AD.AD_NAME FROM
- (SELECT SUBSTR(A.AD_CODE,0,2) subAd FROM ATT_WAGA_BASE A LEFT JOIN BIS_INSP_ALL_OBJ B ON A.OBJ_CODE = B.CODE
- WHERE B.PTYPE = '6' AND B.ID = #{groupId} GROUP BY SUBSTR(A.AD_CODE,0,2)) T1 LEFT JOIN ATT_AD_X_BASE AD ON CONCAT(T1.subAd,'0000000000') = AD.AD_CODE
- </select>
- <!--获取172重点工程行政区划名称-->
- <select id="getEmpwtAdNameDtoList" resultType="cn.com.goldenwater.dcproj.dto.AdNameDto">
- SELECT AD.AD_NAME FROM
- (SELECT SUBSTR(A.AD_CODE,0,2) subAd FROM ATT_EMPWTPRJ_BASE A LEFT JOIN BIS_INSP_ALL_OBJ t ON A.ID = t.CODE
- WHERE t.PTYPE = #{type} AND B.ID = #{groupId}
- <include refid="choseSql"/>
- GROUP BY SUBSTR(A.AD_CODE,0,2)) T1
- LEFT JOIN ATT_AD_X_BASE AD ON CONCAT(T1.subAd,'0000000000') = AD.AD_CODE
- </select>
- <!--获取水毁行政区划名称-->
- <select id="getWtdAdNameDtoList" resultType="cn.com.goldenwater.dcproj.dto.AdNameDto">
- SELECT AD.AD_NAME FROM
- (SELECT SUBSTR(A.LOC_AD,0,2) subAd FROM BIS_INSP_WTDST A LEFT JOIN BIS_INSP_ALL_OBJ t ON A.WTDST_ID = t.CODE
- WHERE t.PTYPE = '3'
- <include refid="choseSql"/>
- AND t.ID = #{groupId} GROUP BY SUBSTR(A.LOC_AD,0,2)) T1 LEFT JOIN ATT_AD_X_BASE AD ON CONCAT(T1.subAd,'0000000000') = AD.AD_CODE
- </select>
- <select id="getPersCount" resultType="Integer">
- SELECT COUNT(PERSID) FROM BIS_INSP_ALL_RLATION t WHERE ID = #{groupId}
- <include refid="choseSql"/>
- </select>
- <select id="getCwsCountyCount" resultType="Integer">
- SELECT COUNT(AD.AD_NAME) FROM
- (SELECT SUBSTR(A.AD_CODE,0,6) subAd FROM ATT_AD_X_BASE A LEFT JOIN BIS_INSP_ALL_OBJ t ON A.AD_CODE = t.CODE
- WHERE t.PTYPE = '2'
- <include refid="choseSql"/>
- AND t.ID = #{groupId} GROUP BY SUBSTR(A.AD_CODE,0,6)) T1 LEFT JOIN ATT_AD_X_BASE AD ON CONCAT(T1.subAd,'000000') = AD.AD_CODE
- </select>
- <select id="getRivCountyCount" resultType="Integer">
- SELECT COUNT(AD.AD_NAME) FROM
- (SELECT SUBSTR(A.ADM_DIV,0,6) subAd FROM ATT_RS_BASE A LEFT JOIN BIS_INSP_ALL_OBJ t ON A.RS_CODE = t.CODE
- WHERE t.PTYPE = '1'
- <include refid="choseSql"/>
- AND t.ID = #{groupId} GROUP BY SUBSTR(A.ADM_DIV,0,6)) T1 LEFT JOIN ATT_AD_X_BASE AD ON CONCAT(T1.subAd,'000000') = AD.AD_CODE
- </select>
- <select id="getWtdCountyCount" resultType="Integer">
- SELECT COUNT(AD.AD_NAME) FROM
- (SELECT SUBSTR(A.LOC_AD,0,6) subAd FROM BIS_INSP_WTDST A LEFT JOIN BIS_INSP_ALL_OBJ o ON A.WTDST_ID = o.CODE
- LEFT JOIN BIS_INSP_WTDST_TRACK T ON o.OBJ_ID = T.OBJ_ID
- WHERE o.PTYPE = '3' AND o.ID = #{groupId}
- <include refid="ochoseSql"/>
- <if test="state != null and state != ''">
- AND case when t.state is null then '0' else t.state end = #{state}
- </if>
- GROUP BY SUBSTR(A.LOC_AD,0,6)) T1 LEFT JOIN ATT_AD_X_BASE AD ON CONCAT(T1.subAd,'000000') = AD.AD_CODE
- </select>
- <select id="getVillageCount" resultType="Integer">
- SELECT COUNT(A.ENG_ID)
- FROM
- <if test='type == "1"'>
- BIS_INSP_SECSURVEY_VLG
- </if>
- <if test='type == "2"'>
- BIS_INSP_WATERUSER_INFO
- </if>
- <if test='type == "3"'>
- BIS_INSP_VLGDRINK_PROJ_MANAGE
- </if>
- <if test='type == "4"'>
- BIS_INSP_PRO_SOURCE_PROTECT
- </if>
- A LEFT JOIN BIS_INSP_VILL_RGSTR B ON A.ENG_ID = B.ENG_ID
- LEFT JOIN BIS_INSP_ALL_OBJ t ON B.OBJ_ID = t.OBJ_ID
- WHERE t.PTYPE = '2' AND t.ID = #{groupId}
- <include refid="choseSql"/>
- <if test="sttm != null and sttm != '' and entm != null and entm != ''">
- AND A.CREATE_TIME >= TO_DATE(#{sttm},'YYYY-MM-DD') AND A.CREATE_TIME < TO_DATE(#{entm},'YYYY-MM-DD') + 1
- </if>
- <if test="state != null and state != ''">
- AND case when B.state is null then '0' else B.state end = #{state}
- </if>
- </select>
- <select id="getAllProCount" resultType="Integer">
- select COUNT(PBLM_ID) cateCount from BIS_INSP_PBLM A LEFT JOIN BIS_INSP_ALL_OBJ t ON A.OBJ_ID = t.OBJ_ID
- <if test='type == "1"'>
- LEFT JOIN BIS_INSP_RSVR_RGSTR C ON A.OBJ_ID = C.OBJ_ID
- </if>
- <if test='type == "2"'>
- LEFT JOIN BIS_INSP_VILL_RGSTR C ON A.OBJ_ID = C.OBJ_ID
- </if>
- <if test='type == "3"'>
- LEFT JOIN BIS_INSP_WTDST_TRACK C ON A.OBJ_ID = C.OBJ_ID
- </if>
- <if test='type == "4"'>
- LEFT JOIN BIS_INSP_KEY_REGISTER C ON A.OBJ_ID = C.OBJ_ID
- </if>
- <if test='type == "6"'>
- LEFT JOIN ATT_WAGA_RGSTR C ON A.OBJ_ID = C.OBJ_ID
- </if>
- <if test='type == "7"'>
- LEFT JOIN BIS_INSP_KEY_REGISTER C ON A.OBJ_ID = C.OBJ_ID
- </if>
- WHERE t.PTYPE = #{type} AND t.ID = #{groupId} AND A.OBJ_TYPE = #{type}
- <include refid="choseSql"/>
- AND INSP_PBLM_CATE = #{pblmType}
- <if test="sttm != null and sttm != '' and entm != null and entm != ''">
- AND A.COLL_TIME >= TO_DATE(#{sttm},'YYYY-MM-DD') AND A.COLL_TIME < TO_DATE(#{entm},'YYYY-MM-DD') + 1
- </if>
- <if test="state != null and state != '' and type != null and type != ''">
- AND case when C.state is null then '0' ELSE C.state end = #{state}
- </if>
- </select>
- <select id="getRsCount" resultType="Integer">
- SELECT COUNT(A.RGSTR_ID) FROM BIS_INSP_RSVR_RGSTR A LEFT JOIN BIS_INSP_ALL_OBJ t ON A.OBJ_ID = t.OBJ_ID
- WHERE t.ID = #{groupId} AND t.PTYPE = '1' AND A.ENG_SCAL = #{engScal}
- <include refid="choseSql"/>
- <if test="state != null and state != ''">
- AND case when A.state is null then '0' else A.state end = #{state}
- </if>
- </select>
- <select id="getWagaCount" resultType="Integer">
- SELECT COUNT(A.OBJ_CODE) FROM ATT_WAGA_RGSTR A LEFT JOIN BIS_INSP_ALL_OBJ t ON A.OBJ_ID = t.OBJ_ID
- WHERE t.ID = #{groupId} AND t.PTYPE = '6'
- <include refid="choseSql"/>
- <if test="engScal != null and engScal != ''">
- AND A.ENG_SCAL = #{engScal}
- </if>
- <if test='engScal == null'>
- AND A.ENG_SCAL IS NULL
- </if>
- <if test="state != null and state != ''">
- AND case when A.state is null then '0' else A.state end = #{state}
- </if>
- </select>
- <select id="getWtdCount" resultType="Integer">
- SELECT COUNT(A.WTDST_ID) FROM BIS_INSP_WTDST A LEFT JOIN BIS_INSP_ALL_OBJ O ON A.WTDST_ID = O.CODE
- LEFT JOIN BIS_INSP_KEY_REGISTER T ON O.OBJ_ID = T.OBJ_ID
- WHERE O.ID = #{groupId} AND O.PTYPE = '3'
- <include refid="ochoseSql"/>
- <if test="state != null and state != ''">
- AND case when t.state is null then '0' else t.state end = #{state}
- </if>
- </select>
- <select id="getRiverNode" resultType="cn.com.goldenwater.dcproj.model.RiverNode">
- SELECT ID ,PNM FROM BIS_INSP_ALL WHERE 1 = 1
- <if test='type == "1" '>
- AND PID = '001'
- <if test="province !=null and province !=''">
- AND ID like '001${orgId}%'
- </if>
- </if>
- <if test='type == "36" '>
- AND PID = '036'
- <if test="province !=null and province !=''">
- AND ID like '036${orgId}%'
- </if>
- </if>
- <if test='type == "2"'>
- AND PID = '002'
- <if test="province !=null and province !=''">
- AND ID like '002${orgId}%'
- </if>
- </if>
- <if test='type == "3"'>
- AND PID = '003'
- <if test="province !=null and province !=''">
- AND ID like '003${orgId}%'
- </if>
- </if>
- <if test='type == "4"'>
- AND PID = '004'
- <if test="province !=null and province !=''">
- AND ID like '004${orgId}%'
- </if>
- </if>
- <if test='type == "5"'>
- AND PID = '005'
- <if test="province !=null and province !=''">
- AND ID like '005${orgId}%'
- </if>
- </if>
- <if test='type == "6"'>
- AND PID = '006'
- <if test="province !=null and province !=''">
- AND ID like '006${orgId}%'
- </if>
- </if>
- <if test='type == "7"'>
- AND PID = '007'
- <if test="province !=null and province !=''">
- AND ID like '007${orgId}%'
- </if>
- </if>
- <if test='type == "8"'>
- AND PID = '008'
- </if>
- <if test='type == "9"'>
- AND PID = '009'
- </if>
- <if test='type == "10"'>
- AND PID = '010'
- </if>
- ORDER BY ID
- </select>
- <select id="getNmByPersid" parameterType="String" resultType="cn.com.goldenwater.dcproj.dto.ObjectNameDto">
- SELECT A.id,A.PNM name FROM BIS_INSP_ALL A LEFT JOIN BIS_INSP_ALL_RLATION B ON A.ID = B.ID
- WHERE B.PERSID = #{persid} AND A.ID LIKE '001%'
- <choose>
- <when test="province !=null and province !=''">
- AND B.ad_code like '${province}%'
- </when>
- <otherwise>
- AND B.ad_code is null
- </otherwise>
- </choose>
- </select>
- <select id="getbigNmByPersid" parameterType="String" resultType="cn.com.goldenwater.dcproj.dto.ObjectNameDto">
- SELECT A.id,A.PNM name FROM BIS_INSP_ALL A LEFT JOIN BIS_INSP_ALL_RLATION B ON A.ID = B.ID
- WHERE B.PERSID = #{persid} AND A.ID LIKE '036%'
- <choose>
- <when test="province !=null and province !=''">
- AND B.ad_code like '${province}%'
- </when>
- <otherwise>
- AND B.ad_code is null
- </otherwise>
- </choose>
- </select>
- <select id="getOrgName" parameterType="String" resultType="cn.com.goldenwater.dcproj.dto.ObjectNameDto">
- SELECT ID,PNM name FROM BIS_INSP_ALL WHERE ID = #{substring}
- </select>
- <select id="getEmpwtCount" resultType="Integer">
- SELECT COUNT(o.OBJ_ID) FROM BIS_INSP_ALL_OBJ o
- LEFT JOIN BIS_INSP_KEY_REGISTER r on o.obj_id = r.obj_id
- WHERE o.ID = #{groupId}
- <include refid="ochoseSql"/>
- <if test="state != null and state != ''">
- AND case when r.state is null then '0' else r.state end = #{state}
- </if>
- </select>
- <select id="getAdCodeByType" resultType="cn.com.goldenwater.dcproj.model.BriefReport">
- SELECT CONCAT(H.AD_CODE, '${zero}') AS AD_CODE,
- G.AD_NAME,
- H.ID AS CODE,
- E.PNM
- FROM (SELECT SUBSTR(F.AD_CODE, 1, ${length}) AS AD_CODE,
- SUBSTR(F.ID, 1, 6) AS ID,
- COUNT(DISTINCT F.ID) AS NUM
- FROM (SELECT J.ID,J.PNM,
- A.PTYPE,A.AD_CODE as province,
- <if test='type == "001" or type=="036"'>
- OB.AD_CODE AS AD_CODE
- FROM BIS_INSP_ALL J
- LEFT JOIN BIS_INSP_ALL_OBJ A ON J.ID=A.ID
- left join BIS_INSP_RSVR_RGSTR OB ON A.OBJ_ID = OB.OBJ_ID
- </if>
- <if test='type == "002"'>
- A.CODE AS AD_CODE
- FROM BIS_INSP_ALL J
- LEFT JOIN BIS_INSP_ALL_OBJ A ON J.ID=A.ID
- </if>
- <if test='type == "003"'>
- OB.LOC_AD AS AD_CODE
- FROM BIS_INSP_ALL J
- LEFT JOIN BIS_INSP_ALL_OBJ A ON J.ID=A.ID
- left join BIS_INSP_WTDST OB ON A.CODE = OB.WTDST_ID
- </if>
- <if test='type == "004"'>
- OB.AD_CODE AS AD_CODE
- FROM BIS_INSP_ALL J
- LEFT JOIN BIS_INSP_ALL_OBJ A ON J.ID=A.ID
- left join ATT_EMPWTPRJ_BASE OB ON A.CODE = OB.ID
- </if>
- <if test='type == "005"'>
- OB.ADCD AS AD_CODE
- FROM BIS_INSP_ALL J
- LEFT JOIN BIS_INSP_ALL_OBJ A ON J.ID=A.ID
- left join ATT_GRW_BASE OB ON A.CODE = OB.STCD
- </if>
- <if test='type == "006"'>
- OB.AD_CODE AS AD_CODE
- FROM BIS_INSP_ALL J
- LEFT JOIN BIS_INSP_ALL_OBJ A ON J.ID=A.ID
- left join ATT_WAGA_RGSTR OB ON A.OBJ_ID = OB.OBJ_ID
- </if>
- <if test='type == "007"'>
- OB.AD_CODE AS AD_CODE
- FROM BIS_INSP_ALL J
- LEFT JOIN BIS_INSP_ALL_OBJ A ON J.ID=A.ID
- left join ATT_EMPWTPRJ_BASE OB ON A.CODE = OB.ID
- </if>
- <if test='type == "009"'>
- r.AD_CODE AS AD_CODE
- FROM BIS_INSP_ALL J
- LEFT JOIN BIS_INSP_ALL_OBJ A ON J.ID=A.ID
- LEFT JOIN BIS_INSP_FSC_RGSTR r ON r.OBJ_ID = A.OBJ_ID
- </if>
- <if test='type == "010"'>
- r.AD_CODE AS AD_CODE
- FROM BIS_INSP_ALL J
- LEFT JOIN BIS_INSP_ALL_OBJ A ON J.ID=A.ID
- LEFT JOIN BIS_INSP_OTHER_RGSTR r ON r.OBJ_ID = A.OBJ_ID
- </if>
- <if test='type == "011"'>
- r.AD_CODE AS AD_CODE
- FROM BIS_INSP_ALL J
- LEFT JOIN BIS_INSP_ALL_OBJ A ON J.ID=A.ID
- LEFT JOIN BIS_INSP_SD_RGSTR r ON r.OBJ_ID = A.OBJ_ID
- </if>
- <if test='type == "012"'>
- r.AD_CODE AS AD_CODE
- FROM BIS_INSP_ALL J
- LEFT JOIN BIS_INSP_ALL_OBJ A ON J.ID=A.ID
- LEFT JOIN BIS_INSP_WIU_RGSTR r ON r.OBJ_ID = A.OBJ_ID
- </if>
- <if test='type == "013"'>
- r.AD_CODE AS AD_CODE
- FROM BIS_INSP_ALL J
- LEFT JOIN BIS_INSP_ALL_OBJ A ON J.ID=A.ID
- LEFT JOIN BIS_INSP_SWHS_RGSTR r ON r.OBJ_ID = A.OBJ_ID
- </if>
- <if test='type == "014"'>
- r.AD_CODE AS AD_CODE
- FROM BIS_INSP_ALL J
- LEFT JOIN BIS_INSP_ALL_OBJ A ON J.ID=A.ID
- LEFT JOIN BIS_INSP_WINT_RGSTR r ON r.OBJ_ID = A.OBJ_ID
- </if>
- <if test='type == "015"'>
- r.AD_CODE AS AD_CODE
- FROM BIS_INSP_ALL J
- LEFT JOIN BIS_INSP_ALL_OBJ A ON J.ID=A.ID
- LEFT JOIN BIS_INSP_SVWT_AREA_RGSTR r ON r.OBJ_ID = A.OBJ_ID
- </if>
- <if test='type == "016"'>
- r.AD_CODE AS AD_CODE
- FROM BIS_INSP_ALL J
- LEFT JOIN BIS_INSP_ALL_OBJ A ON J.ID=A.ID
- LEFT JOIN BIS_INSP_SVWT_WUNT_RGSTR r ON r.OBJ_ID = A.OBJ_ID
- </if>
- WHERE LENGTH(J.ID) = 12
- <if test="type != null and type != ''">
- AND J.ID LIKE CONCAT(#{type}, '%')
- </if>
- ) F where 1=1
- <include refid="fchose"/>
- GROUP BY SUBSTR(F.AD_CODE, 1, ${length}), SUBSTR(F.ID, 1, 6)) H
- LEFT JOIN BIS_INSP_ALL E
- ON H.ID = E.ID
- LEFT JOIN ATT_AD_X_BASE G
- ON CONCAT(H.AD_CODE, '${zero}') = G.AD_CODE
- where 1=1
- <if test="orgName != null and orgName != ''">
- and E.pnm like CONCAT('%',CONCAT(#{orgName}, '%'))
- </if>
- <if test="adName != null and adName != ''">
- and G.ad_name like CONCAT('%',CONCAT(#{adName}, '%'))
- </if>
- ORDER BY H.AD_CODE, H.ID
- </select>
- <sql id="fchose">
- <choose>
- <when test="province !=null and province !=''">
- AND F.province=#{province}
- </when>
- <otherwise>
- AND F.province is null
- </otherwise>
- </choose>
- </sql>
- <sql id="qchosepro">
- <choose>
- <when test="province !=null and province !=''">
- AND q.province=#{province}
- </when>
- <otherwise>
- AND q.province is null
- </otherwise>
- </choose>
- </sql>
- <select id="getRiverPersSupervisionInfo" parameterType="cn.com.goldenwater.dcproj.param.BriefReportParam" resultType="cn.com.goldenwater.dcproj.dto.RiverSupervisionRivCount">
- SELECT B.GUID persId,B.PERS_NAME persName,B.ORG_ID basinId,B.ORG_NM basinName FROM
- (SELECT DISTINCT PERSID FROM BIS_INSP_ALL_RLATION t
- WHERE ID LIKE '001%'
- <include refid="choseSql"/>
- ) A LEFT JOIN BIS_INSP_ALL_RLATION_PERS B
- ON A.PERSID = B.GUID
- WHERE B.GUID IS NOT NULL
- <if test="basinId != null and basinId != ''">
- AND CONCAT(#{type},B.ORG_ID) = #{basinId}
- </if>
- <if test="persName != null and persName != ''">
- AND B.PERS_NAME LIKE '%${persName}%'
- </if>
- </select>
- <select id="getPersAdFullNameDtoList" parameterType="String" resultType="cn.com.goldenwater.dcproj.dto.AdNameDto">
- SELECT AD.AD_FULL_NAME adName
- FROM (select DISTINCT A.AD_CODE AD_CODE
- from BIS_INSP_SEL_AREA A
- LEFT JOIN BIS_INSP_ALL_RLATION B
- ON A.ID = B.ID
- WHERE B.PERSID = #{persId} AND A.AD_CODE LIKE '${province}%') T
- LEFT JOIN ATT_AD_X_BASE AD
- ON T.AD_CODE = AD.AD_CODE
- WHERE AD.AD_CODE IS NOT NULL
- </select>
- <select id="getPersRsCount" resultType="Integer">
- SELECT count(C.RGSTR_ID) FROM BIS_INSP_RSVR_RGSTR C,BIS_INSP_ALL_OBJ t
- WHERE C.OBJ_ID=T.OBJ_ID and C.REC_PERS_ID = #{persId} AND C.ENG_SCAL = #{engScal}
- <include refid="choseSql"/>
- <if test="sttm != null and sttm != '' and entm != null and entm != ''">
- AND C.INTM >= TO_DATE(#{sttm},'YYYY-MM-DD') AND C.INTM < TO_DATE(#{entm},'YYYY-MM-DD') + 1
- </if>
- <if test="state != null and state != ''">
- AND case when C.state is null then '0' else C.state end = #{state}
- </if>
- </select>
- <select id="getPersAllProCount" resultType="Integer">
- SELECT count(A.PBLM_ID) FROM BIS_INSP_PBLM A join BIS_INSP_ALL_OBJ t
- on A.OBJ_ID=t.OBJ_ID
- <if test='type == "1" or type=="36"'>
- LEFT JOIN BIS_INSP_RSVR_RGSTR B ON A.OBJ_ID = B.OBJ_ID
- </if>
- <if test='type == "2"'>
- LEFT JOIN BIS_INSP_VILL_RGSTR B ON A.OBJ_ID = B.OBJ_ID
- </if>
- <if test='type == "3"'>
- LEFT JOIN BIS_INSP_WTDST_TRACK B ON A.OBJ_ID = B.OBJ_ID
- </if>
- <if test='type == "4"'>
- LEFT JOIN BIS_INSP_KEY_REGISTER B ON A.OBJ_ID = B.OBJ_ID
- </if>
- <if test='type == "6"'>
- LEFT JOIN ATT_WAGA_RGSTR B ON A.OBJ_ID = B.OBJ_ID
- </if>
- <if test='type == "7"'>
- LEFT JOIN BIS_INSP_KEY_REGISTER B ON A.OBJ_ID = B.OBJ_ID
- </if>
- WHERE A.OBJ_TYPE = #{type} AND A.INSP_PBLM_CATE = #{s} AND A.REC_PERS = #{persId}
- <include refid="choseSql"/>
- <if test="sttm != null and sttm != '' and entm != null and entm != ''">
- AND A.COLL_TIME >= TO_DATE(#{sttm},'YYYY-MM-DD') AND A.COLL_TIME < TO_DATE(#{entm},'YYYY-MM-DD') + 1
- </if>
- <if test="state != null and state != '' and type != null and type != ''">
- AND case when B.state is null then '0' ELSE B.state end = #{state}
- </if>
- </select>
- <select id="getRiverPersSupervisionCwsInfo" parameterType="cn.com.goldenwater.dcproj.param.BriefReportParam" resultType="cn.com.goldenwater.dcproj.dto.RiverSupervisionCwsCount">
- SELECT B.GUID persId,B.PERS_NAME persName,B.ORG_ID basinId,B.ORG_NM basinName FROM
- (SELECT DISTINCT PERSID FROM BIS_INSP_ALL_RLATION
- WHERE ID LIKE '002%') A LEFT JOIN BIS_INSP_ALL_RLATION_PERS B
- ON A.PERSID = B.GUID
- WHERE B.GUID IS NOT NULL
- <if test="basinId != null and basinId != ''">
- AND CONCAT(#{type},B.ORG_ID) = #{basinId}
- </if>
- <if test="persName != null and persName != ''">
- AND B.PERS_NAME LIKE '%${persName}%'
- </if>
- </select>
- <select id="getPersVillageCount" resultType="Integer">
- SELECT COUNT(*) FROM
- <if test='type == "1" or type =="36"'>
- BIS_INSP_SECSURVEY_VLG A
- </if>
- <if test='type == "2"'>
- BIS_INSP_WATERUSER_INFO A
- </if>
- <if test='type == "3"'>
- BIS_INSP_VLGDRINK_PROJ_MANAGE A
- </if>
- <if test='type == "4"'>
- BIS_INSP_PRO_SOURCE_PROTECT A
- </if>
- LEFT JOIN BIS_INSP_VILL_RGSTR B ON A.ENG_ID = B.ENG_ID
- WHERE A.REC_PERS_ID = #{persId}
- <if test="sttm != null and sttm != '' and entm != null and entm != ''">
- AND A.CREATE_TIME >= TO_DATE(#{sttm},'YYYY-MM-DD') AND A.CREATE_TIME < TO_DATE(#{entm},'YYYY-MM-DD') + 1
- </if>
- <if test="state != null and state != ''">
- AND case when B.state is null then '0' else B.state end = #{state}
- </if>
- </select>
- <select id="getPersRiverSupervisionWtdInfo" parameterType="cn.com.goldenwater.dcproj.param.BriefReportParam" resultType="cn.com.goldenwater.dcproj.dto.RiverSupervisionWtdCount">
- SELECT B.GUID persId,B.PERS_NAME persName,B.ORG_ID basinId,B.ORG_NM basinName FROM
- (SELECT DISTINCT PERSID FROM BIS_INSP_ALL_RLATION
- WHERE ID LIKE '003%') A LEFT JOIN BIS_INSP_ALL_RLATION_PERS B
- ON A.PERSID = B.GUID
- WHERE B.GUID IS NOT NULL
- <if test="basinId != null and basinId != ''">
- AND CONCAT(#{type},B.ORG_ID) = #{basinId}
- </if>
- <if test="persName != null and persName != ''">
- AND B.PERS_NAME LIKE '%${persName}%'
- </if>
- </select>
- <select id="getPersWtdCount" parameterType="String" resultType="Integer">
- SELECT count(TRACK_ID) FROM BIS_INSP_WTDST_TRACK
- WHERE REC_PERS_ID = #{persId}
- <if test="sttm != null and sttm != '' and entm != null and entm != ''">
- AND INTM >= TO_DATE(#{sttm},'YYYY-MM-DD') AND INTM < TO_DATE(#{entm},'YYYY-MM-DD') + 1
- </if>
- <if test="state != null and state != ''">
- AND case when state is null then '0' else state end = #{state}
- </if>
- </select>
- <select id="getPersRiverSupervisionEmpwtConCount" parameterType="cn.com.goldenwater.dcproj.param.BriefReportParam" resultType="cn.com.goldenwater.dcproj.dto.RiverSupervisionEmpwtCount">
- SELECT B.GUID persId,B.PERS_NAME persName,B.ORG_ID basinId,B.ORG_NM basinName FROM
- (SELECT DISTINCT PERSID FROM BIS_INSP_ALL_RLATION
- WHERE ID LIKE '004%') A LEFT JOIN BIS_INSP_ALL_RLATION_PERS B
- ON A.PERSID = B.GUID
- WHERE B.GUID IS NOT NULL
- <if test="basinId != null and basinId != ''">
- AND CONCAT(#{type},B.ORG_ID) = #{basinId}
- </if>
- <if test="persName != null and persName != ''">
- AND B.PERS_NAME LIKE '%${persName}%'
- </if>
- </select>
- <select id="getPersEmpwtCount" resultType="Integer">
- SELECT COUNT(ID) FROM BIS_INSP_KEY_REGISTER r ,BIS_INSP_ALL_OBJ t
- WHERE r.obj_id=t.obj_id and r.REC_PERS_ID = #{persId}
- <include refid="choseSql"/>
- AND ENG_STA = #{engSta}
- <if test="sttm != null and sttm != '' and entm != null and entm != ''">
- AND r.INTM >= TO_DATE(#{sttm},'YYYY-MM-DD') AND r.INTM < TO_DATE(#{entm},'YYYY-MM-DD') + 1
- </if>
- <if test="state != null and state != ''">
- AND case when r.state is null then '0' else r.state end = #{state}
- </if>
- </select>
- <select id="getPersRiverSupervisionEmpwtRunCount" parameterType="cn.com.goldenwater.dcproj.param.BriefReportParam" resultType="cn.com.goldenwater.dcproj.dto.RiverSupervisionEmpwtCount">
- SELECT B.GUID persId,B.PERS_NAME persName,B.ORG_ID basinId,B.ORG_NM basinName FROM
- (SELECT DISTINCT PERSID FROM BIS_INSP_ALL_RLATION
- WHERE ID LIKE '007%') A LEFT JOIN BIS_INSP_ALL_RLATION_PERS B
- ON A.PERSID = B.GUID
- WHERE B.GUID IS NOT NULL
- <if test="basinId != null and basinId != ''">
- AND CONCAT(#{type},B.ORG_ID) = #{basinId}
- </if>
- <if test="persName != null and persName != ''">
- AND B.PERS_NAME LIKE '%${persName}%'
- </if>
- </select>
- <select id="getPersRiverSupervisionWagaCount" parameterType="cn.com.goldenwater.dcproj.param.BriefReportParam" resultType="cn.com.goldenwater.dcproj.dto.RiverSupervisionWagaCount">
- SELECT B.GUID persId,B.PERS_NAME persName,B.ORG_ID basinId,B.ORG_NM basinName FROM
- (SELECT DISTINCT PERSID FROM BIS_INSP_ALL_RLATION
- WHERE ID LIKE '006%') A LEFT JOIN BIS_INSP_ALL_RLATION_PERS B
- ON A.PERSID = B.GUID
- WHERE B.GUID IS NOT NULL
- <if test="basinId != null and basinId != ''">
- AND CONCAT(#{type},B.ORG_ID) = #{basinId}
- </if>
- <if test="persName != null and persName != ''">
- AND B.PERS_NAME LIKE '%${persName}%'
- </if>
- </select>
- <select id="getPersWagaCount" resultType="Integer">
- SELECT COUNT(ID) FROM ATT_WAGA_RGSTR r,BIS_INSP_ALL_OBJ t
- WHERE r.obj_id=t.obj_id and r.PERS_ID = #{persId}
- <include refid="choseSql"/>
- <if test="engScal != null and engScal != ''">
- AND r.ENG_SCAL = #{engScal}
- </if>
- <if test='engScal == null'>
- AND r.ENG_SCAL IS NULL
- </if>
- <if test="sttm != null and sttm != '' and entm != null and entm != ''">
- AND r.INTM >= TO_DATE(#{sttm},'YYYY-MM-DD') AND r.INTM < TO_DATE(#{entm},'YYYY-MM-DD') + 1
- </if>
- <if test="state != null and state != ''">
- AND case when r.state is null then '0' else r.state end = #{state}
- </if>
- </select>
- <select id="getPersCountById" resultType="cn.com.goldenwater.dcproj.dto.PersCountDto">
- SELECT id,COUNT(PERSID) as count FROM BIS_INSP_ALL_RLATION WHERE ID in (${groupId}) group By Id
- </select>
- <select id="getCwsAdNameDtoListByGroupIds" resultType="cn.com.goldenwater.dcproj.dto.AdNameDto">
- SELECT t1.id, AD.AD_NAME FROM
- (SELECT distinct b.id,SUBSTR(A.AD_CODE,0,2) subAd FROM ATT_AD_X_BASE A LEFT JOIN BIS_INSP_ALL_OBJ B ON A.AD_CODE = B.CODE
- WHERE B.PTYPE = '2' AND B.ID in (${groupId})) T1 LEFT JOIN ATT_AD_X_BASE AD ON
- CONCAT(T1.subAd,'0000000000') = AD.AD_CODE
- where length(t1.id) = 12
- </select>
- <select id="getCwsCountyCountById" resultType="cn.com.goldenwater.dcproj.dto.PersCountDto">
- SELECT t1.id,COUNT(AD.AD_NAME) as count FROM
- (SELECT distinct b.id,SUBSTR(A.AD_CODE,0,6) subAd FROM ATT_AD_X_BASE A LEFT JOIN BIS_INSP_ALL_OBJ B ON A.AD_CODE = B.CODE
- WHERE B.PTYPE = '2' AND B.ID in (${groupId}) ) T1 LEFT JOIN ATT_AD_X_BASE AD ON
- CONCAT(T1.subAd,'000000') = AD.AD_CODE
- group by t1.id
- </select>
- <select id="getVillageCountByGroupId" resultType="cn.com.goldenwater.dcproj.dto.PersCountDto">
- select A.type,C.id,count(*) as count from (
- select '1' as type,A.ENG_ID from BIS_INSP_SECSURVEY_VLG A
- union all
- select '2' as type,A.ENG_ID from BIS_INSP_WATERUSER_INFO A
- union all
- select '3' as type,A.ENG_ID from BIS_INSP_VLGDRINK_PROJ_MANAGE A
- union all
- select '4' as type,A.ENG_ID from BIS_INSP_PRO_SOURCE_PROTECT A
- ) A LEFT JOIN BIS_INSP_VILL_RGSTR B ON A.ENG_ID = B.ENG_ID
- LEFT JOIN BIS_INSP_ALL_OBJ C ON B.OBJ_ID = C.OBJ_ID
- where c.ptype = '2' and c.id in (${groupId})
- <if test="sttm != null and sttm != '' and entm != null and entm != ''">
- AND B.intm >= TO_DATE(#{sttm},'YYYY-MM-DD') AND t.uptm < TO_DATE(#{entm},'YYYY-MM-DD') +
- 1
- </if>
- <if test="state != null and state != ''">
- AND case when B.state is null then '0' else B.state end = #{state}
- </if>
- group by A.type,C.id
- </select>
- <select id="getAllProCountByGroupId" resultType="cn.com.goldenwater.dcproj.dto.PersCountDto">
- select a.INSP_PBLM_CATE as type,b.id,COUNT(PBLM_ID) count from BIS_INSP_PBLM A LEFT JOIN BIS_INSP_ALL_OBJ B ON A.OBJ_ID = B.OBJ_ID
- <if test='type == "1" and type=="36"'>
- LEFT JOIN BIS_INSP_RSVR_RGSTR C ON A.OBJ_ID = C.OBJ_ID
- </if>
- <if test='type == "2"'>
- LEFT JOIN BIS_INSP_VILL_RGSTR C ON A.OBJ_ID = C.OBJ_ID
- </if>
- <if test='type == "3"'>
- LEFT JOIN BIS_INSP_WTDST_TRACK C ON A.OBJ_ID = C.OBJ_ID
- </if>
- <if test='type == "4"'>
- LEFT JOIN BIS_INSP_KEY_REGISTER C ON A.OBJ_ID = C.OBJ_ID
- </if>
- <if test='type == "6"'>
- LEFT JOIN ATT_WAGA_RGSTR C ON A.OBJ_ID = C.OBJ_ID
- </if>
- <if test='type == "7"'>
- LEFT JOIN BIS_INSP_KEY_REGISTER C ON A.OBJ_ID = C.OBJ_ID
- </if>
- <if test='type == "11"'>
- LEFT JOIN BIS_INSP_SD_RGSTR C ON A.OBJ_ID = C.OBJ_ID
- </if>
- <if test='type == "12"'>
- LEFT JOIN BIS_INSP_WIU_RGSTR C ON A.OBJ_ID = C.OBJ_ID
- </if>
- <if test='type == "13"'>
- LEFT JOIN BIS_INSP_SWHS_RGSTR C ON A.OBJ_ID = C.OBJ_ID
- </if>
- <if test='type == "14"'>
- LEFT JOIN BIS_INSP_WINT_RGSTR C ON A.OBJ_ID = C.OBJ_ID
- </if>
- <if test='type == "15"'>
- LEFT JOIN BIS_INSP_SVWT_AREA_RGSTR C ON A.OBJ_ID = C.OBJ_ID
- </if>
- <if test='type == "16"'>
- LEFT JOIN BIS_INSP_SVWT_WUNT_RGSTR C ON A.OBJ_ID = C.OBJ_ID
- </if>
- WHERE B.PTYPE = #{type} AND B.ID in (${groupId}) AND A.OBJ_TYPE = #{type}
- <if test="sttm != null and sttm != '' and entm != null and entm != ''">
- AND A.COLL_TIME >= TO_DATE(#{sttm},'YYYY-MM-DD') AND A.COLL_TIME < TO_DATE(#{entm},'YYYY-MM-DD') + 1
- </if>
- <if test="state != null and state != '' and type != null and type != ''">
- AND case when C.state is null then '0' ELSE C.state end = #{state}
- </if>
- group by a.INSP_PBLM_CATE,b.id
- </select>
- <select id="getPersRsCountByPersIds" resultType="cn.com.goldenwater.dcproj.dto.PersCountDto">
- SELECT c.REC_PERS_ID as id,c.eng_scal as type,count(C.RGSTR_ID) as count FROM BIS_INSP_RSVR_RGSTR C
- where c.REC_PERS_ID is not null and c.REC_PERS_ID in (${persId})
- <if test="sttm != null and sttm != '' and entm != null and entm != ''">
- AND C.INTM >= TO_DATE(#{sttm},'YYYY-MM-DD') AND C.INTM < TO_DATE(#{entm},'YYYY-MM-DD') + 1
- </if>
- <if test="state != null and state != ''">
- AND case when C.state is null then '0' else C.state end = #{state}
- </if>
- group by c.REC_PERS_ID,c.eng_scal
- </select>
- <select id="getPersAdFullNameDtoListByPersIds" parameterType="String" resultType="cn.com.goldenwater.dcproj.dto.AdNameDto">
- SELECT t.id,AD.AD_FULL_NAME adName
- FROM (select DISTINCT b.persId ID,A.AD_CODE AD_CODE
- from BIS_INSP_SEL_AREA A
- LEFT JOIN BIS_INSP_ALL_RLATION B
- ON A.ID = B.ID
- WHERE b.persid in (${persId}) and A.AD_CODE LIKE '__0000000000') T
- LEFT JOIN ATT_AD_X_BASE AD
- ON T.AD_CODE = AD.AD_CODE
- WHERE AD.AD_CODE IS NOT NULL
- </select>
- <select id="getPersAllProCountByPersIds" resultType="cn.com.goldenwater.dcproj.dto.PersCountDto">
- SELECT a.REC_PERS as id,a.insp_pblm_cate as type,count(A.PBLM_ID) as count FROM BIS_INSP_PBLM A
- <if test='type == "1"'>
- LEFT JOIN BIS_INSP_RSVR_RGSTR B ON A.OBJ_ID = B.OBJ_ID
- </if>
- <if test='type == "2"'>
- LEFT JOIN BIS_INSP_VILL_RGSTR B ON A.OBJ_ID = B.OBJ_ID
- </if>
- <if test='type == "3"'>
- LEFT JOIN BIS_INSP_WTDST_TRACK B ON A.OBJ_ID = B.OBJ_ID
- </if>
- <if test='type == "4"'>
- LEFT JOIN BIS_INSP_KEY_REGISTER B ON A.OBJ_ID = B.OBJ_ID
- </if>
- <if test='type == "6"'>
- LEFT JOIN ATT_WAGA_RGSTR B ON A.OBJ_ID = B.OBJ_ID
- </if>
- <if test='type == "7"'>
- LEFT JOIN BIS_INSP_KEY_REGISTER B ON A.OBJ_ID = B.OBJ_ID
- </if>
- <if test='type == "11"'>
- LEFT JOIN BIS_INSP_SD_RGSTR B ON A.OBJ_ID = B.OBJ_ID
- </if>
- <if test='type == "12"'>
- LEFT JOIN BIS_INSP_WIU_RGSTR B ON A.OBJ_ID = B.OBJ_ID
- </if>
- <if test='type == "13"'>
- LEFT JOIN BIS_INSP_SWHS_RGSTR B ON A.OBJ_ID = B.OBJ_ID
- </if>
- <if test='type == "14"'>
- LEFT JOIN BIS_INSP_WINT_RGSTR B ON A.OBJ_ID = B.OBJ_ID
- </if>
- <if test='type == "15"'>
- LEFT JOIN BIS_INSP_SVWT_AREA_RGSTR B ON A.OBJ_ID = B.OBJ_ID
- </if>
- <if test='type == "16"'>
- LEFT JOIN BIS_INSP_SVWT_WUNT_RGSTR B ON A.OBJ_ID = B.OBJ_ID
- </if>
- WHERE a.REC_PERS is not null and A.OBJ_TYPE = #{type} AND A.REC_PERS in (${persId})
- <if test="sttm != null and sttm != '' and entm != null and entm != ''">
- AND A.COLL_TIME >= TO_DATE(#{sttm},'YYYY-MM-DD') AND A.COLL_TIME < TO_DATE(#{entm},'YYYY-MM-DD') + 1
- </if>
- <if test="state != null and state != '' and type != null and type != ''">
- AND case when B.state is null then '0' ELSE B.state end = #{state}
- </if>
- group by a.REC_PERS,a.insp_pblm_cate
- </select>
- <select id="getPersEmpwtCountByPersIds" resultType="cn.com.goldenwater.dcproj.dto.PersCountDto">
- SELECT REC_PERS_ID as id,ENG_STA as type,COUNT(ID) as COUNT FROM BIS_INSP_KEY_REGISTER
- WHERE REC_PERS_ID in (${persId}) and ENG_STA = #{engSta}
- <if test="sttm != null and sttm != '' and entm != null and entm != ''">
- AND INTM >= TO_DATE(#{sttm},'YYYY-MM-DD') AND INTM < TO_DATE(#{entm},'YYYY-MM-DD') + 1
- </if>
- <if test="state != null and state != ''">
- AND case when state is null then '0' else state end = #{state}
- </if>
- group by REC_PERS_ID, ENG_STA
- </select>
- <select id="getOrgProList" parameterType="cn.com.goldenwater.dcproj.param.BriefReportParam" resultType="cn.com.goldenwater.dcproj.model.BriefReport">
- select ad.ad_code, ad.ad_name, a.code, b.pnm, a.num, a.type from (
- select A.id as code,A.code as ad_code,A.type,count(A.rgstrId) as num from (
- select substr(o.id, 1, 6) as id,
- substr(t.ad_code, 1, 2) as code,t.rgstrId,t.type from (
- select o.id, o.obj_id from bis_insp_all_obj o where o.ptype = #{objType}
- ) o left join
- <if test='objType == "9"'>
- (
- select t.id as rgstrId,t.obj_id,'' as type, t.ad_code,(case when t.state is null then '0' else t.state end)
- state,t.in_tm,t.up_tm from
- BIS_INSP_FSC_RGSTR t
- )
- </if>
- <if test='objType == "10"'>
- (select t.id as rgstrId,t.obj_id,'' as type, t.ad_code,(case when t.state is null then '0' else t.state end) state,t.in_tm,t.up_tm from
- BIS_INSP_OTHER_RGSTR t)
- </if>
- <if test='objType == "11"'>
- (select t.id as rgstrId,t.obj_id,'' as type, t.ad_code,(case when t.state is null then '0' else t.state end) state,t.in_tm,t.up_tm from
- BIS_INSP_SD_RGSTR t)
- </if>
- <if test='objType == "12"'>
- (select t.id as rgstrId,t.obj_id,'' as type, t.ad_code,(case when t.state is null then '0' else t.state end) state,t.in_tm,t.up_tm from
- BIS_INSP_WIU_RGSTR t)
- </if>
- <if test='objType == "13"'>
- (select t.id as rgstrId,t.obj_id,'' as type, t.ad_code,(case when t.state is null then '0' else t.state end) state,t.in_tm,t.up_tm from
- BIS_INSP_SWHS_RGSTR t)
- </if>
- <if test='objType == "14"'>
- (select t.id as rgstrId,t.obj_id,'' as type, t.ad_code,(case when t.state is null then '0' else t.state end) state,t.in_tm,t.up_tm from
- BIS_INSP_WINT_RGSTR t)
- </if>
- <if test='objType == "15"'>
- (select t.id as rgstrId,t.obj_id,'' as type, t.ad_code,(case when t.state is null then '0' else t.state end) state,t.in_tm,t.up_tm from
- BIS_INSP_SVWT_AREA_RGSTR t)
- </if>
- <if test='objType == "16"'>
- (select t.id as rgstrId,t.obj_id,'' as type, t.ad_code,(case when t.state is null then '0' else t.state end) state,t.in_tm,t.up_tm from
- BIS_INSP_SVWT_WUNT_RGSTR t)
- </if>
- t on o.obj_id = t.obj_id
- where t.obj_id is not null and length(o.id) > 3
- <if test="state != null and state != ''">
- AND t.state = #{state}
- </if>
- <if test="sttm != null and sttm != '' and entm != null and entm != ''">
- AND t.INTM >= TO_DATE(#{sttm},'YYYY-MM-DD') AND t.INTM < TO_DATE(#{entm},'YYYY-MM-DD') + 1
- </if>
- )A group by A.id,A.code,A.type
- ) a left join BIS_INSP_ALL b
- on a.code = b.id
- left join att_ad_base ad
- on concat(a.ad_code, '0000000000') = ad.ad_code
- where 1=1
- <if test="orgName != null and orgName != ''">
- and b.pnm like CONCAT('%',CONCAT(#{orgName}, '%'))
- </if>
- <if test="adName != null and adName != ''">
- and ad.ad_name like CONCAT('%',CONCAT(#{adName}, '%'))
- </if>
- order by to_number(ad.ad_code),to_number(a.code)
- </select>
- <select id="getOrgPblmList" parameterType="cn.com.goldenwater.dcproj.param.BriefReportParam" resultType="cn.com.goldenwater.dcproj.model.BriefReport">
- select AD.AD_CODE,AD.AD_NAME,a.code, b.pnm, a.num, a.type
- from (select SUBSTR(Q.AD_CODE,1,2) AS AD_CODE,q.code, count(q.pblm_id) as num, q.type FROM
- <if test='objType == "9"'>
- (
- select t.id as pblm_id,t.rect_conc as type,substr(o.id, 1, 6) as code,r.ad_code,t.in_tm,(case when r.state is null then '0' else r.state end) state from BIS_INSP_FSC_PBLM t left join Bis_Insp_Fsc_Rgstr r on t.rgstr_id = r.id left join bis_insp_all_obj o on r.obj_id = o.obj_id
- where r.obj_id is not null
- )
- </if>
- <if test='objType == "10"'>
- (select t.id as pblm_id,(case when t.rect_conc is null then '0' else t.rect_conc end) as type,substr(o.id, 1, 6) as code,r.ad_code,t.in_tm,(case when r.state is null then '0' else r.state end) state from BIS_INSP_OTHER_PBLM t left join Bis_Insp_OTHER_Rgstr r on t.rgstr_id = r.id left join bis_insp_all_obj o on r.obj_id = o.obj_id
- where r.obj_id is not null)
- </if>
- <if test='objType == "11"'>
- (select t.pblm_id,(case when t.INSP_PBLM_CATE is null then '0' else INSP_PBLM_CATE end) as type,substr(o.id, 1, 6) as code,r.ad_code,t.COLL_TIME as in_tm,(case when r.state is null then '0' else r.state end) state from Bis_Insp_Pblm t left join bis_insp_all_obj o on t.obj_id = o.obj_id left join BIS_INSP_SD_RGSTR r on o.obj_id = r.obj_id
- where t.obj_type = #{objType} and r.obj_id is not null)
- </if>
- <if test='objType == "12"'>
- (select t.pblm_id,(case when t.INSP_PBLM_CATE is null then '0' else INSP_PBLM_CATE end) as type,substr(o.id, 1, 6) as code,r.ad_code,t.COLL_TIME as in_tm,(case when r.state is null then '0' else r.state end) state from Bis_Insp_Pblm t left join bis_insp_all_obj o on t.obj_id = o.obj_id left join BIS_INSP_WIU_RGSTR r on o.obj_id = r.obj_id
- where t.obj_type = #{objType} and r.obj_id is not null)
- </if>
- <if test='objType == "13"'>
- (select t.pblm_id,(case when t.INSP_PBLM_CATE is null then '0' else INSP_PBLM_CATE end) as type,substr(o.id, 1, 6) as code,r.ad_code,t.COLL_TIME as in_tm,(case when r.state is null then '0' else r.state end) state from Bis_Insp_Pblm t left join bis_insp_all_obj o on t.obj_id = o.obj_id left join BIS_INSP_SWHS_RGSTR r on o.obj_id = r.obj_id
- where t.obj_type = #{objType} and r.obj_id is not null)
- </if>
- <if test='objType == "14"'>
- (select t.pblm_id,(case when t.INSP_PBLM_CATE is null then '0' else INSP_PBLM_CATE end) as type,substr(o.id, 1, 6) as code,r.ad_code,t.COLL_TIME as in_tm,(case when r.state is null then '0' else r.state end) state from Bis_Insp_Pblm t left join bis_insp_all_obj o on t.obj_id = o.obj_id left join BIS_INSP_WINT_RGSTR r on o.obj_id = r.obj_id
- where t.obj_type = #{objType} and r.obj_id is not null)
- </if>
- <if test='objType == "15"'>
- (select t.pblm_id,(case when t.INSP_PBLM_CATE is null then '0' else INSP_PBLM_CATE end) as type,substr(o.id, 1, 6) as code,r.ad_code,t.COLL_TIME as in_tm,(case when r.state is null then '0' else r.state end) state from Bis_Insp_Pblm t left join bis_insp_all_obj o on t.obj_id = o.obj_id left join BIS_INSP_SVWT_AREA_RGSTR r on o.obj_id = r.obj_id
- where t.obj_type = #{objType} and r.obj_id is not null)
- </if>
- <if test='objType == "16"'>
- (select t.pblm_id,(case when t.INSP_PBLM_CATE is null then '0' else INSP_PBLM_CATE end) as type,substr(o.id, 1, 6) as code,r.ad_code,t.COLL_TIME as in_tm,(case when r.state is null then '0' else r.state end) state from Bis_Insp_Pblm t left join bis_insp_all_obj o on t.obj_id = o.obj_id left join BIS_INSP_SVWT_WUNT_RGSTR r on o.obj_id = r.obj_id
- where t.obj_type = #{objType} and r.obj_id is not null)
- </if>
- q where q.ad_code is not null and length(q.code)=6
- <if test="sttm != null and sttm != ''">
- and q.in_tm >= to_date(#{sttm}, 'yyyy-MM-dd')
- </if>
- <if test="entm != null and entm != ''">
- and q.in_tm < to_date(#{entm}, 'yyyy-MM-dd') + 1
- </if>
- <if test="state != null and state != ''">
- AND q.state = #{state}
- </if>
- group by SUBSTR(Q.AD_CODE,1,2),q.code, q.TYPE ) a
- left join BIS_INSP_ALL b
- on a.code = b.id
- LEFT JOIN ATT_AD_X_BASE AD ON CONCAT(A.AD_CODE,'0000000000') = AD.AD_CODE
- where a.code is not null
- <if test="orgName != null and orgName != ''">
- and b.pnm like CONCAT('%',CONCAT(#{orgName}, '%'))
- </if>
- <if test="adName != null and adName != ''">
- and ad.ad_name like CONCAT('%',CONCAT(#{adName}, '%'))
- </if>
- order by to_number(a.AD_CODE),to_number(a.code)
- </select>
- <select id="getOrgWorkProCountList" parameterType="cn.com.goldenwater.dcproj.param.BriefReportParam" resultType="cn.com.goldenwater.dcproj.model.BriefReport">
- select a.code, b.pnm, a.num
- from (select q.id as code, count(distinct q.code) as num
- from (select substr(o.id, 1, 6) as id,
- substr(t.ad_code, 1, 2) as code
- from
- <if test='objType == "9"'>
- BIS_INSP_FSC_RGSTR
- </if>
- <if test='objType == "10"'>
- BIS_INSP_OTHER_RGSTR
- </if>
- <if test='objType == "11"'>
- BIS_INSP_SD_RGSTR
- </if>
- <if test='objType == "12"'>
- BIS_INSP_WIU_RGSTR
- </if>
- <if test='objType == "13"'>
- BIS_INSP_SWHS_RGSTR
- </if>
- <if test='objType == "14"'>
- BIS_INSP_WINT_RGSTR
- </if>
- <if test='objType == "15"'>
- BIS_INSP_SVWT_AREA_RGSTR
- </if>
- <if test='objType == "16"'>
- BIS_INSP_SVWT_WUNT_RGSTR
- </if>
- t left join bis_insp_all_obj o
- on t.obj_id = o.obj_id
- where o.id not like '001016%'
- and o.id not like '001017%'
- and length(o.id) > 3
- <if test="state != null and state != ''">
- AND case when t.state is null then '0' else t.state end = #{state}
- </if>
- ) q
- group by q.id) a
- left join BIS_INSP_ALL b
- on a.code = b.id
- where 1=1
- <if test="orgName != null and orgName != ''">
- and b.pnm like CONCAT('%',CONCAT(#{orgName}, '%'))
- </if>
- order by to_number(a.code)
- </select>
- <select id="getOrgWorkCtCountList" parameterType="cn.com.goldenwater.dcproj.param.BriefReportParam" resultType="cn.com.goldenwater.dcproj.model.BriefReport">
- select a.code, b.pnm, a.num
- from (select q.id as code, count(distinct q.code) as num
- from (select substr(o.id, 1, 6) as id,
- substr(t.ad_code, 1, 6) as code
- from
- <if test='objType == "9"'>
- BIS_INSP_FSC_RGSTR
- </if>
- <if test='objType == "10"'>
- BIS_INSP_OTHER_RGSTR
- </if>
- <if test='objType == "11"'>
- BIS_INSP_SD_RGSTR
- </if>
- <if test='objType == "12"'>
- BIS_INSP_WIU_RGSTR
- </if>
- <if test='objType == "13"'>
- BIS_INSP_SWHS_RGSTR
- </if>
- <if test='objType == "14"'>
- BIS_INSP_WINT_RGSTR
- </if>
- <if test='objType == "15"'>
- BIS_INSP_SVWT_AREA_RGSTR
- </if>
- <if test='objType == "16"'>
- BIS_INSP_SVWT_WUNT_RGSTR
- </if>
- t left join bis_insp_all_obj o
- on t.obj_id = o.obj_id
- where o.id not like '001016%'
- and o.id not like '001017%'
- and length(o.id) > 3
- <if test="state != null and state != ''">
- AND case when t.state is null then '0' else t.state end = #{state}
- </if>
- ) q
- group by q.id) a
- left join BIS_INSP_ALL b
- on a.code = b.id
- where 1=1
- <if test="orgName != null and orgName != ''">
- and b.pnm like CONCAT('%',CONCAT(#{orgName}, '%'))
- </if>
- order by to_number(a.code)
- </select>
- <select id="getOrgWorkObjCountListByType" parameterType="cn.com.goldenwater.dcproj.param.BriefReportParam" resultType="cn.com.goldenwater.dcproj.model.BriefReport">
- select a.code, b.pnm, a.num,a.type
- from (select q.id as code,q.type, count(q.code) as num
- from (select substr(o.id, 1, 6) as id,
- substr(t.ad_code, 1, 6) as code,t.type
- from
- <if test='objType == "9"'>
- (SELECT t.ad_Code,'' as type, t.obj_id, (case when t.state is null then '0' else t.state end) state from BIS_INSP_FSC_RGSTR t)
- </if>
- <if test='objType == "10"'>
- (SELECT t.ad_Code,'' as type, t.obj_id, (case when t.state is null then '0' else t.state end) state from BIS_INSP_OTHER_RGSTR t)
- </if>
- <if test='objType == "11"'>
- (SELECT t.ad_Code,'' as type, t.obj_id, (case when t.state is null then '0' else t.state end) state from BIS_INSP_SD_RGSTR t)
- </if>
- <if test='objType == "12"'>
- (SELECT t.ad_Code,'' as type, t.obj_id, (case when t.state is null then '0' else t.state end) state from BIS_INSP_WIU_RGSTR t)
- </if>
- <if test='objType == "13"'>
- (SELECT t.ad_Code,'' as type, t.obj_id, (case when t.state is null then '0' else t.state end) state from BIS_INSP_SWHS_RGSTR t)
- </if>
- <if test='objType == "14"'>
- (SELECT t.ad_Code,'' as type, t.obj_id, (case when t.state is null then '0' else t.state end) state from BIS_INSP_WINT_RGSTR t)
- </if>
- <if test='objType == "15"'>
- (SELECT t.ad_Code,'' as type, t.obj_id, (case when t.state is null then '0' else t.state end) state from BIS_INSP_SVWT_AREA_RGSTR t)
- </if>
- <if test='objType == "16"'>
- (SELECT t.ad_Code,'' as type, t.obj_id, (case when t.state is null then '0' else t.state end) state from BIS_INSP_SVWT_WUNT_RGSTR t)
- </if>
- t left join bis_insp_all_obj o
- on t.obj_id = o.obj_id
- where o.id not like '001016%'
- and o.id not like '001017%'
- and length(o.id) > 3
- <if test="state != null and state != ''">
- AND t.state = #{state}
- </if>
- <if test="sttm != null and sttm != '' and entm != null and entm != ''">
- AND t.INTM >= TO_DATE(#{sttm},'YYYY-MM-DD') AND t.INTM < TO_DATE(#{entm},'YYYY-MM-DD') + 1
- </if>
- ) q
- group by q.id, q.type) a
- left join BIS_INSP_ALL b
- on a.code = b.id
- where 1=1
- <if test="orgName != null and orgName != ''">
- and b.pnm like CONCAT('%',CONCAT(#{orgName}, '%'))
- </if>
- order by to_number(a.code)
- </select>
- <select id="getPblmCountListByType" parameterType="cn.com.goldenwater.dcproj.param.BriefReportParam" resultType="cn.com.goldenwater.dcproj.model.BriefReport">
- select a.code, b.pnm, a.num, a.type
- from (select q.code,q.type, count(q.pblm_id) as num
- from (
- select t.*
- from
- <if test='objType == "9"'>
- (
- select t.id as pblm_id,t.rect_conc as type,substr(o.id, 1, 6) as code,r.ad_code,t.in_tm,(case when r.state is null then '0' else r.state end) state from BIS_INSP_FSC_PBLM t left join Bis_Insp_Fsc_Rgstr r on t.rgstr_id = r.id left join bis_insp_all_obj o on r.obj_id = o.obj_id
- where r.obj_id is not null
- )
- </if>
- <if test='objType == "10"'>
- (select t.id as pblm_id,(case when t.rect_conc is null then '0' else t.rect_conc end) as type,substr(o.id, 1, 6) as code,r.ad_code,t.in_tm,(case when r.state is null then '0' else r.state end) state from BIS_INSP_OTHER_PBLM t left join Bis_Insp_OTHER_Rgstr r on t.rgstr_id = r.id left join bis_insp_all_obj o on r.obj_id = o.obj_id
- where r.obj_id is not null)
- </if>
- <if test='objType == "11"'>
- (select t.pblm_id,(case when t.INSP_PBLM_CATE is null then '0' else INSP_PBLM_CATE end) as type,substr(o.id, 1, 6) as code,r.ad_code,t.COLL_TIME as in_tm,(case when r.state is null then '0' else r.state end) state from Bis_Insp_Pblm t left join bis_insp_all_obj o on t.obj_id = o.obj_id left join BIS_INSP_SD_RGSTR r on o.obj_id = r.obj_id
- where t.obj_type = #{objType} and r.obj_id is not null)
- </if>
- <if test='objType == "12"'>
- (select t.pblm_id,(case when t.INSP_PBLM_CATE is null then '0' else INSP_PBLM_CATE end) as type,substr(o.id, 1, 6) as code,r.ad_code,t.COLL_TIME as in_tm,(case when r.state is null then '0' else r.state end) state from Bis_Insp_Pblm t left join bis_insp_all_obj o on t.obj_id = o.obj_id left join BIS_INSP_WIU_RGSTR r on o.obj_id = r.obj_id
- where t.obj_type = #{objType} and r.obj_id is not null)
- </if>
- <if test='objType == "13"'>
- (select t.pblm_id,(case when t.INSP_PBLM_CATE is null then '0' else INSP_PBLM_CATE end) as type,substr(o.id, 1, 6) as code,r.ad_code,t.COLL_TIME as in_tm,(case when r.state is null then '0' else r.state end) state from Bis_Insp_Pblm t left join bis_insp_all_obj o on t.obj_id = o.obj_id left join BIS_INSP_SWHS_RGSTR r on o.obj_id = r.obj_id
- where t.obj_type = #{objType} and r.obj_id is not null)
- </if>
- <if test='objType == "14"'>
- (select t.pblm_id,(case when t.INSP_PBLM_CATE is null then '0' else INSP_PBLM_CATE end) as type,substr(o.id, 1, 6) as code,r.ad_code,t.COLL_TIME as in_tm,(case when r.state is null then '0' else r.state end) state from Bis_Insp_Pblm t left join bis_insp_all_obj o on t.obj_id = o.obj_id left join BIS_INSP_WINT_RGSTR r on o.obj_id = r.obj_id
- where t.obj_type = #{objType} and r.obj_id is not null)
- </if>
- <if test='objType == "15"'>
- (select t.pblm_id,(case when t.INSP_PBLM_CATE is null then '0' else INSP_PBLM_CATE end) as type,substr(o.id, 1, 6) as code,r.ad_code,t.COLL_TIME as in_tm,(case when r.state is null then '0' else r.state end) state from Bis_Insp_Pblm t left join bis_insp_all_obj o on t.obj_id = o.obj_id left join BIS_INSP_SVWT_AREA_RGSTR r on o.obj_id = r.obj_id
- where t.obj_type = #{objType} and r.obj_id is not null)
- </if>
- <if test='objType == "16"'>
- (select t.pblm_id,(case when t.INSP_PBLM_CATE is null then '0' else INSP_PBLM_CATE end) as type,substr(o.id, 1, 6) as code,r.ad_code,t.COLL_TIME as in_tm,(case when r.state is null then '0' else r.state end) state from Bis_Insp_Pblm t left join bis_insp_all_obj o on t.obj_id = o.obj_id left join BIS_INSP_SVWT_WUNT_RGSTR r on o.obj_id = r.obj_id
- where t.obj_type = #{objType} and r.obj_id is not null)
- </if>
- t
- where 1=1
- <!--t.rec_pers not in
- (select guid from bis_insp_all_rlation_pers where org_id = '1209')-->
- <if test="sttm != null and sttm != ''">
- and t.in_tm >= to_date(#{sttm}, 'yyyy-MM-dd')
- </if>
- <if test="entm != null and entm != ''">
- and t.in_tm < to_date(#{entm}, 'yyyy-MM-dd') + 1
- </if>
- <if test="state != null and state != ''">
- AND t.state = #{state}
- </if>
- ) q
- group by q.code, q.type) a
- left join BIS_INSP_ALL b
- on a.code = b.id
- where a.code is not null
- <if test="orgName != null and orgName != ''">
- and b.pnm like CONCAT('%',CONCAT(#{orgName}, '%'))
- </if>
- order by to_number(a.code)
- </select>
- <select id="getRiverSupervisionCount" parameterType="cn.com.goldenwater.dcproj.param.BriefReportParam" resultType="cn.com.goldenwater.dcproj.dto.RiverSupervisionRivCount">
- select A.ID basinId,A.PNM basinName,C.ID groupId,C.PNM groupName from BIS_INSP_ALL A LEFT JOIN BIS_INSP_ALL B ON
- A.ID = B.PID
- LEFT JOIN BIS_INSP_ALL C ON B.ID = C.PID WHERE 1 = 1
- <if test="basinId != null and basinId != ''">
- AND A.ID = #{basinId}
- </if>
- <if test="sttm != null and sttm != '' and entm != null and entm != ''">
- AND ((C.STTM <= TO_DATE(#{sttm},'YYYY-MM-DD') AND C.ENTM > (TO_DATE(#{sttm},'YYYY-MM-DD') + 1)) OR
- (C.STTM <= TO_DATE(#{entm},'YYYY-MM-DD') AND C.ENTM > (TO_DATE(#{entm},'YYYY-MM-DD') + 1)))
- </if>
- AND A.ID LIKE '${objType}___'
- ORDER BY A.ID
- </select>
- <select id="getAdNameDtoListByGroupIds" resultType="cn.com.goldenwater.dcproj.dto.AdNameDto" parameterType="java.util.Map">
- SELECT t1.id, AD.AD_NAME FROM
- (SELECT distinct b.id,SUBSTR(A.AD_CODE,0,2) subAd FROM
- <if test='objType == "9"'>
- BIS_INSP_FSC_RGSTR
- </if>
- <if test='objType == "10"'>
- BIS_INSP_OTHER_RGSTR
- </if>
- <if test='objType == "11"'>
- BIS_INSP_SD_RGSTR
- </if>
- <if test='objType == "12"'>
- BIS_INSP_WIU_RGSTR
- </if>
- <if test='objType == "13"'>
- BIS_INSP_SWHS_RGSTR
- </if>
- <if test='objType == "14"'>
- BIS_INSP_WINT_RGSTR
- </if>
- <if test='objType == "15"'>
- BIS_INSP_SVWT_AREA_RGSTR
- </if>
- <if test='objType == "16"'>
- BIS_INSP_SVWT_WUNT_RGSTR
- </if>
- A LEFT JOIN BIS_INSP_ALL_OBJ B ON A.OBJ_ID =
- B.OBJ_ID
- WHERE B.PTYPE = #{objType} AND B.ID in (${groupId})) T1 LEFT JOIN ATT_AD_X_BASE AD ON
- CONCAT(T1.subAd,'0000000000') = AD.AD_CODE
- where length(t1.id) = 12
- </select>
- <select id="getGroupCountyCountById" resultType="cn.com.goldenwater.dcproj.dto.PersCountDto" parameterType="java.util.Map">
- SELECT t1.id,COUNT(AD.AD_NAME) as count FROM
- (SELECT distinct b.id,SUBSTR(A.AD_CODE,0,6) subAd FROM
- <if test='objType == "9"'>
- BIS_INSP_FSC_RGSTR
- </if>
- <if test='objType == "10"'>
- BIS_INSP_OTHER_RGSTR
- </if>
- <if test='objType == "11"'>
- BIS_INSP_SD_RGSTR
- </if>
- <if test='objType == "12"'>
- BIS_INSP_WIU_RGSTR
- </if>
- <if test='objType == "13"'>
- BIS_INSP_SWHS_RGSTR
- </if>
- <if test='objType == "14"'>
- BIS_INSP_WINT_RGSTR
- </if>
- <if test='objType == "15"'>
- BIS_INSP_SVWT_AREA_RGSTR
- </if>
- <if test='objType == "16"'>
- BIS_INSP_SVWT_WUNT_RGSTR
- </if>
- A LEFT JOIN BIS_INSP_ALL_OBJ B ON A.OBJ_ID = B.OBJ_ID
- WHERE B.PTYPE = #{objType} AND B.ID in (${groupId})) T1 LEFT JOIN ATT_AD_X_BASE AD ON
- CONCAT(T1.subAd,'000000') = AD.AD_CODE
- group by t1.id
- </select>
- <select id="getGroupCountByGroupId" resultType="cn.com.goldenwater.dcproj.dto.PersCountDto" parameterType="java.util.Map">
- SELECT t.TYPE ,b.id,COUNT(t.RGSTR_ID) as count FROM
- (
- <if test='objType == "9"'>
- SELECT t.id as RGSTR_ID,'' as type, t.obj_id, (case when t.state is null then '0' else t.state end) state from BIS_INSP_FSC_RGSTR t
- </if>
- <if test='objType == "10"'>
- SELECT t.id as RGSTR_ID,'' as type, t.obj_id, (case when t.state is null then '0' else t.state end) state from BIS_INSP_OTHER_RGSTR t
- </if>
- <if test='objType == "11"'>
- SELECT t.id as RGSTR_ID,'' as type, t.obj_id, (case when t.state is null then '0' else t.state end) state from BIS_INSP_SD_RGSTR t
- </if>
- <if test='objType == "12"'>
- SELECT t.id as RGSTR_ID,'' as type, t.obj_id, (case when t.state is null then '0' else t.state end) state from BIS_INSP_WIU_RGSTR t
- </if>
- <if test='objType == "13"'>
- SELECT t.id as RGSTR_ID,'' as type, t.obj_id, (case when t.state is null then '0' else t.state end) state from BIS_INSP_SWHS_RGSTR t
- </if>
- <if test='objType == "14"'>
- SELECT t.id as RGSTR_ID,'' as type, t.obj_id, (case when t.state is null then '0' else t.state end) state from BIS_INSP_WINT_RGSTR t
- </if>
- <if test='objType == "15"'>
- SELECT t.id as RGSTR_ID,'' as type, t.obj_id, (case when t.state is null then '0' else t.state end) state from BIS_INSP_SVWT_AREA_RGSTR t
- </if>
- <if test='objType == "16"'>
- SELECT t.id as RGSTR_ID,'' as type, t.obj_id, (case when t.state is null then '0' else t.state end) state from BIS_INSP_SVWT_WUNT_RGSTR t
- </if>
- )t LEFT JOIN BIS_INSP_ALL_OBJ B ON t.OBJ_ID = B.OBJ_ID
- WHERE B.ID in (${groupId}) AND B.PTYPE = ${objType}
- <if test="state != null and state != ''">
- AND t.state end = #{state}
- </if>
- group by t.type,b.id
- </select>
- <select id="getFscOrOthProCountByGroupId" resultType="cn.com.goldenwater.dcproj.dto.PersCountDto" parameterType="cn.com.goldenwater.dcproj.param.BriefReportParam">
- select t.type,t.id,COUNT(t.PBLM_ID) count from
- <if test='objType == "009"'>
- (
- select t.id as pblm_id,t.rect_conc as type,o.id,r.ad_code,t.in_tm,(case when r.state is null then '0' else r.state end) state from BIS_INSP_FSC_PBLM t left join Bis_Insp_Fsc_Rgstr r on t.rgstr_id = r.id left join bis_insp_all_obj o on r.obj_id = o.obj_id
- where r.obj_id is not null
- )
- </if>
- <if test='objType == "010"'>
- (select t.id as pblm_id,(case when t.rect_conc is null then '0' else t.rect_conc end) as type,o.id,r.ad_code,t.in_tm,(case when r.state is null then '0' else r.state end) state from BIS_INSP_OTHER_PBLM t left join Bis_Insp_OTHER_Rgstr r on t.rgstr_id = r.id left join bis_insp_all_obj o on r.obj_id = o.obj_id
- where r.obj_id is not null)
- </if>
- t
- WHERE t.ID in (${groupId})
- <if test="sttm != null and sttm != '' and entm != null and entm != ''">
- AND t.IN_TM >= TO_DATE(#{sttm},'YYYY-MM-DD') AND t.IN_TM < TO_DATE(#{entm},'YYYY-MM-DD') + 1
- </if>
- <if test="state != null and state != '' and type != null and type != ''">
- AND t.state = #{state}
- </if>
- group by t.type,t.id
- </select>
- <select id="getPersWorkSupervisionInfo" parameterType="cn.com.goldenwater.dcproj.param.BriefReportParam"
- resultType="cn.com.goldenwater.dcproj.dto.RiverSupervisionRivCount">
- SELECT B.GUID persId,B.PERS_NAME persName,B.ORG_ID basinId,B.ORG_NM basinName FROM
- (SELECT DISTINCT PERSID FROM BIS_INSP_ALL_RLATION
- WHERE ID LIKE '${objType}%') A LEFT JOIN BIS_INSP_ALL_RLATION_PERS B
- ON A.PERSID = B.GUID
- WHERE B.GUID IS NOT NULL
- <if test="basinId != null and basinId != ''">
- AND CONCAT(#{type},B.ORG_ID) = #{basinId}
- </if>
- <if test="persName != null and persName != ''">
- AND B.PERS_NAME LIKE '%${persName}%'
- </if>
- </select>
- <select id="getPersCountByPersIds" resultType="cn.com.goldenwater.dcproj.dto.PersCountDto" parameterType="cn.com.goldenwater.dcproj.param.BriefReportParam">
- SELECT c.pers_id as id,c.type,count(*) as count FROM
- (
- <if test='objType == "009"'>
- select t.pers_id,'' as type,t.IN_TM,(case when t.state is null then '0' else t.state end) state from BIS_INSP_FSC_RGSTR t
- </if>
- <if test='objType == "010"'>
- select t.pers_id,'' as type,t.IN_TM,(case when t.state is null then '0' else t.state end) state from BIS_INSP_OTHER_RGSTR t
- </if>
- <if test='objType == "011"'>
- select t.pers_id,'' as type,t.IN_TM,(case when t.state is null then '0' else t.state end) state from BIS_INSP_SD_RGSTR t
- </if>
- <if test='objType == "012"'>
- select t.pers_id,'' as type,t.IN_TM,(case when t.state is null then '0' else t.state end) state from BIS_INSP_WIU_RGSTR t
- </if>
- <if test='objType == "013"'>
- select t.pers_id,'' as type,t.IN_TM,(case when t.state is null then '0' else t.state end) state from BIS_INSP_SWHS_RGSTR t
- </if>
- <if test='objType == "014"'>
- select t.pers_id,'' as type,t.IN_TM,(case when t.state is null then '0' else t.state end) state from BIS_INSP_WINT_RGSTR t
- </if>
- <if test='objType == "015"'>
- select t.pers_id,'' as type,t.IN_TM,(case when t.state is null then '0' else t.state end) state from BIS_INSP_SVWT_AREA_RGSTR t
- </if>
- <if test='objType == "016"'>
- select t.pers_id,'' as type,t.IN_TM,(case when t.state is null then '0' else t.state end) state from BIS_INSP_SVWT_WUNT_RGSTR t
- </if>
- ) c
- where c.pers_id is not null and c.pers_id in (${persIds})
- <if test="sttm != null and sttm != '' and entm != null and entm != ''">
- AND C.INTM >= TO_DATE(#{sttm},'YYYY-MM-DD') AND C.INTM < TO_DATE(#{entm},'YYYY-MM-DD') + 1
- </if>
- <if test="state != null and state != ''">
- AND c.state = #{state}
- </if>
- group by c.pers_id,c.type
- </select>
- <select id="getPersFscOrOthProCountByPersIds" resultType="cn.com.goldenwater.dcproj.dto.PersCountDto" parameterType="cn.com.goldenwater.dcproj.param.BriefReportParam">
- SELECT a.pers_id as id,a.type,count(A.id) as count FROM (
- <if test='objType == "009"'>
- SELECT p.id,p.pers_id,p.RECT_CONC as type,p.IN_TM,(case when r.state is null then '0' else r.state end) state from bis_insp_fsc_pblm p left join BIS_INSP_FSC_RGSTR r on p.rgstr_id = r.id
- where r.id is not null
- </if>
- <if test='objType == "010"'>
- SELECT p.id,p.pers_id,p.RECT_CONC as type,p.IN_TM,(case when r.state is null then '0' else r.state end) state from bis_insp_OTHER_pblm p left join BIS_INSP_OTHER_RGSTR r on p.rgstr_id = r.id
- where r.id is not null
- </if>
- ) a
- WHERE a.pers_id is not null AND A.pers_id in (${persIds})
- <if test="sttm != null and sttm != '' and entm != null and entm != ''">
- AND A.IN_TM >= TO_DATE(#{sttm},'YYYY-MM-DD') AND A.IN_TM < TO_DATE(#{entm},'YYYY-MM-DD') + 1
- </if>
- <if test="state != null and state != '' and type != null and type != ''">
- AND a.state = #{state}
- </if>
- group by a.pers_id,a.type
- </select>
- </mapper>
|