| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113 |
- <?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.TaskDthDayCountDao">
- <resultMap type="cn.com.goldenwater.dcproj.dto.BisInspTaskTotal" id="BisInspTaskTotalResultMap">
- <result property="objSize" column="OBJ_SIZE"/>
- <result property="pblmSize" column="PBLM_SIZE"/>
- <result property="mendSize" column="MEND_SIZE"/>
- <result property="pblmLogSize" column="PBLM_LOG_SIZE"/>
- <result property="infoPlbm" column="INFO_PLBM"/>
- <result property="warmPlbm" column="WARM_PLBM"/>
- <result property="errorPlbm" column="ERROR_PLBM"/>
- </resultMap>
- <resultMap type="cn.com.goldenwater.dcproj.model.BisInspTaskTypeItemTotal" id="BisInspTaskTypeItemTotalResultMap">
- <result property="itemName" column="INSP_PBLM_NAME"/>
- <result property="pblmSize" column="PBLM_SIZE"/>
- <result property="mendSize" column="MEND_SIZE"/>
- <result property="pblmLogSize" column="PBLM_LOG_SIZE"/>
- <result property="infoPlbm" column="INFO_PLBM"/>
- <result property="warmPlbm" column="WARM_PLBM"/>
- <result property="errorPlbm" column="ERROR_PLBM"/>
- </resultMap>
- <sql id="page_where">
- <trim prefix="where" prefixOverrides="and | or ">
- <if test="orgId != null and orgId != ''">and ORG_ID = #{orgId}</if>
- <if test="adCode != null and adCode != ''">and AD_CODE = #{adCode}</if>
- <if test="adName != null and adName != ''">and AD_NAME = #{adName}</if>
- <if test="adFullName != null and adFullName != ''">and AD_FULL_NAME = #{adFullName}</if>
- <if test="adGrad != null and adGrad != ''">and AD_GRAD = #{adGrad}</if>
- <if test="tm != null">and TM = #{tm}</if>
- <if test="objType != null and objType != ''">and OBJ_TYPE = #{objType}</if>
- <if test="objName != null and objName != ''">and OBJ_NAME = #{objName}</if>
- <if test="objSize != null and objSize != ''">and OBJ_SIZE = #{objSize}</if>
- <if test="pblmSize != null and pblmSize != ''">and PBLM_SIZE = #{pblmSize}</if>
- <if test="mendSize != null and mendSize != ''">and MEND_SIZE = #{mendSize}</if>
- <if test="pblmLogSize != null and pblmLogSize != ''">and PBLM_LOG_SIZE = #{pblmLogSize}</if>
- <if test="intm != null">and INTM = #{intm}</if>
- <if test="uptm != null">and UPTM = #{uptm}</if>
- <if test="dataStat != null and dataStat != ''">and DATA_STAT = #{dataStat}</if>
- and DATA_STAT='0'
- </trim>
- </sql>
- <select id="getListByTm" resultMap="BisInspTaskTotalResultMap">
- select
- count(*) OBJ_SIZE
- from
- BIS_INSP_ALL_OBJ O
- <where>
- <if test="objType != null and objType != '' ">
- and PTYPE = #{objType}
- </if>
- <if test="stTm != null and stTm != '' ">
- and OBJ_INTM >= to_date(#{stTm}, 'yyyy-MM-dd')
- </if>
- <if test="enTm != null and enTm != '' ">
- and OBJ_INTM < to_date(#{enTm}, 'yyyy-MM-dd') + 1
- </if>
- <if test="adCode != null and adCode != '' ">
- and OBJ_AD_CODE like '${adCode}%'
- </if>
- </where>
- </select>
- <select id="getListJichaByTm" resultType="cn.com.goldenwater.dcproj.dto.BisInspTaskTotal">
- select
- count(*) OBJ_SIZE
- from
- TAC_PAWP_RGSTR O
- <where>
- DATA_STAT = '0'
- <if test="stTm != null and stTm != '' ">
- and INTM >= to_date(#{stTm}, 'yyyy-MM-dd')
- </if>
- <if test="enTm != null and enTm != '' ">
- and INTM < to_date(#{enTm}, 'yyyy-MM-dd') + 1
- </if>
- <if test="adCode != null and adCode != '' ">
- and AD_CODE like '${adCode}%'
- </if>
- </where>
- </select>
- <select id="getPblmListByTm" resultMap="BisInspTaskTotalResultMap">
- SELECT
- NVL(COUNT(A.PBLM_ID),0) PBLM_SIZE,
- NVL(SUM( CASE A.INSP_PBLM_CATE WHEN '0' THEN 1 ELSE 0 END ), 0) INFO_PLBM,
- NVL(SUM( CASE A.INSP_PBLM_CATE WHEN '1' THEN 1 ELSE 0 END ), 0) WARM_PLBM,
- NVL(SUM( CASE A.INSP_PBLM_CATE WHEN '2' THEN 1 ELSE 0 END ), 0) ERROR_PLBM,
- NVL(SUM( CASE A.INSP_PBLM_CATE WHEN '3' THEN 1 ELSE 0 END ), 0) ERROR_PLBM
- FROM BIS_INSP_PBLM A
- WHERE a.obj_type = #{objType}
- and to_date(to_CHAR(a.coll_time, 'yyyy-MM-dd'), 'yyyy-MM-dd') >= to_date(#{stTm}, 'yyyy-MM-dd')
- and to_date(to_CHAR(a.coll_time, 'yyyy-MM-dd'), 'yyyy-MM-dd') < to_date(#{enTm}, 'yyyy-MM-dd') + 1
- <if test="adCode != null and adCode != '' ">
- and A.OBJ_AD_CODE like '${adCode}%'
- </if>
- </select>
- <select id="getPblmListJichaByTm" resultMap="BisInspTaskTotalResultMap">
- SELECT
- NVL(COUNT(A.ID),0) PBLM_SIZE,
- NVL(SUM( CASE A.PBLM_PASI WHEN '0' THEN 1 ELSE 0 END ), 0) INFO_PLBM,
- NVL(SUM( CASE A.PBLM_PASI WHEN '1' THEN 1 ELSE 0 END ), 0) WARM_PLBM,
- NVL(SUM( CASE A.PBLM_PASI WHEN '2' THEN 1 ELSE 0 END ), 0) ERROR_PLBM
- FROM TAC_PBLM_INFO A
- JOIN TAC_PAWP_RGSTR R ON A.RGSTR_ID=R.ID
- WHERE
- R.DATA_STAT= '0'
- AND A.INTM >= TO_DATE(#{STTM}, 'YYYY-MM-DD')
- AND A.INTM < TO_DATE(#{ENTM}, 'YYYY-MM-DD') + 1
- <if test="adCode != null and adCode != '' ">
- and r.AD_CODE like '${adCode}%'
- </if>
- </select>
- <select id="getPblmListTypeByTm" resultMap="BisInspTaskTypeItemTotalResultMap">
- SELECT
- A.INSP_PBLM_NAME, NVL(COUNT( A.PBLM_ID ),0) PBLM_SIZE, 0 AS "MEND_SIZE", 0 AS "PBLM_LOG_SIZE",
- SUM( CASE A.INSP_PBLM_CATE WHEN '0' THEN 1 ELSE 0 END ) INFO_PLBM,
- SUM( CASE A.INSP_PBLM_CATE WHEN '1' THEN 1 ELSE 0 END ) WARM_PLBM,
- SUM( CASE A.INSP_PBLM_CATE WHEN '2' THEN 1 ELSE 0 END ) ERROR_PLBM
- FROM BIS_INSP_PBLM A
- WHERE
- A.INSP_PBLM_NAME IS NOT NULL
- and a.obj_type = #{objType}
- and to_date(to_CHAR(a.coll_time, 'yyyy-MM-dd'), 'yyyy-MM-dd') >= to_date(#{stTm}, 'yyyy-MM-dd')
- and to_date(to_CHAR(a.coll_time, 'yyyy-MM-dd'), 'yyyy-MM-dd') < to_date(#{enTm}, 'yyyy-MM-dd') + 1
- <if test="adCode != null and adCode != '' ">
- and A.OBJ_AD_CODE like '${adCode}%'
- </if>
- GROUP BY INSP_PBLM_NAME
- </select>
- <select id="getPblmListTypeJichaByTm" resultMap="BisInspTaskTypeItemTotalResultMap">
- SELECT
- TB.SPFSNL_TYPE, NVL(COUNT( A.ID ),0) PBLM_SIZE, 0 AS "MEND_SIZE", 0 AS "PBLM_LOG_SIZE",
- SUM( CASE A.PBLM_PASI WHEN '0' THEN 1 ELSE 0 END ) INFO_PLBM,
- SUM( CASE A.PBLM_PASI WHEN '1' THEN 1 ELSE 0 END ) WARM_PLBM,
- SUM( CASE A.PBLM_PASI WHEN '2' THEN 1 ELSE 0 END ) ERROR_PLBM
- FROM TAC_PBLM_INFO A JOIN TAC_PAWP_RGSTR R ON A.RGSTR_ID=R.ID
- LEFT JOIN TAC_OBJ_PBLMSTB TB ON TB.ID = A.PBLMSTD_ID
- WHERE
- R.DATA_STAT = '0'
- AND TB.SPFSNL_TYPE IS NOT NULL
- and a.INTM >= to_date(#{stTm}, 'yyyy-MM-dd')
- and a.INTM < to_date(#{enTm}, 'yyyy-MM-dd') + 1
- <if test="adCode != null and adCode != '' ">
- and R.AD_CODE like '${adCode}%'
- </if>
- GROUP BY TB.SPFSNL_TYPE
- </select>
- <select id="getPblmListTypeJiChaByTm" resultMap="BisInspTaskTypeItemTotalResultMap">
- SELECT
- A.*, nvl(B.PBLM_LOG_SIZE, 0) AS "PBLM_LOG_SIZE"
- FROM
- (
- SELECT
- A.INSP_PBLM_NAME, nvl(COUNT( A.PBLM_ID ),0) PBLM_SIZE, 0 AS "MEND_SIZE",
- SUM( CASE A.INSP_PBLM_CATE WHEN '0' THEN 1 ELSE 0 END ) INFO_PLBM,
- SUM( CASE A.INSP_PBLM_CATE WHEN '1' THEN 1 ELSE 0 END ) WARM_PLBM,
- SUM( CASE A.INSP_PBLM_CATE WHEN '2' THEN 1 ELSE 0 END ) ERROR_PLBM
- FROM BIS_INSP_PBLM A
- JOIN BIS_INSP_ALL_OBJ B ON A.OBJ_ID = B.OBJ_ID
- WHERE
- A.DATA_STAT = '0'
- AND A.INSP_PBLM_NAME IS NOT NULL
- and to_date(to_CHAR(a.coll_time, 'yyyy-MM-dd'), 'yyyy-MM-dd') >= to_date(#{stTm}, 'yyyy-MM-dd')
- and to_date(to_CHAR(a.coll_time, 'yyyy-MM-dd'), 'yyyy-MM-dd') < to_date(#{enTm}, 'yyyy-MM-dd') + 1
- <if test="adCode != null and adCode != '' ">
- and B.OBJ_AD_CODE like '${adCode}%'
- </if>
- GROUP BY INSP_PBLM_NAME
- ) A
- LEFT JOIN (
- SELECT
- A.INSP_PBLM_NAME, nvl(COUNT( A.PBLM_ID ),0) PBLM_LOG_SIZE
- FROM BIS_INSP_PBLM_DEL_LOG A
- JOIN BIS_INSP_ALL_OBJ B ON A.OBJ_ID = B.OBJ_ID
- WHERE
- a.obj_type = '8'
- and a.coll_time BETWEEN to_date(#{stTm}, 'yyyy-MM-dd') and to_date(#{enTm}, 'yyyy-MM-dd')
- <if test="adCode != null and adCode != '' ">
- and B.OBJ_AD_CODE like '${adCode}%'
- </if>
- GROUP BY A.INSP_PBLM_NAME
- ) B ON A.INSP_PBLM_NAME = B.INSP_PBLM_NAME
- </select>
- <select id="getObjSize" resultType="java.util.Map">
- select
- nvl(count(*), 0) OBJSIZE
- from BIS_INSP_ALL_OBJ O
- JOIN (select * FROM ATT_INSP_TYPE where code IN (select INSP_TYPE FROM REL_ORG_INSP_TYPE
- <where>
- <if test="orgId != null and orgId != '' ">
- AND ORG_ID = #{orgId}
- </if>
- </where>
- )) A ON O.PTYPE = A.PTYPE
- JOIN BIS_INSP_ALL AL ON O.ID = AL.ID
- <where>
- <if test="orgId != null and orgId != '' ">AND O.ID LIKE '___${orgId}%'</if>
- <if test="province != null and province != '' ">AND O.OBJ_AD_CODE LIKE CONCAT(#{province}, '%')</if>
- <if test="adCode != null and adCode != '' ">and O.OBJ_AD_CODE LIKE CONCAT(#{adCode}, '%')</if>
- <!-- 福建省 福州市排除 平潭县 把平潭县 归属到 平潭综合实验区-->
- <if test='adCode != null and adCode == "3501" '>AND SUBSTR(O.OBJ_AD_CODE, 0, 6) !='350128'</if>
- <if test='adCode != null and adCode == "3510" '>AND SUBSTR(O.OBJ_AD_CODE, 0, 6) ='350128'</if>
- <if test="objType != null and objType != '' ">and O.PTYPE = #{objType}</if>
- <if test="sttm != null and sttm != '' ">and O.OBJ_INTM >= to_date(#{sttm}, 'yyyy-MM-dd')</if>
- <if test="entm != null and entm != '' ">and O.OBJ_INTM < to_date(#{entm}, 'yyyy-MM-dd') + 1</if>
- </where>
- </select>
- <!-- lxf 2022/11/22 督查对象重复数量 -->
- <select id="getObjSizeRepeat" resultType="java.util.Map">
- select
- <!-- 统计督查对象 重复数量 add lxf 2022/11/19 -->
- nvl(count(*), 0) OBJSIZEREPEAT
- from BIS_INSP_ALL_OBJ O
- JOIN (select * FROM ATT_INSP_TYPE where code IN (select INSP_TYPE FROM REL_ORG_INSP_TYPE
- <where>
- <if test="orgId != null and orgId != '' ">
- AND ORG_ID = #{orgId}
- </if>
- </where>
- )) A ON O.PTYPE = A.PTYPE
- where O.code IN ( SELECT biaoin.code FROM BIS_INSP_ALL_OBJ biaoin
- <where>
- <if test="orgId != null and orgId != '' ">AND biaoin.ID LIKE '___${orgId}%'</if>
- <if test="province != null and province != '' ">AND biaoin.OBJ_AD_CODE LIKE CONCAT(#{province}, '%')</if>
- <if test="adCode != null and adCode != '' ">and biaoin.OBJ_AD_CODE LIKE CONCAT(#{adCode}, '%')</if>
- <!-- 福建省 福州市排除 平潭县 把平潭县 归属到 平潭综合实验区-->
- <if test='adCode != null and adCode == "3501" '>AND SUBSTR(biaoin.OBJ_AD_CODE, 0, 6) !='350128'</if>
- <if test='adCode != null and adCode == "3510" '>AND SUBSTR(biaoin.OBJ_AD_CODE, 0, 6) ='350128'</if>
- <if test="objType != null and objType != '' ">and biaoin.PTYPE = #{objType}</if>
- <if test="sttm != null and sttm != '' ">and biaoin.OBJ_INTM >= to_date(#{sttm}, 'yyyy-MM-dd')</if>
- <if test="entm != null and entm != '' ">and biaoin.OBJ_INTM < to_date(#{entm}, 'yyyy-MM-dd') + 1</if>
- <if test="orgId != null and orgId != '' ">
- AND biaoin.ORG_ID = #{orgId}
- </if>
- <if test='adCode != null and adCode != "" '> AND biaoin.OBJ_AD_CODE like '${adCode}%'</if>
- </where>
- GROUP BY biaoin.code, biaoin.PTYPE HAVING count( biaoin.code ) > 1
- )
- </select>
- <select id="getPblmSize" resultType="java.util.Map">
- WITH O AS (
- SELECT
- A.NAME,O.OBJ_AD_CODE, O.PTYPE,
- nvl(COUNT(distinct P.PBLM_ID ),0) PBLM_SIZE,
- <!-- 查询确认问题数量 数据状态0:暂存;1:已提交;2:已上报;3:退回;4:审核定稿;5:审办;6:整改通知;7:整改反馈;8:销号;9:删除; -->
- NVL(SUM( CASE WHEN P.STATE = '2' THEN 1 ELSE 0 END ), 0 ) SUBMIT_PLBM
- FROM
- BIS_INSP_ALL_OBJ O
- JOIN (select * FROM ATT_INSP_TYPE where code IN (select INSP_TYPE FROM REL_ORG_INSP_TYPE
- <where>
- <if test='orgId != null and orgId != "" '>
- AND ORG_ID = #{orgId}
- </if>
- </where>
- )) A ON A.PTYPE = O.PTYPE
- JOIN BIS_INSP_PBLM P ON P.OBJ_ID = O.OBJ_ID
- <where>
- <if test="orgId != null and orgId != '' ">O.ID LIKE '___${orgId}%'</if>
- <if test="sttm != null and sttm != '' ">and O.OBJ_INTM >= to_date(#{sttm}, 'yyyy-MM-dd')</if>
- <if test="entm != null and entm != '' ">and O.OBJ_INTM < to_date(#{entm}, 'yyyy-MM-dd') + 1</if>
- </where>
- GROUP BY A.NAME,O.OBJ_AD_CODE, O.PTYPE
- )
- SELECT
- NVL(SUM(PBLM_SIZE),0) PBLMSIZE,
- NVL(SUM(SUBMIT_PLBM),0) SUBMITPLBM
- FROM O
- <where>
- <if test="adCode != null and adCode != '' ">AND OBJ_AD_CODE LIKE CONCAT(#{adCode}, '%')</if>
- <!-- 福建省 福州市排除 平潭县 把平潭县 归属到 平潭综合实验区-->
- <if test='adCode != null and adCode == "3501" '>AND SUBSTR(OBJ_AD_CODE, 0, 6) !='350128'</if>
- <if test='adCode != null and adCode == "3510" '>AND SUBSTR(OBJ_AD_CODE, 0, 6) ='350128'</if>
- <if test="province != null and province != '' ">AND OBJ_AD_CODE LIKE CONCAT(#{province}, '%')</if>
- <if test="objType != null and objType != '' ">AND PTYPE = #{objType}</if>
- </where>
- </select>
- <select id="getDelPblmSize" resultType="java.util.Map">
- SELECT
- nvl(COUNT(A.PBLM_ID), 0) pblmLogSize
- FROM
- BIS_INSP_PBLM_DEL_LOG A
- JOIN
- BIS_INSP_ALL_OBJ B ON A.OBJ_ID=B.OBJ_ID
- <where>
- <if test="adCode != null and adCode != '' ">
- substr(b.OBJ_AD_CODE,0,2)=#{adCode}
- </if>
- </where>
- </select>
- <select id="getObjTypeSize" resultType="java.util.Map">
- select nvl(count(*), 0) objTypeSize
- from REL_ORG_INSP_TYPE
- <where>
- <if test="orgId != null and orgId != '' ">
- ORG_ID = #{orgId}
- </if>
- </where>
- </select>
- <select id="getAllObjSize" resultType="java.util.Map">
- select nvl(count(1),0) ALLOBJSIZE from (
- SELECT ptype FROM BIS_INSP_ALL_OBJ
- <where>
- <if test="adCode != null and adCode != '' ">
- OBJ_AD_CODE like '${adCode}%'
- </if>
- <if test="objType != null and objType != '' ">
- and PTYPE = #{objType}
- </if>
- <if test="sttm != null and sttm != '' ">
- and OBJ_INTM >= to_date(#{sttm}, 'yyyy-MM-dd')
- </if>
- <if test="entm != null and entm != '' ">
- and OBJ_INTM < to_date(#{entm}, 'yyyy-MM-dd') + 1
- </if>
- </where> group by ptype)
- </select>
- <select id="getObjAdCodeSizeS" resultType="java.util.Map">
- select nvl(sum(AD_CODE_SIZE_S),0) OBJADCODESIZES from (
- SELECT
- count(distinct(substr(ad_code,0,6))) AD_CODE_SIZE_S
- FROM
- (
- SELECT OBJ_NAME,
- AD_CODE,
- OBJ_TYPE, OBJ_SIZE, PBLM_SIZE,SUBMIT_PLBM, INFO_PLBM, WARM_PLBM, ERROR_PLBM, ERRORS_PLBM,PBLM_LOG_SIZE,MEND_SIZE,GROUP_SIZE ,PERS_SIZE
- FROM (
- SELECT
- AIT.NAME AS "OBJ_NAME",
- <!-- 把福建省福州市下的平潭县 提到到平潭综合实验区 -->
- <!-- 把山东省莱芜市下的市辖区、莱芜区 归属到济南市莱芜区,钢城区 归属到济南市的钢城区, -->
- ( case when SUBSTR(O.OBJ_AD_CODE, 0, 6) = '350128' then '351000000000' when SUBSTR(O.OBJ_AD_CODE, 0, 6) = '371201' then '370116000000' when SUBSTR(O.OBJ_AD_CODE, 0, 6) = '371202' then '370116000000' when SUBSTR(O.OBJ_AD_CODE, 0, 6) = '371203' then '370117000000' else O.OBJ_AD_CODE end) AS "AD_CODE",
- O.PTYPE as "OBJ_TYPE",
- COUNT( DISTINCT O.OBJ_ID ) OBJ_SIZE,
- COUNT(DISTINCT case when P.PBLM_ID is not null then P.PBLM_ID end ) PBLM_SIZE,
- NVL( SUM( CASE WHEN P.STATE = '2' THEN 1 ELSE 0 END ), 0 ) SUBMIT_PLBM,
- NVL( SUM( CASE P.INSP_PBLM_CATE WHEN '0' THEN 1 ELSE 0 END ), 0 ) INFO_PLBM,
- NVL( SUM( CASE P.INSP_PBLM_CATE WHEN '1' THEN 1 ELSE 0 END ), 0 ) WARM_PLBM,
- NVL( SUM( CASE P.INSP_PBLM_CATE WHEN '2' THEN 1 ELSE 0 END ), 0 ) ERROR_PLBM,
- NVL( SUM( CASE P.INSP_PBLM_CATE WHEN '3' THEN 1 ELSE 0 END ), 0 ) ERRORS_PLBM,
- NVL( SUM( CASE PL.PBLM_OUT WHEN '1' THEN 1 ELSE 0 END ), 0 ) PBLM_LOG_SIZE,
- NVL( COUNT(DISTINCT CASE when PL.PBLM_ID is not null then P.PBLM_ID end ), 0 ) MEND_SIZE,
- count(distinct(o.id)) GROUP_SIZE,
- SUM(( SELECT COUNT(DISTINCT(TT.PERSID)) FROM BIS_INSP_ALL_RLATION TT WHERE TT.ID = O.ID) )PERS_SIZE
- FROM
- BIS_INSP_ALL_OBJ O
- JOIN (select * FROM ATT_INSP_TYPE where code IN (select INSP_TYPE FROM REL_ORG_INSP_TYPE
- <where>
- <if test='orgId != null and orgId != "" '>
- AND ORG_ID = #{orgId}
- </if>
- </where>
- )) AIT ON AIT.PTYPE = O.PTYPE
- LEFT JOIN BIS_INSP_PBLM P ON P.OBJ_ID = O.OBJ_ID
- LEFT JOIN BIS_INSP_PBLM_PLIST Pl ON PL.PBLM_ID = P.PBLM_ID and PL.DATA_STAT='0'
- <where>
- <if test="objType != null and objType != ''">and O.PTYPE = #{objType}</if>
- <if test="orgId != null and orgId != ''">AND O.ID LIKE '___${orgId}%'</if>
- <if test="sttm != null and sttm != '' and entm != null and entm != '' ">
- and O.OBJ_INTM >= TO_DATE(#{sttm}, 'YYYY-MM-DD') and O.OBJ_INTM < TO_DATE(#{entm}, 'YYYY-MM-DD') +1
- </if>
- </where>
- GROUP BY AIT.NAME,O.OBJ_AD_CODE, O.PTYPE
- ) o
- <where>
- <if test="adCode != null and adCode != ''">and o.AD_CODE LIKE '${adCode}%'</if>
- </where>
- ) T
- GROUP BY T.OBJ_NAME, T.OBJ_TYPE
- ORDER BY TO_NUMBER(T.OBJ_TYPE))
- <!--select count(1) OBJADCODESIZES FROM (
- select substr(OBJ_AD_CODE,1,4) from BIS_INSP_ALL_OBJ
- <where>
- <if test="adCode != null and adCode != '' ">
- and OBJ_AD_CODE like '${adCode}%'
- </if>
- <if test="objType != null and objType != '' ">
- and PTYPE = #{objType}
- </if>
- <if test="sttm != null and sttm != '' ">
- and OBJ_INTM >= to_date(#{sttm}, 'yyyy-MM-dd')
- </if>
- <if test="entm != null and entm != '' ">
- and OBJ_INTM < to_date(#{entm}, 'yyyy-MM-dd') + 1
- </if>
- and substr(OBJ_AD_CODE,3,2) <>'00'
- </where>
- GROUP BY substr(OBJ_AD_CODE,1,4) )-->
- </select>
- <select id="getObjAdCodeSizeX" resultType="java.util.Map">
- select nvl(sum(AD_CODE_SIZE_X),0) OBJADCODESIZEX from (
- SELECT
- count(distinct(substr(ad_code,0,6))) AD_CODE_SIZE_X
- FROM
- (
- SELECT OBJ_NAME,
- AD_CODE,
- OBJ_TYPE, OBJ_SIZE, PBLM_SIZE,SUBMIT_PLBM, INFO_PLBM, WARM_PLBM, ERROR_PLBM, ERRORS_PLBM,PBLM_LOG_SIZE,MEND_SIZE,GROUP_SIZE ,PERS_SIZE
- FROM (
- SELECT
- AIT.NAME AS "OBJ_NAME",
- <!-- 把福建省福州市下的平潭县 提到到平潭综合实验区 -->
- <!-- 把山东省莱芜市下的市辖区、莱芜区 归属到济南市莱芜区,钢城区 归属到济南市的钢城区, -->
- ( case when SUBSTR(O.OBJ_AD_CODE, 0, 6) = '350128' then '351000000000' when SUBSTR(O.OBJ_AD_CODE, 0, 6) = '371201' then '370116000000' when SUBSTR(O.OBJ_AD_CODE, 0, 6) = '371202' then '370116000000' when SUBSTR(O.OBJ_AD_CODE, 0, 6) = '371203' then '370117000000' else O.OBJ_AD_CODE end) AS "AD_CODE",
- O.PTYPE as "OBJ_TYPE",
- COUNT( DISTINCT O.OBJ_ID ) OBJ_SIZE,
- COUNT(DISTINCT case when P.PBLM_ID is not null then P.PBLM_ID end ) PBLM_SIZE,
- NVL( SUM( CASE WHEN P.STATE = '2' THEN 1 ELSE 0 END ), 0 ) SUBMIT_PLBM,
- NVL( SUM( CASE P.INSP_PBLM_CATE WHEN '0' THEN 1 ELSE 0 END ), 0 ) INFO_PLBM,
- NVL( SUM( CASE P.INSP_PBLM_CATE WHEN '1' THEN 1 ELSE 0 END ), 0 ) WARM_PLBM,
- NVL( SUM( CASE P.INSP_PBLM_CATE WHEN '2' THEN 1 ELSE 0 END ), 0 ) ERROR_PLBM,
- NVL( SUM( CASE P.INSP_PBLM_CATE WHEN '3' THEN 1 ELSE 0 END ), 0 ) ERRORS_PLBM,
- NVL( SUM( CASE PL.PBLM_OUT WHEN '1' THEN 1 ELSE 0 END ), 0 ) PBLM_LOG_SIZE,
- NVL( COUNT(DISTINCT CASE when PL.PBLM_ID is not null then P.PBLM_ID end ), 0 ) MEND_SIZE,
- count(distinct(o.id)) GROUP_SIZE,
- SUM(( SELECT COUNT(DISTINCT(TT.PERSID)) FROM BIS_INSP_ALL_RLATION TT WHERE TT.ID = O.ID) )PERS_SIZE
- FROM
- BIS_INSP_ALL_OBJ O
- JOIN (select * FROM ATT_INSP_TYPE where code IN (select INSP_TYPE FROM REL_ORG_INSP_TYPE
- <where>
- <if test='orgId != null and orgId != "" '>
- AND ORG_ID = #{orgId}
- </if>
- </where>
- )) AIT ON AIT.PTYPE = O.PTYPE
- LEFT JOIN BIS_INSP_PBLM P ON P.OBJ_ID = O.OBJ_ID
- LEFT JOIN BIS_INSP_PBLM_PLIST Pl ON PL.PBLM_ID = P.PBLM_ID and PL.DATA_STAT='0'
- <where>
- <if test="objType != null and objType != ''">and O.PTYPE = #{objType}</if>
- <if test="orgId != null and orgId != ''">AND O.ID LIKE '___${orgId}%'</if>
- <if test="sttm != null and sttm != '' and entm != null and entm != '' ">
- and O.OBJ_INTM >= TO_DATE(#{sttm}, 'YYYY-MM-DD') and O.OBJ_INTM < TO_DATE(#{entm}, 'YYYY-MM-DD') +1
- </if>
- </where>
- GROUP BY AIT.NAME,O.OBJ_AD_CODE, O.PTYPE
- ) o
- <where>
- <if test="adCode != null and adCode != ''">and o.AD_CODE LIKE '${adCode}%'</if>
- </where>
- ) T
- GROUP BY T.OBJ_NAME, T.OBJ_TYPE
- ORDER BY TO_NUMBER(T.OBJ_TYPE))
- <!--select count(1) OBJADCODESIZEX FROM (
- select substr(OBJ_AD_CODE,1,6) from BIS_INSP_ALL_OBJ <where>
- <if test="adCode != null and adCode != '' ">
- and OBJ_AD_CODE like '${adCode}%'
- </if>
- <if test="objType != null and objType != '' ">
- and PTYPE = #{objType}
- </if>
- <if test="sttm != null and sttm != '' ">
- and OBJ_INTM >= to_date(#{sttm}, 'yyyy-MM-dd')
- </if>
- <if test="entm != null and entm != '' ">
- and OBJ_INTM < to_date(#{entm}, 'yyyy-MM-dd') + 1
- </if>
- and substr(OBJ_AD_CODE,3,2) <>'00'
- and substr(OBJ_AD_CODE,5,2) <> '00'
- </where>GROUP BY substr(OBJ_AD_CODE,1,6) )-->
- </select>
- <select id="getHasObjSize" resultType="java.util.Map">
- SELECT count(DISTINCT O.OBJ_ID) hasObjSize
- FROM (
- SELECT * FROM BIS_INSP_ALL_OBJ
- <where>
- <if test="province != null and province != '' ">AND OBJ_AD_CODE LIKE CONCAT(#{province}, '%')</if>
- <if test="adCode != null and adCode != '' ">
- and OBJ_AD_CODE like '${adCode}%'
- </if>
- <if test="objType != null and objType != '' ">
- and PTYPE = #{objType}
- </if>
- <if test="sttm != null and sttm != '' ">
- and OBJ_INTM >= to_date(#{sttm}, 'yyyy-MM-dd')
- </if>
- <if test="entm != null and entm != '' ">
- and OBJ_INTM < to_date(#{entm}, 'yyyy-MM-dd') + 1
- </if>
- </where>
- ) O
- RIGHT JOIN (
- <foreach collection="rgsterTable" index="index" item="item">
- <if test="index != 0">
- UNION ALL
- </if>
- <choose>
- <when test="item == 'BIS_INSP_GRW' ">
- SELECT OBJ_ID, INSP_STATE AS "STATE" FROM BIS_INSP_GRW WHERE INSP_STATE = '2'
- </when>
- <otherwise>
- SELECT OBJ_ID, STATE FROM ${item} WHERE STATE = '2'
- </otherwise>
- </choose>
- </foreach>
- ) R ON R.OBJ_ID = o.OBJ_ID
- </select>
- <select id="getObjTypeSizeMonth" resultType="java.util.Map">
- select nvl(count(DISTINCT PTYPE), 0) objTypeSizeMonth
- from BIS_INSP_ALL_OBJ
- where
- OBJ_INTM between to_date(to_CHAR(sysdate-30,'yyyy-MM-dd'),'yyyy-mm-dd') and sysdate
- <if test="orgId != null and orgId != '' ">
- AND ORG_ID = #{orgId}
- </if>
- <if test="adCode != null and adCode != ''">AND OBJ_AD_CODE LIKE '${adCode}%'</if>
- </select>
- <select id="getPblmSizeMonth" resultType="java.util.Map">
- SELECT
- nvl(COUNT(A.PBLM_ID), 0) pblmSizeMonth
- FROM
- BIS_INSP_PBLM A
- JOIN
- BIS_INSP_ALL_OBJ B ON A.OBJ_ID=B.OBJ_ID
- WHERE
- A.DATA_STAT= '0'
- AND A.coll_time between to_date(to_CHAR(sysdate-30, 'yyyy-MM-dd'),'yyyy-mm-dd') and sysdate
- <if test="orgId != null and orgId != '' ">AND B.ID LIKE '___${orgId}%'</if>
- <if test="adCode != null and adCode != '' ">AND B.OBJ_AD_CODE LIKE CONCAT(#{adCode}, '%')</if>
- </select>
- <select id="getDelPblmSizeMonth" resultType="java.util.Map">
- SELECT
- nvl(COUNT(A.PBLM_ID), 0) PBLMLOGSIZEMONTH
- FROM BIS_INSP_PBLM_DEL_LOG A
- JOIN BIS_INSP_ALL_OBJ B ON A.OBJ_ID=B.OBJ_ID
- WHERE A.PBLM_DEL_TM between to_date(to_CHAR(sysdate-30, 'yyyy-MM-dd'),'yyyy-mm-dd') and sysdate
- <if test="orgId != null and orgId != '' ">AND B.ID LIKE '___${orgId}%'</if>
- <if test="adCode != null and adCode != '' ">AND B.OBJ_AD_CODE LIKE CONCAT(#{adCode}, '%')</if>
- </select>
- <select id="getObjSizeJicha" resultType="java.util.Map">
- SELECT
- nvl(COUNT( DISTINCT r.id ), 0) objSize
- FROM TAC_INSP_YEAR_BATCH_OBJ O
- JOIN tac_pawp_rgstr r on o.ID = r.obj_id
- <where>
- <if test="year != null and year != ''">and O.YEAR = #{year}</if>
- <if test="batch != null and batch != ''">and O.BATCH = #{batch}</if>
- <if test="adCode != null and adCode != ''">and r.AD_CODE LIKE '${adCode}%'</if>
- <if test="province != null and province != ''">and r.PROVINCE LIKE '${province}%'</if>
- </where>
- </select>
- <select id="getPblmSizeJicha" resultType="java.util.Map">
- WITH O AS (
- SELECT
- DECODE(a.LIST_TYPE, '1', '前期与设计', '2', '建设管理', '3', '计划下达与执行', '4', '资金使用与管理', '5', '工程质量管理-工程实体质量',
- '6','安全管理', '') as NAME, r.AD_CODE as OBJ_AD_CODE, '8' as "PTYPE", a.INTM as "OBJ_INTM", COUNT( a.ID )
- PBLM_SIZE
- FROM TAC_INSP_YEAR_BATCH_OBJ O
- LEFT JOIN tac_pawp_rgstr r ON o.ID = r.obj_id
- <!--LEFT JOIN (SELECT * FROM TAC_PROVINCE_PBLM_INFO WHERE STEP_ID = #{lastStepId}) a ON a.rgstr_id = r.id-->
- LEFT JOIN (SELECT * FROM TAC_PBLM_INFO ) a ON a.rgstr_id = r.id
- <where>
- <if test="year != null and year != ''">and O.YEAR = #{year}</if>
- <if test="batch != null and batch != ''">and O.BATCH = #{batch}</if>
- </where>
- GROUP BY a.list_type, r.AD_CODE, A.INTM
- )
- SELECT
- NVL(SUM(PBLM_SIZE), 0) AS pblmSize
- FROM O
- <where>
- <if test="adCode != null and adCode != ''">OBJ_AD_CODE LIKE '${adCode}%'</if>
- </where>
- </select>
- <select id="getPblmSizeJichaZg" resultType="java.util.Map">
- WITH O AS (
- SELECT
- DECODE(a.LIST_TYPE, '1', '前期与设计', '2', '建设管理', '3', '计划下达与执行', '4', '资金使用与管理', '5', '工程质量管理-工程实体质量',
- '6','安全管理', '') as NAME, r.AD_CODE as OBJ_AD_CODE, '8' as "PTYPE", a.INTM as "OBJ_INTM", COUNT( a.ID )
- PBLM_SIZE
- FROM TAC_INSP_YEAR_BATCH_OBJ O
- LEFT JOIN tac_pawp_rgstr r ON o.ID = r.obj_id
- LEFT JOIN (SELECT * FROM TAC_PROVINCE_PBLM_MEND_INFO WHERE STEP_ID = #{lastStepId} and CRT_STATE='1') a ON
- a.rgstr_id = r.id
- <where>
- <if test="year != null and year != ''">and O.YEAR = #{year}</if>
- <if test="batch != null and batch != ''">and O.BATCH = #{batch}</if>
- </where>
- GROUP BY a.list_type, r.AD_CODE, A.INTM
- )
- SELECT
- NVL(SUM(PBLM_SIZE), 0) AS MENDSIZE
- FROM O
- <where>
- <if test="adCode != null and adCode != ''">OBJ_AD_CODE LIKE '${adCode}%'</if>
- </where>
- </select>
- <select id="getPblmSizeJichaFc" resultType="java.util.Map">
- WITH O AS (
- SELECT
- DECODE(a.LIST_TYPE, '1', '前期与设计', '2', '建设管理', '3', '计划下达与执行', '4', '资金使用与管理', '5', '工程质量管理-工程实体质量',
- '6','安全管理', '') as NAME, r.AD_CODE as OBJ_AD_CODE, '8' as "PTYPE", a.INTM as "OBJ_INTM", COUNT( a.ID )
- PBLM_SIZE
- FROM TAC_INSP_YEAR_BATCH_OBJ O
- LEFT JOIN tac_pawp_rgstr r ON o.ID = r.obj_id
- LEFT JOIN (SELECT * FROM TAC_PROVINCE_PBLM_MEND_INFO WHERE STEP_ID = #{lastStepId} and pblm_out='1') a ON
- a.rgstr_id = r.id
- <where>
- <if test="year != null and year != ''">and O.YEAR = #{year}</if>
- <if test="batch != null and batch != ''">and O.BATCH = #{batch}</if>
- </where>
- GROUP BY a.list_type, r.AD_CODE, A.INTM
- )
- SELECT
- NVL(SUM(PBLM_SIZE), 0) AS PBLMLOGSIZE
- FROM O
- <where>
- <if test="adCode != null and adCode != ''">OBJ_AD_CODE LIKE '${adCode}%'</if>
- </where>
- </select>
- <select id="getHasObjSizeJicha" resultType="java.util.Map">
- SELECT count(DISTINCT O.OBJ_ID) hasObjSize
- FROM (
- SELECT * FROM BIS_INSP_ALL_OBJ
- <where>
- PTYPE = '8'
- <if test="adCode != null and adCode != '' ">
- and OBJ_AD_CODE like '${adCode}%'
- </if>
- </where>
- ) O
- LEFT JOIN (
- <foreach collection="rgsterTable" index="index" item="item">
- <if test="index != 0">
- UNION ALL
- </if>
- <choose>
- <when test="item == 'BIS_INSP_GRW' ">
- SELECT OBJ_ID, INSP_STATE AS "STATE" FROM BIS_INSP_GRW WHERE INSP_STATE = '2'
- </when>
- <otherwise>
- SELECT OBJ_ID, STATE FROM ${item} WHERE STATE = '2'
- </otherwise>
- </choose>
- </foreach>
- ) r ON r.OBJ_ID = o.OBJ_ID
- </select>
- <select id="getBisInspAllSize" resultType="java.util.Map">
- select NVL(count(*),0) as BISINSPALLSIZE from BIS_INSP_ALL A
- JOIN (select * FROM ATT_INSP_TYPE where code IN (select INSP_TYPE FROM REL_ORG_INSP_TYPE
- <where>
- <if test="orgId != null and orgId != '' ">
- AND ORG_ID = #{orgId}
- </if>
- </where>
- )) T ON substr(A.ID,1,3) = T.CODE
- <where>
- LENGTH(A.ID) = 9
- <if test="orgId != null and orgId != '' ">AND A.ID LIKE '___${orgId}%'</if>
- <if test="province != null and province != '' ">AND A.PROVINCE LIKE CONCAT(#{province}, '%')</if>
- <if test="objType != null and objType != '' ">and A.ID LIKE concat(#{objType},'%')</if>
- <if test="sttm != null and sttm != '' ">and A.STTM >= to_date(#{sttm}, 'yyyy-MM-dd')</if>
- <if test="entm != null and entm != '' ">and A.INTM < to_date(#{entm}, 'yyyy-MM-dd') + 1</if>
- </where>
- </select>
- <select id="getBisInspAllGroupSize" resultType="java.util.Map">
- SELECT COUNT(DISTINCT C.ID) BISINSPALLGROUPSIZE
- FROM BIS_INSP_ALL C
- JOIN (select * FROM ATT_INSP_TYPE where code IN (select INSP_TYPE FROM REL_ORG_INSP_TYPE
- <where>
- <if test="orgId != null and orgId != '' ">
- AND ORG_ID = #{orgId}
- </if>
- </where>
- )) T ON SUBSTR(C.ID, 0, 3) = T.CODE
- LEFT JOIN BIS_INSP_ALL_OBJ O ON O.ID = C.ID
- WHERE LENGTH(C.ID) = '12'
- <if test="adCode != null and adCode != ''">AND O.OBJ_AD_CODE LIKE '${adCode}%'</if>
- <if test="orgId != null and orgId != '' ">
- AND C.ID LIKE '___${orgId}%'
- </if>
- <if test="objType != null and objType != '' ">
- and to_number(C.ID) LIKE '${objType}%'
- </if>
- <if test="sttm != null and sttm != '' ">
- and C.STTM >= to_date(#{sttm}, 'yyyy-MM-dd')
- </if>
- <if test="entm != null and entm != '' ">
- and C.STTM < to_date(#{entm}, 'yyyy-MM-dd') + 1
- </if>
- </select>
- <select id="getBisInspAllGroupSizeJicha" resultType="java.util.Map">
- SELECT nvl(COUNT(*),0) GROUPSIZE
- FROM TAC_INSP_YEAR_BATCH_GROUP g
- where exists (select *
- from TAC_INSP_YEAR_BATCH y
- JOIN TAC_INSP_YEAR_BATCH_AREA aa ON aa.YEAR_BATCH_ID = y.ID
- where y.id = g.year_batch_id
- <if test="year != null and year != ''">and y.YEAR = #{year}</if>
- <if test="batch != null and batch != ''">and y.BATCH = #{batch}</if>
- <if test="adCode != null and adCode != ''">and aa.AD_CODE LIKE '${adCode}%'</if>
- <if test="province != null and province != ''">and y.PROVINCE LIKE '${province}%'</if>
- )
- </select>
- <select id="getBisInspAllSizeMonth" resultType="java.util.Map">
- SELECT NVL(COUNT(distinct C.ID),0) BISINSPALLSIZEMONTH
- FROM BIS_INSP_ALL C
- LEFT JOIN BIS_INSP_ALL_OBJ O ON O.ID = C.ID
- WHERE LENGTH(C.ID) = '9'
- and C.INTM between to_date(to_CHAR(sysdate-30, 'yyyy-MM-dd'),'yyyy-mm-dd') and sysdate
- <if test="orgId != null and orgId != '' ">
- AND C.ID LIKE '___${orgId}%'
- </if>
- <if test="adCode != null and adCode != ''">AND O.OBJ_AD_CODE LIKE '${adCode}%'</if>
- </select>
- <!-- 统计 全部人员数量 -->
- <select id="getAllPerSize" resultType="java.util.Map">
- select NVL( count( DISTINCT rp.guid) ,0) as PERSIZEALL
- FROM BIS_INSP_ALL_RLATION_PERS rp,
- Bis_Insp_Pers_Org g
- WHERE rp.guid = g.pers_id
- and g.org_id in (
- select o.org_id from bis_insp_org o
- <!-- 当前登录人 所在行政区划 -->
- where o.ad_code LIKE CONCAT(#{province}, '%' )
- <!-- 选择的行政区划-->
- <if test='adCode != null and adCode != "" '>
- AND o.ad_code LIKE CONCAT(#{adCode}, '%' )
- </if>
- )
- </select>
- <select id="getBisInspAllRlationPerSize" resultType="java.util.Map">
- SELECT NVL(COUNT(DISTINCT B.PERSID),0) PERSIZE
- FROM BIS_INSP_ALL_RLATION B
- JOIN BIS_INSP_ALL C ON B.ID = C.ID
- JOIN BIS_INSP_ALL_RLATION_PERS P ON P.GUID = B.PERSID
- JOIN (select * FROM ATT_INSP_TYPE where code IN (select INSP_TYPE FROM REL_ORG_INSP_TYPE
- <where>
- <if test="orgId != null and orgId != '' ">
- AND ORG_ID = #{orgId}
- </if>
- </where>
- )) T ON SUBSTR(C.ID, 0, 3) = T.CODE
- LEFT JOIN BIS_INSP_ALL_OBJ O ON O.ID = C.ID
- <where>
- LENGTH( C.ID ) = 12
- <if test="adCode != null and adCode != ''">AND O.OBJ_AD_CODE LIKE '${adCode}%'</if>
- <if test="orgId != null and orgId != '' ">
- AND C.ID LIKE '___${orgId}%'
- </if>
- <if test="objType != null and objType != '' ">
- and to_number(C.ID) LIKE '${objType}%'
- </if>
- <if test="sttm != null and sttm != '' ">
- and C.STTM >= to_date(#{sttm}, 'yyyy-MM-dd')
- </if>
- <if test="entm != null and entm != '' ">
- and C.INTM < to_date(#{entm}, 'yyyy-MM-dd') + 1
- </if>
- </where>
- </select>
- <select id="getBisInspAllRlationPerNumSize" resultType="java.util.Map">
- SELECT count(AA.PERSID) PERNUMSIZE FROM (
- SELECT B.ID, B.PERSID
- FROM BIS_INSP_ALL_RLATION B
- JOIN BIS_INSP_ALL C ON B.ID = C.ID
- JOIN BIS_INSP_ALL_RLATION_PERS P ON P.GUID = B.PERSID
- JOIN (select * FROM ATT_INSP_TYPE where code IN (select INSP_TYPE FROM REL_ORG_INSP_TYPE
- <where>
- <if test="orgId != null and orgId != '' ">
- AND ORG_ID = #{orgId}
- </if>
- </where>
- )) T ON SUBSTR(C.ID, 1, 3) = T.CODE
- LEFT JOIN BIS_INSP_ALL_OBJ O ON O.ID = C.ID
- <where>
- LENGTH( C.ID ) = 12
- <if test="adCode != null and adCode != ''">AND O.OBJ_AD_CODE LIKE '${adCode}%'</if>
- <if test="orgId != null and orgId != '' ">
- AND C.ID LIKE '___${orgId}%'
- </if>
- <if test="objType != null and objType != '' ">
- AND to_number(C.ID) LIKE '${objType}%'
- </if>
- <if test="sttm != null and sttm != '' ">
- AND C.STTM >= to_date(#{sttm}, 'yyyy-MM-dd')
- </if>
- <if test="entm != null and entm != '' ">
- AND C.INTM < to_date(#{entm}, 'yyyy-MM-dd') + 1
- </if>
- </where>
- GROUP BY B.ID , B.PERSID
- ) AA
- </select>
- <select id="getBisInspAllRlationPerSizeJicha" resultType="java.util.Map">
- SELECT NVL(COUNT(*),0) PERSIZE
- FROM TAC_INSP_YEAR_BATCH_GROUP_PERS P
- where exists (select *
- from TAC_INSP_YEAR_BATCH y
- JOIN TAC_INSP_YEAR_BATCH_AREA aa ON aa.YEAR_BATCH_ID = y.ID
- where y.id = p.year_batch_id
- <if test="year != null and year != ''">and y.YEAR = #{year}</if>
- <if test="batch != null and batch != ''">and y.BATCH = #{batch}</if>
- <if test="adCode != null and adCode != ''">and aa.AD_CODE LIKE '${adCode}%'</if>
- <if test="province != null and province != ''">and y.PROVINCE LIKE '${province}%'</if>
- )
- AND GROUP_ID IS NOT NULL
- AND GROUP_NM IS NOT NULL
- </select>
- <select id="statisticsBySpecialtyType" resultType="java.util.Map">
- WITH O AS (
- <choose>
- <when test='objType == "8" '>
- SELECT
- DECODE(a.LIST_TYPE, '1', '前期与设计', '2', '建设管理', '3', '计划下达与执行', '4', '资金使用与管理', '5', '工程质量',
- '6','工程安全', '') as NAME, r.AD_CODE as OBJ_AD_CODE, a.LIST_TYPE as "PTYPE", a.INTM as "OBJ_INTM", COUNT(
- a.ID ) PBLM_SIZE
- FROM TAC_INSP_YEAR_BATCH_OBJ O
- LEFT JOIN tac_pawp_rgstr r ON o.ID = r.obj_id
- <!--LEFT JOIN (SELECT * FROM TAC_PROVINCE_PBLM_INFO WHERE STEP_ID = #{lastStepId}) a ON a.rgstr_id = r.id-->
- LEFT JOIN TAC_PBLM_INFO a ON a.rgstr_id = r.id
- <where>
- <if test="year != null and year != ''">and O.YEAR = #{year}</if>
- <if test="batch != null and batch != ''">and O.BATCH = #{batch}</if>
- </where>
- GROUP BY a.list_type, r.AD_CODE, A.INTM
- </when>
- <otherwise>
- SELECT
- A.NAME,
- <!-- 把福建省福州市下的平潭县 提到到平潭综合实验区 -->
- <!-- 把山东省莱芜市下的市辖区、莱芜区 归属到济南市莱芜区,钢城区 归属到济南市的钢城区, -->
- ( case when SUBSTR(O.OBJ_AD_CODE, 0, 6) = '350128' then '351000000000' when SUBSTR(O.OBJ_AD_CODE, 0, 6) = '371201' then '370116000000' when SUBSTR(O.OBJ_AD_CODE, 0, 6) = '371202' then '370116000000' when SUBSTR(O.OBJ_AD_CODE, 0, 6) = '371203' then '370117000000' else O.OBJ_AD_CODE end) as OBJ_AD_CODE ,
- O.PTYPE,
- COUNT( P.PBLM_ID ) PBLM_SIZE
- FROM
- BIS_INSP_ALL_OBJ O
- JOIN (select * FROM ATT_INSP_TYPE where code IN (select INSP_TYPE FROM REL_ORG_INSP_TYPE
- <where>
- <if test='orgId != null and orgId != "" '>
- AND ORG_ID = #{orgId}
- </if>
- </where>
- )) A ON A.PTYPE = O.PTYPE
- JOIN BIS_INSP_PBLM P ON P.OBJ_ID = O.OBJ_ID
- <where>
- <if test="orgId != null and orgId != '' ">AND O.ID LIKE '___${orgId}%'</if>
- <if test="objType != null and objType != ''">and O.PTYPE = #{objType}</if>
- <if test="sttm != null and sttm != '' and entm != null and entm != '' ">
- and O.OBJ_INTM >= to_date(#{sttm}, 'yyyy-MM-dd')
- and O.OBJ_INTM < to_date(#{entm}, 'yyyy-MM-dd') + 1
- </if>
- </where>
- GROUP BY A.NAME,O.OBJ_AD_CODE, O.PTYPE
- </otherwise>
- </choose>
- )
- SELECT
- PTYPE, NAME, SUM(PBLM_SIZE) AS "VALUE"
- FROM O
- WHERE name is not null
- <if test="adCode != null and adCode != ''">and OBJ_AD_CODE LIKE '${adCode}%'</if>
- GROUP BY PTYPE, NAME
- ORDER BY TO_NUMBER(PTYPE)
- </select>
- <!-- 福建省督查首页 统计 督查类型 查询 -->
- <select id="statisticsFjIndexBySpecialtyType" resultType="java.util.Map">
- WITH O AS (
- SELECT
- A.NAME,
- <!-- 把福建省福州市下的平潭县 提到到平潭综合实验区 -->
- <!-- 把山东省莱芜市下的市辖区、莱芜区 归属到济南市莱芜区,钢城区 归属到济南市的钢城区, -->
- ( case when SUBSTR(O.OBJ_AD_CODE, 0, 6) = '350128' then '351000000000' when SUBSTR(O.OBJ_AD_CODE, 0, 6) = '371201' then '370116000000' when SUBSTR(O.OBJ_AD_CODE, 0, 6) = '371202' then '370116000000' when SUBSTR(O.OBJ_AD_CODE, 0, 6) = '371203' then '370117000000' else O.OBJ_AD_CODE end) as OBJ_AD_CODE ,
- O.PTYPE,
- COUNT( P.PBLM_ID ) PBLM_SIZE
- FROM
- BIS_INSP_ALL_OBJ O
- JOIN (select * FROM ATT_INSP_TYPE where code IN (select INSP_TYPE FROM REL_ORG_INSP_TYPE
- <where>
- <if test='orgId != null and orgId != "" '>
- AND ORG_ID = #{orgId}
- </if>
- </where>
- )) A ON A.PTYPE = O.PTYPE
- JOIN BIS_INSP_PBLM P ON P.OBJ_ID = O.OBJ_ID
- <where>
- <if test="orgId != null and orgId != '' ">AND O.ID LIKE '___${orgId}%'</if>
- <if test="objType != null and objType != ''">and O.PTYPE = #{objType}</if>
- <if test="sttm != null and sttm != '' and entm != null and entm != '' ">
- and O.OBJ_INTM >= to_date(#{sttm}, 'yyyy-MM-dd')
- and O.OBJ_INTM < to_date(#{entm}, 'yyyy-MM-dd') + 1
- </if>
- </where>
- GROUP BY A.NAME,O.OBJ_AD_CODE, O.PTYPE
- )
- SELECT
- PTYPE, NAME
- FROM O
- WHERE name is not null
- <if test="adCode != null and adCode != ''">and OBJ_AD_CODE LIKE '${adCode}%'</if>
- GROUP BY PTYPE, NAME
- ORDER BY TO_NUMBER(PTYPE)
- </select>
- <!-- 福建省首页 按 督查类别 问题类别进行 统计 -->
- <select id="statisticsByPblmType" resultType="java.util.Map">
- SELECT
- PTYPE, NAME, PBLMNAME, SUM(PBLM_SIZE) AS "VALUE"
- FROM (
- SELECT
- A.NAME,
- <!-- 把福建省福州市下的平潭县 提到到平潭综合实验区 -->
- <!-- 把山东省莱芜市下的市辖区、莱芜区 归属到济南市莱芜区,钢城区 归属到济南市的钢城区, -->
- ( case when SUBSTR(O.OBJ_AD_CODE, 0, 6) = '350128' then '351000000000' when SUBSTR(O.OBJ_AD_CODE, 0, 6) = '371201' then '370116000000' when SUBSTR(O.OBJ_AD_CODE, 0, 6) = '371202' then '370116000000' when SUBSTR(O.OBJ_AD_CODE, 0, 6) = '371203' then '370117000000' else O.OBJ_AD_CODE end) as OBJ_AD_CODE ,
- O.PTYPE,
- COUNT(P.PBLM_ID ) PBLM_SIZE,
- (CASE WHEN P.PBLM_NAME_BZ IS NULL THEN P.INSP_PBLM_NAME ELSE P.PBLM_NAME_BZ END) AS "PBLMNAME"
- FROM
- BIS_INSP_ALL_OBJ O
- JOIN (select * FROM ATT_INSP_TYPE where code IN (select INSP_TYPE FROM REL_ORG_INSP_TYPE
- <where>
- <if test='orgId != null and orgId != "" '>
- AND ORG_ID = #{orgId}
- </if>
- </where>
- )) A ON A.PTYPE = O.PTYPE
- JOIN BIS_INSP_PBLM P ON P.OBJ_ID = O.OBJ_ID
- <where>
- <if test="orgId != null and orgId != '' ">AND O.ID LIKE '___${orgId}%'</if>
- <if test="objType != null and objType != ''">and O.PTYPE = #{objType}</if>
- <if test="sttm != null and sttm != '' and entm != null and entm != '' ">
- and O.OBJ_INTM >= to_date(#{sttm}, 'yyyy-MM-dd')
- and O.OBJ_INTM < to_date(#{entm}, 'yyyy-MM-dd') + 1
- </if>
- </where>
- GROUP BY A.NAME,O.OBJ_AD_CODE, O.PTYPE,
- (CASE WHEN P.PBLM_NAME_BZ IS NULL THEN P.INSP_PBLM_NAME ELSE P.PBLM_NAME_BZ END)
- ) O
- WHERE name is not null
- <if test="adCode != null and adCode != ''">and OBJ_AD_CODE LIKE '${adCode}%'</if>
- GROUP BY PTYPE, NAME, PBLMNAME
- ORDER BY TO_NUMBER(PTYPE)
- </select>
- <!-- 福建省督查首页 统计年度的批次 组数 每年1条记录 -->
- <select id="selectBatchAndGroupSize" resultType="java.util.Map">
- SELECT SUM(NVL(yi.YEAR_BATH,0) ) AS "YEARBATHSIZE", SUM(NVL(yi.YEAR_GROUP,0)) AS "YEARGROUPSIZE"
- FROM (select TO_NUMBER(#{year}) as YEAR from dual ) y
- LEFT JOIN (
- select * from BIS_INSP_YEAR_INFO
- <where>
- <if test="year != null and year != ''">and YEAR = TO_NUMBER(#{year})</if>
- <if test="batch != null and batch != ''">and YEAR_BATH = TO_NUMBER(#{batch})</if>
- <if test="adCode != null and adCode != '' ">AND AD_CODE LIKE CONCAT(#{adCode}, '%')</if>
- </where>
- ) yi ON yi.YEAR = y.YEAR
- GROUP BY y.YEAR
- </select>
- <select id="statisticsByEngType" resultType="java.util.Map">
- WITH O AS (
- SELECT B.TYPE AS "NAME",
- R.AD_CODE AS OBJ_AD_CODE,
- A.INTM AS "OBJ_INTM",
- COUNT(A.ID) PBLM_SIZE
- FROM TAC_INSP_YEAR_BATCH_OBJ O
- LEFT JOIN TAC_ATT_PAWP_BASE B ON B.ID = O.OJB_ID
- LEFT JOIN TAC_PAWP_RGSTR R ON O.ID = R.OBJ_ID
- LEFT JOIN (SELECT * FROM TAC_PROVINCE_PBLM_INFO) A ON A.RGSTR_ID = R.ID
- <where>
- <if test="year != null and year != ''">and O.YEAR = #{year}</if>
- <if test="batch != null and batch != ''">and O.BATCH = #{batch}</if>
- </where>
- GROUP BY B.TYPE, r.AD_CODE, A.INTM
- )
- SELECT
- NAME, SUM(PBLM_SIZE) AS "VALUE"
- FROM O
- WHERE name is not null
- <if test="adCode != null and adCode != ''">and OBJ_AD_CODE LIKE '${adCode}%'</if>
- <if test="sttm != null and sttm != '' and entm != null and entm != '' ">
- and OBJ_INTM >= to_date(#{sttm}, 'yyyy-MM-dd')
- and OBJ_INTM < to_date(#{entm}, 'yyyy-MM-dd') + 1
- </if>
- GROUP BY NAME
- ORDER BY NAME
- </select>
- <select id="statisticsByResubType" resultType="java.util.Map">
- WITH O AS (
- SELECT
- PS.SYS_TYPE AS "PTYPE",
- PS.SYS_NAME AS "NAME",
- R.AD_CODE AS OBJ_AD_CODE,
- A.INTM AS "OBJ_INTM",
- COUNT(A.ID) PBLM_SIZE
- FROM TAC_INSP_YEAR_BATCH_OBJ O
- LEFT JOIN TAC_ATT_PAWP_BASE B ON B.ID = O.OJB_ID
- LEFT JOIN TAC_PAWP_RGSTR R ON O.ID = R.OBJ_ID
- LEFT JOIN (SELECT * FROM TAC_PROVINCE_PBLM_INFO) A ON A.RGSTR_ID = R.ID
- LEFT JOIN (
- SELECT PS.PBLM_ID,
- DECODE(OS.SYS_TYPE, '101', '100', OS.SYS_TYPE) SYS_TYPE,
- DECODE(OS.SYS_NAME, '-', '其他', NULL, '其他', OS.SYS_NAME) SYS_NAME
- FROM TAC_PBLM_SUBJECT PS
- JOIN TAC_OBJ_SUBJECT OS ON PS.SUB_ID = OS.ID
- ) PS ON PS.PBLM_ID = A.ID
- <where>
- <if test="year != null and year != ''">and O.YEAR = #{year}</if>
- <if test="batch != null and batch != ''">and O.BATCH = #{batch}</if>
- </where>
- GROUP BY PS.SYS_TYPE,PS.SYS_NAME, R.AD_CODE, A.INTM
- )
- SELECT
- PTYPE, NAME, SUM(PBLM_SIZE) AS "VALUE"
- FROM O
- WHERE name is not null
- <if test="adCode != null and adCode != ''">and OBJ_AD_CODE LIKE '${adCode}%'</if>
- <if test="sttm != null and sttm != '' and entm != null and entm != '' ">
- and OBJ_INTM >= to_date(#{sttm}, 'yyyy-MM-dd')
- and OBJ_INTM < to_date(#{entm}, 'yyyy-MM-dd') + 1
- </if>
- GROUP BY PTYPE, NAME
- ORDER BY TO_NUMBER(PTYPE)
- </select>
- <select id="personCount" resultType="java.util.Map">
- select TYPE, GROUP_NAME, count(PERSID) AS VALUE
- from (
- select
- T.NAME AS TYPE, BIA.PNM || '(' || PBIA.PNM || ')' AS GROUP_NAME, T.CODE, BIA.ID, R.PERSID
- from ATT_INSP_TYPE T
- join BIS_INSP_ALL BIA on T.CODE = substr(BIA.ID, 0, 3)
- left join BIS_INSP_ALL_RLATION R on R.ID = BIA.ID
- left join BIS_INSP_ALL PBIA on PBIA.ID = BIA.PID
- where length(BIA.ID) = 12
- <if test="orgId != null and orgId != ''">and BIA.ID like '___${orgId}%'</if>
- <if test="objType != null and objType != ''">and BIA.ID like '${objType}%'</if>
- <if test="sttm != null and sttm != '' and entm != null and entm != '' ">
- and BIA.INTM >= to_date(#{sttm}, 'yyyy-MM-dd')
- and BIA.INTM < to_date(#{entm}, 'yyyy-MM-dd') + 1
- </if>
- )
- group by CODE ,TYPE, ID, GROUP_NAME
- ORDER BY CODE, ID
- </select>
- <select id="getZgSize" resultType="java.util.Map">
- select nvl(count(pl.id),0) AS "MENDSIZE"
- <!-- 不统计非系统来源整改数 add lxf 2022/11/19 系统来源 数量-->
- ,nvl(count( case when pl.PBLM_ID is not null then pl.PBLM_ID end ),0) as "MENDSIZESYS"
- ,nvl(count( case when pl.PBLM_ID is null then pl.id end ),0) as "MENDSIZENO"
- from BIS_INSP_PBLM_PLIST pl
- <!--湖南省 统计整改数 add lxf 2023/09/20 所有来源 数量-->
- <!-- LEFT JOIN BIS_INSP_PBLM P ON P.PBLM_ID = pl.PBLM_ID-->
- <!-- left join BIS_INSP_ALL_OBJ O ON P.OBJ_ID = O.OBJ_ID-->
- <!-- JOIN (select * FROM ATT_INSP_TYPE where code IN (select INSP_TYPE FROM REL_ORG_INSP_TYPE-->
- <!-- <where>-->
- <!-- <if test='orgId != null and orgId != "" '>-->
- <!-- AND ORG_ID = #{orgId}-->
- <!-- </if>-->
- <!-- </where>-->
- <!-- )) A ON A.PTYPE = O.PTYPE-->
- where pl.DATA_STAT='0'
- and (
- pl.PERS_ID = #{persId}
- OR pl.pblm_classify in (select pblm_classify from bis_insp_pblm_mend_pri where MAND_PERS_ID =#{persId} and
- DATA_STAT='0')
- )
- <if test="province != null and province != '' ">AND pl.OBJ_AD_CODE LIKE CONCAT(#{province}, '%')</if>
- <if test="adCode != null and adCode != '' ">and pl.OBJ_AD_CODE LIKE CONCAT(#{adCode}, '%')</if>
- <if test="objType != null and objType != '' ">and pl.OBJ_TYPE = #{objType}</if>
- <!-- <if test="sttm != null and sttm != '' ">and O.OBJ_INTM >= to_date(#{sttm}, 'yyyy-MM-dd') </if>-->
- <!-- <if test="entm != null and entm != '' ">and O.OBJ_INTM < to_date(#{entm}, 'yyyy-MM-dd') + 1 </if>-->
- <if test="sttm != null and sttm != '' ">and pl.INTM >= to_date(#{sttm}, 'yyyy-MM-dd') </if>
- <if test="entm != null and entm != '' ">and pl.INTM < to_date(#{entm}, 'yyyy-MM-dd') + 1 </if>
- </select>
- <select id="getPdZgSize" resultType="java.util.Map">
- select count(pl.id) AS "PBLMLOGSIZE"
- from BIS_INSP_PBLM_PLIST pl
- <!--湖南省 统计整改数 add lxf 2023/09/20 所有来源 数量-->
- <!-- LEFT JOIN BIS_INSP_PBLM P ON P.PBLM_ID = pl.PBLM_ID-->
- <!-- left join BIS_INSP_ALL_OBJ O ON P.OBJ_ID = O.OBJ_ID-->
- <!-- JOIN (select * FROM ATT_INSP_TYPE where code IN (select INSP_TYPE FROM REL_ORG_INSP_TYPE-->
- <!-- <where>-->
- <!-- <if test='orgId != null and orgId != "" '>-->
- <!-- AND ORG_ID = #{orgId}-->
- <!-- </if>-->
- <!-- </where>-->
- <!-- )) A ON A.PTYPE = O.PTYPE-->
- where pl.DATA_STAT='0'
- AND pl.PBLM_OUT = '1'
- and (
- pl.PERS_ID = #{persId}
- OR pl.pblm_classify in (select pblm_classify from bis_insp_pblm_mend_pri where MAND_PERS_ID =#{persId} and
- DATA_STAT='0')
- )
- <if test="province != null and province != '' ">AND pl.OBJ_AD_CODE LIKE CONCAT(#{province}, '%')</if>
- <if test="adCode != null and adCode != '' ">and pl.OBJ_AD_CODE LIKE CONCAT(#{adCode}, '%')</if>
- <if test="objType != null and objType != '' ">and pl.OBJ_TYPE = #{objType}</if>
- <!-- <if test="sttm != null and sttm != '' ">and O.OBJ_INTM >= to_date(#{sttm}, 'yyyy-MM-dd')</if>-->
- <!-- <if test="entm != null and entm != '' ">and O.OBJ_INTM < to_date(#{entm}, 'yyyy-MM-dd') + 1 </if>-->
- <if test="sttm != null and sttm != '' ">and pl.INTM >= to_date(#{sttm}, 'yyyy-MM-dd')</if>
- <if test="entm != null and entm != '' ">and pl.INTM < to_date(#{entm}, 'yyyy-MM-dd') + 1 </if>
- </select>
- </mapper>
|