TaskDthDayCountDao.xml 53 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="cn.com.goldenwater.dcproj.dao.TaskDthDayCountDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.dto.BisInspTaskTotal" id="BisInspTaskTotalResultMap">
  5. <result property="objSize" column="OBJ_SIZE"/>
  6. <result property="pblmSize" column="PBLM_SIZE"/>
  7. <result property="mendSize" column="MEND_SIZE"/>
  8. <result property="pblmLogSize" column="PBLM_LOG_SIZE"/>
  9. <result property="infoPlbm" column="INFO_PLBM"/>
  10. <result property="warmPlbm" column="WARM_PLBM"/>
  11. <result property="errorPlbm" column="ERROR_PLBM"/>
  12. </resultMap>
  13. <resultMap type="cn.com.goldenwater.dcproj.model.BisInspTaskTypeItemTotal" id="BisInspTaskTypeItemTotalResultMap">
  14. <result property="itemName" column="INSP_PBLM_NAME"/>
  15. <result property="pblmSize" column="PBLM_SIZE"/>
  16. <result property="mendSize" column="MEND_SIZE"/>
  17. <result property="pblmLogSize" column="PBLM_LOG_SIZE"/>
  18. <result property="infoPlbm" column="INFO_PLBM"/>
  19. <result property="warmPlbm" column="WARM_PLBM"/>
  20. <result property="errorPlbm" column="ERROR_PLBM"/>
  21. </resultMap>
  22. <sql id="page_where">
  23. <trim prefix="where" prefixOverrides="and | or ">
  24. <if test="orgId != null and orgId != ''">and ORG_ID = #{orgId}</if>
  25. <if test="adCode != null and adCode != ''">and AD_CODE = #{adCode}</if>
  26. <if test="adName != null and adName != ''">and AD_NAME = #{adName}</if>
  27. <if test="adFullName != null and adFullName != ''">and AD_FULL_NAME = #{adFullName}</if>
  28. <if test="adGrad != null and adGrad != ''">and AD_GRAD = #{adGrad}</if>
  29. <if test="tm != null">and TM = #{tm}</if>
  30. <if test="objType != null and objType != ''">and OBJ_TYPE = #{objType}</if>
  31. <if test="objName != null and objName != ''">and OBJ_NAME = #{objName}</if>
  32. <if test="objSize != null and objSize != ''">and OBJ_SIZE = #{objSize}</if>
  33. <if test="pblmSize != null and pblmSize != ''">and PBLM_SIZE = #{pblmSize}</if>
  34. <if test="mendSize != null and mendSize != ''">and MEND_SIZE = #{mendSize}</if>
  35. <if test="pblmLogSize != null and pblmLogSize != ''">and PBLM_LOG_SIZE = #{pblmLogSize}</if>
  36. <if test="intm != null">and INTM = #{intm}</if>
  37. <if test="uptm != null">and UPTM = #{uptm}</if>
  38. <if test="dataStat != null and dataStat != ''">and DATA_STAT = #{dataStat}</if>
  39. and DATA_STAT='0'
  40. </trim>
  41. </sql>
  42. <select id="getListByTm" resultMap="BisInspTaskTotalResultMap">
  43. select
  44. count(*) OBJ_SIZE
  45. from
  46. BIS_INSP_ALL_OBJ O
  47. <where>
  48. <if test="objType != null and objType != '' ">
  49. and PTYPE = #{objType}
  50. </if>
  51. <if test="stTm != null and stTm != '' ">
  52. and OBJ_INTM &gt;= to_date(#{stTm}, 'yyyy-MM-dd')
  53. </if>
  54. <if test="enTm != null and enTm != '' ">
  55. and OBJ_INTM &lt; to_date(#{enTm}, 'yyyy-MM-dd') + 1
  56. </if>
  57. <if test="adCode != null and adCode != '' ">
  58. and OBJ_AD_CODE like '${adCode}%'
  59. </if>
  60. </where>
  61. </select>
  62. <select id="getListJichaByTm" resultType="cn.com.goldenwater.dcproj.dto.BisInspTaskTotal">
  63. select
  64. count(*) OBJ_SIZE
  65. from
  66. TAC_PAWP_RGSTR O
  67. <where>
  68. DATA_STAT = '0'
  69. <if test="stTm != null and stTm != '' ">
  70. and INTM &gt;= to_date(#{stTm}, 'yyyy-MM-dd')
  71. </if>
  72. <if test="enTm != null and enTm != '' ">
  73. and INTM &lt; to_date(#{enTm}, 'yyyy-MM-dd') + 1
  74. </if>
  75. <if test="adCode != null and adCode != '' ">
  76. and AD_CODE like '${adCode}%'
  77. </if>
  78. </where>
  79. </select>
  80. <select id="getPblmListByTm" resultMap="BisInspTaskTotalResultMap">
  81. SELECT
  82. NVL(COUNT(A.PBLM_ID),0) PBLM_SIZE,
  83. NVL(SUM( CASE A.INSP_PBLM_CATE WHEN '0' THEN 1 ELSE 0 END ), 0) INFO_PLBM,
  84. NVL(SUM( CASE A.INSP_PBLM_CATE WHEN '1' THEN 1 ELSE 0 END ), 0) WARM_PLBM,
  85. NVL(SUM( CASE A.INSP_PBLM_CATE WHEN '2' THEN 1 ELSE 0 END ), 0) ERROR_PLBM,
  86. NVL(SUM( CASE A.INSP_PBLM_CATE WHEN '3' THEN 1 ELSE 0 END ), 0) ERROR_PLBM
  87. FROM BIS_INSP_PBLM A
  88. WHERE a.obj_type = #{objType}
  89. and to_date(to_CHAR(a.coll_time, 'yyyy-MM-dd'), 'yyyy-MM-dd') &gt;= to_date(#{stTm}, 'yyyy-MM-dd')
  90. and to_date(to_CHAR(a.coll_time, 'yyyy-MM-dd'), 'yyyy-MM-dd') &lt; to_date(#{enTm}, 'yyyy-MM-dd') + 1
  91. <if test="adCode != null and adCode != '' ">
  92. and A.OBJ_AD_CODE like '${adCode}%'
  93. </if>
  94. </select>
  95. <select id="getPblmListJichaByTm" resultMap="BisInspTaskTotalResultMap">
  96. SELECT
  97. NVL(COUNT(A.ID),0) PBLM_SIZE,
  98. NVL(SUM( CASE A.PBLM_PASI WHEN '0' THEN 1 ELSE 0 END ), 0) INFO_PLBM,
  99. NVL(SUM( CASE A.PBLM_PASI WHEN '1' THEN 1 ELSE 0 END ), 0) WARM_PLBM,
  100. NVL(SUM( CASE A.PBLM_PASI WHEN '2' THEN 1 ELSE 0 END ), 0) ERROR_PLBM
  101. FROM TAC_PBLM_INFO A
  102. JOIN TAC_PAWP_RGSTR R ON A.RGSTR_ID=R.ID
  103. WHERE
  104. R.DATA_STAT= '0'
  105. AND A.INTM &gt;= TO_DATE(#{STTM}, 'YYYY-MM-DD')
  106. AND A.INTM &lt; TO_DATE(#{ENTM}, 'YYYY-MM-DD') + 1
  107. <if test="adCode != null and adCode != '' ">
  108. and r.AD_CODE like '${adCode}%'
  109. </if>
  110. </select>
  111. <select id="getPblmListTypeByTm" resultMap="BisInspTaskTypeItemTotalResultMap">
  112. SELECT
  113. A.INSP_PBLM_NAME, NVL(COUNT( A.PBLM_ID ),0) PBLM_SIZE, 0 AS "MEND_SIZE", 0 AS "PBLM_LOG_SIZE",
  114. SUM( CASE A.INSP_PBLM_CATE WHEN '0' THEN 1 ELSE 0 END ) INFO_PLBM,
  115. SUM( CASE A.INSP_PBLM_CATE WHEN '1' THEN 1 ELSE 0 END ) WARM_PLBM,
  116. SUM( CASE A.INSP_PBLM_CATE WHEN '2' THEN 1 ELSE 0 END ) ERROR_PLBM
  117. FROM BIS_INSP_PBLM A
  118. WHERE
  119. A.INSP_PBLM_NAME IS NOT NULL
  120. and a.obj_type = #{objType}
  121. and to_date(to_CHAR(a.coll_time, 'yyyy-MM-dd'), 'yyyy-MM-dd') &gt;= to_date(#{stTm}, 'yyyy-MM-dd')
  122. and to_date(to_CHAR(a.coll_time, 'yyyy-MM-dd'), 'yyyy-MM-dd') &lt; to_date(#{enTm}, 'yyyy-MM-dd') + 1
  123. <if test="adCode != null and adCode != '' ">
  124. and A.OBJ_AD_CODE like '${adCode}%'
  125. </if>
  126. GROUP BY INSP_PBLM_NAME
  127. </select>
  128. <select id="getPblmListTypeJichaByTm" resultMap="BisInspTaskTypeItemTotalResultMap">
  129. SELECT
  130. TB.SPFSNL_TYPE, NVL(COUNT( A.ID ),0) PBLM_SIZE, 0 AS "MEND_SIZE", 0 AS "PBLM_LOG_SIZE",
  131. SUM( CASE A.PBLM_PASI WHEN '0' THEN 1 ELSE 0 END ) INFO_PLBM,
  132. SUM( CASE A.PBLM_PASI WHEN '1' THEN 1 ELSE 0 END ) WARM_PLBM,
  133. SUM( CASE A.PBLM_PASI WHEN '2' THEN 1 ELSE 0 END ) ERROR_PLBM
  134. FROM TAC_PBLM_INFO A JOIN TAC_PAWP_RGSTR R ON A.RGSTR_ID=R.ID
  135. LEFT JOIN TAC_OBJ_PBLMSTB TB ON TB.ID = A.PBLMSTD_ID
  136. WHERE
  137. R.DATA_STAT = '0'
  138. AND TB.SPFSNL_TYPE IS NOT NULL
  139. and a.INTM &gt;= to_date(#{stTm}, 'yyyy-MM-dd')
  140. and a.INTM &lt; to_date(#{enTm}, 'yyyy-MM-dd') + 1
  141. <if test="adCode != null and adCode != '' ">
  142. and R.AD_CODE like '${adCode}%'
  143. </if>
  144. GROUP BY TB.SPFSNL_TYPE
  145. </select>
  146. <select id="getPblmListTypeJiChaByTm" resultMap="BisInspTaskTypeItemTotalResultMap">
  147. SELECT
  148. A.*, nvl(B.PBLM_LOG_SIZE, 0) AS "PBLM_LOG_SIZE"
  149. FROM
  150. (
  151. SELECT
  152. A.INSP_PBLM_NAME, nvl(COUNT( A.PBLM_ID ),0) PBLM_SIZE, 0 AS "MEND_SIZE",
  153. SUM( CASE A.INSP_PBLM_CATE WHEN '0' THEN 1 ELSE 0 END ) INFO_PLBM,
  154. SUM( CASE A.INSP_PBLM_CATE WHEN '1' THEN 1 ELSE 0 END ) WARM_PLBM,
  155. SUM( CASE A.INSP_PBLM_CATE WHEN '2' THEN 1 ELSE 0 END ) ERROR_PLBM
  156. FROM BIS_INSP_PBLM A
  157. JOIN BIS_INSP_ALL_OBJ B ON A.OBJ_ID = B.OBJ_ID
  158. WHERE
  159. A.DATA_STAT = '0'
  160. AND A.INSP_PBLM_NAME IS NOT NULL
  161. and to_date(to_CHAR(a.coll_time, 'yyyy-MM-dd'), 'yyyy-MM-dd') &gt;= to_date(#{stTm}, 'yyyy-MM-dd')
  162. and to_date(to_CHAR(a.coll_time, 'yyyy-MM-dd'), 'yyyy-MM-dd') &lt; to_date(#{enTm}, 'yyyy-MM-dd') + 1
  163. <if test="adCode != null and adCode != '' ">
  164. and B.OBJ_AD_CODE like '${adCode}%'
  165. </if>
  166. GROUP BY INSP_PBLM_NAME
  167. ) A
  168. LEFT JOIN (
  169. SELECT
  170. A.INSP_PBLM_NAME, nvl(COUNT( A.PBLM_ID ),0) PBLM_LOG_SIZE
  171. FROM BIS_INSP_PBLM_DEL_LOG A
  172. JOIN BIS_INSP_ALL_OBJ B ON A.OBJ_ID = B.OBJ_ID
  173. WHERE
  174. a.obj_type = '8'
  175. and a.coll_time BETWEEN to_date(#{stTm}, 'yyyy-MM-dd') and to_date(#{enTm}, 'yyyy-MM-dd')
  176. <if test="adCode != null and adCode != '' ">
  177. and B.OBJ_AD_CODE like '${adCode}%'
  178. </if>
  179. GROUP BY A.INSP_PBLM_NAME
  180. ) B ON A.INSP_PBLM_NAME = B.INSP_PBLM_NAME
  181. </select>
  182. <select id="getObjSize" resultType="java.util.Map">
  183. select
  184. nvl(count(*), 0) OBJSIZE
  185. from BIS_INSP_ALL_OBJ O
  186. JOIN (select * FROM ATT_INSP_TYPE where code IN (select INSP_TYPE FROM REL_ORG_INSP_TYPE
  187. <where>
  188. <if test="orgId != null and orgId != '' ">
  189. AND ORG_ID = #{orgId}
  190. </if>
  191. </where>
  192. )) A ON O.PTYPE = A.PTYPE
  193. JOIN BIS_INSP_ALL AL ON O.ID = AL.ID
  194. <where>
  195. <if test="orgId != null and orgId != '' ">AND O.ID LIKE '___${orgId}%'</if>
  196. <if test="province != null and province != '' ">AND O.OBJ_AD_CODE LIKE CONCAT(#{province}, '%')</if>
  197. <if test="adCode != null and adCode != '' ">and O.OBJ_AD_CODE LIKE CONCAT(#{adCode}, '%')</if>
  198. <!-- 福建省 福州市排除 平潭县 把平潭县 归属到 平潭综合实验区-->
  199. <if test='adCode != null and adCode == "3501" '>AND SUBSTR(O.OBJ_AD_CODE, 0, 6) !='350128'</if>
  200. <if test='adCode != null and adCode == "3510" '>AND SUBSTR(O.OBJ_AD_CODE, 0, 6) ='350128'</if>
  201. <if test="objType != null and objType != '' ">and O.PTYPE = #{objType}</if>
  202. <if test="sttm != null and sttm != '' ">and O.OBJ_INTM &gt;= to_date(#{sttm}, 'yyyy-MM-dd')</if>
  203. <if test="entm != null and entm != '' ">and O.OBJ_INTM &lt; to_date(#{entm}, 'yyyy-MM-dd') + 1</if>
  204. </where>
  205. </select>
  206. <!-- lxf 2022/11/22 督查对象重复数量 -->
  207. <select id="getObjSizeRepeat" resultType="java.util.Map">
  208. select
  209. <!-- 统计督查对象 重复数量 add lxf 2022/11/19 -->
  210. nvl(count(*), 0) OBJSIZEREPEAT
  211. from BIS_INSP_ALL_OBJ O
  212. JOIN (select * FROM ATT_INSP_TYPE where code IN (select INSP_TYPE FROM REL_ORG_INSP_TYPE
  213. <where>
  214. <if test="orgId != null and orgId != '' ">
  215. AND ORG_ID = #{orgId}
  216. </if>
  217. </where>
  218. )) A ON O.PTYPE = A.PTYPE
  219. where O.code IN ( SELECT biaoin.code FROM BIS_INSP_ALL_OBJ biaoin
  220. <where>
  221. <if test="orgId != null and orgId != '' ">AND biaoin.ID LIKE '___${orgId}%'</if>
  222. <if test="province != null and province != '' ">AND biaoin.OBJ_AD_CODE LIKE CONCAT(#{province}, '%')</if>
  223. <if test="adCode != null and adCode != '' ">and biaoin.OBJ_AD_CODE LIKE CONCAT(#{adCode}, '%')</if>
  224. <!-- 福建省 福州市排除 平潭县 把平潭县 归属到 平潭综合实验区-->
  225. <if test='adCode != null and adCode == "3501" '>AND SUBSTR(biaoin.OBJ_AD_CODE, 0, 6) !='350128'</if>
  226. <if test='adCode != null and adCode == "3510" '>AND SUBSTR(biaoin.OBJ_AD_CODE, 0, 6) ='350128'</if>
  227. <if test="objType != null and objType != '' ">and biaoin.PTYPE = #{objType}</if>
  228. <if test="sttm != null and sttm != '' ">and biaoin.OBJ_INTM &gt;= to_date(#{sttm}, 'yyyy-MM-dd')</if>
  229. <if test="entm != null and entm != '' ">and biaoin.OBJ_INTM &lt; to_date(#{entm}, 'yyyy-MM-dd') + 1</if>
  230. <if test="orgId != null and orgId != '' ">
  231. AND biaoin.ORG_ID = #{orgId}
  232. </if>
  233. <if test='adCode != null and adCode != "" '> AND biaoin.OBJ_AD_CODE like '${adCode}%'</if>
  234. </where>
  235. GROUP BY biaoin.code, biaoin.PTYPE HAVING count( biaoin.code ) > 1
  236. )
  237. </select>
  238. <select id="getPblmSize" resultType="java.util.Map">
  239. WITH O AS (
  240. SELECT
  241. A.NAME,O.OBJ_AD_CODE, O.PTYPE,
  242. nvl(COUNT(distinct P.PBLM_ID ),0) PBLM_SIZE,
  243. <!-- 查询确认问题数量 数据状态0:暂存;1:已提交;2:已上报;3:退回;4:审核定稿;5:审办;6:整改通知;7:整改反馈;8:销号;9:删除; -->
  244. NVL(SUM( CASE WHEN P.STATE = '2' THEN 1 ELSE 0 END ), 0 ) SUBMIT_PLBM
  245. FROM
  246. BIS_INSP_ALL_OBJ O
  247. JOIN (select * FROM ATT_INSP_TYPE where code IN (select INSP_TYPE FROM REL_ORG_INSP_TYPE
  248. <where>
  249. <if test='orgId != null and orgId != "" '>
  250. AND ORG_ID = #{orgId}
  251. </if>
  252. </where>
  253. )) A ON A.PTYPE = O.PTYPE
  254. JOIN BIS_INSP_PBLM P ON P.OBJ_ID = O.OBJ_ID
  255. <where>
  256. <if test="orgId != null and orgId != '' ">O.ID LIKE '___${orgId}%'</if>
  257. <if test="sttm != null and sttm != '' ">and O.OBJ_INTM &gt;= to_date(#{sttm}, 'yyyy-MM-dd')</if>
  258. <if test="entm != null and entm != '' ">and O.OBJ_INTM &lt; to_date(#{entm}, 'yyyy-MM-dd') + 1</if>
  259. </where>
  260. GROUP BY A.NAME,O.OBJ_AD_CODE, O.PTYPE
  261. )
  262. SELECT
  263. NVL(SUM(PBLM_SIZE),0) PBLMSIZE,
  264. NVL(SUM(SUBMIT_PLBM),0) SUBMITPLBM
  265. FROM O
  266. <where>
  267. <if test="adCode != null and adCode != '' ">AND OBJ_AD_CODE LIKE CONCAT(#{adCode}, '%')</if>
  268. <!-- 福建省 福州市排除 平潭县 把平潭县 归属到 平潭综合实验区-->
  269. <if test='adCode != null and adCode == "3501" '>AND SUBSTR(OBJ_AD_CODE, 0, 6) !='350128'</if>
  270. <if test='adCode != null and adCode == "3510" '>AND SUBSTR(OBJ_AD_CODE, 0, 6) ='350128'</if>
  271. <if test="province != null and province != '' ">AND OBJ_AD_CODE LIKE CONCAT(#{province}, '%')</if>
  272. <if test="objType != null and objType != '' ">AND PTYPE = #{objType}</if>
  273. </where>
  274. </select>
  275. <select id="getDelPblmSize" resultType="java.util.Map">
  276. SELECT
  277. nvl(COUNT(A.PBLM_ID), 0) pblmLogSize
  278. FROM
  279. BIS_INSP_PBLM_DEL_LOG A
  280. JOIN
  281. BIS_INSP_ALL_OBJ B ON A.OBJ_ID=B.OBJ_ID
  282. <where>
  283. <if test="adCode != null and adCode != '' ">
  284. substr(b.OBJ_AD_CODE,0,2)=#{adCode}
  285. </if>
  286. </where>
  287. </select>
  288. <select id="getObjTypeSize" resultType="java.util.Map">
  289. select nvl(count(*), 0) objTypeSize
  290. from REL_ORG_INSP_TYPE
  291. <where>
  292. <if test="orgId != null and orgId != '' ">
  293. ORG_ID = #{orgId}
  294. </if>
  295. </where>
  296. </select>
  297. <select id="getAllObjSize" resultType="java.util.Map">
  298. select count(1) ALLOBJSIZE from (
  299. SELECT ptype FROM BIS_INSP_ALL_OBJ
  300. <where>
  301. <if test="adCode != null and adCode != '' ">
  302. OBJ_AD_CODE like '${adCode}%'
  303. </if>
  304. <if test="objType != null and objType != '' ">
  305. and PTYPE = #{objType}
  306. </if>
  307. <if test="sttm != null and sttm != '' ">
  308. and OBJ_INTM &gt;= to_date(#{sttm}, 'yyyy-MM-dd')
  309. </if>
  310. <if test="entm != null and entm != '' ">
  311. and OBJ_INTM &lt; to_date(#{entm}, 'yyyy-MM-dd') + 1
  312. </if>
  313. </where> group by ptype)
  314. </select>
  315. <select id="getObjAdCodeSizeS" resultType="java.util.Map">
  316. select sum(AD_CODE_SIZE_S) OBJADCODESIZES from (
  317. SELECT
  318. count(distinct(substr(ad_code,0,6))) AD_CODE_SIZE_S
  319. FROM
  320. (
  321. SELECT OBJ_NAME,
  322. AD_CODE,
  323. 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
  324. FROM (
  325. SELECT
  326. AIT.NAME AS OBJ_NAME,
  327. <!-- 把福建省福州市下的平潭县 提到到平潭综合实验区 -->
  328. <!-- 把山东省莱芜市下的市辖区、莱芜区 归属到济南市莱芜区,钢城区 归属到济南市的钢城区, -->
  329. ( 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,
  330. O.PTYPE as OBJ_TYPE,
  331. COUNT( DISTINCT O.OBJ_ID ) OBJ_SIZE,
  332. COUNT(DISTINCT case when P.PBLM_ID is not null then P.PBLM_ID end ) PBLM_SIZE,
  333. NVL( SUM( CASE WHEN P.STATE = '2' THEN 1 ELSE 0 END ), 0 ) SUBMIT_PLBM,
  334. NVL( SUM( CASE P.INSP_PBLM_CATE WHEN '0' THEN 1 ELSE 0 END ), 0 ) INFO_PLBM,
  335. NVL( SUM( CASE P.INSP_PBLM_CATE WHEN '1' THEN 1 ELSE 0 END ), 0 ) WARM_PLBM,
  336. NVL( SUM( CASE P.INSP_PBLM_CATE WHEN '2' THEN 1 ELSE 0 END ), 0 ) ERROR_PLBM,
  337. NVL( SUM( CASE P.INSP_PBLM_CATE WHEN '3' THEN 1 ELSE 0 END ), 0 ) ERRORS_PLBM,
  338. NVL( SUM( CASE PL.PBLM_OUT WHEN '1' THEN 1 ELSE 0 END ), 0 ) PBLM_LOG_SIZE,
  339. NVL( COUNT(DISTINCT CASE when PL.PBLM_ID is not null then P.PBLM_ID end ), 0 ) MEND_SIZE,
  340. count(distinct(o.id)) GROUP_SIZE,
  341. SUM(( SELECT COUNT(DISTINCT(TT.PERSID)) FROM BIS_INSP_ALL_RLATION TT WHERE TT.ID = O.ID) )PERS_SIZE
  342. FROM
  343. BIS_INSP_ALL_OBJ O
  344. JOIN (select * FROM ATT_INSP_TYPE where code IN (select INSP_TYPE FROM REL_ORG_INSP_TYPE
  345. <where>
  346. <if test='orgId != null and orgId != "" '>
  347. AND ORG_ID = #{orgId}
  348. </if>
  349. </where>
  350. )) AIT ON AIT.PTYPE = O.PTYPE
  351. LEFT JOIN BIS_INSP_PBLM P ON P.OBJ_ID = O.OBJ_ID
  352. LEFT JOIN BIS_INSP_PBLM_PLIST Pl ON PL.PBLM_ID = P.PBLM_ID and PL.DATA_STAT='0'
  353. <where>
  354. <if test="objType != null and objType != ''">and O.PTYPE = #{objType}</if>
  355. <if test="orgId != null and orgId != ''">AND O.ID LIKE '___${orgId}%'</if>
  356. <if test="sttm != null and sttm != '' and entm != null and entm != '' ">
  357. and O.OBJ_INTM &gt;= TO_DATE(#{sttm}, 'YYYY-MM-DD') and O.OBJ_INTM &lt; TO_DATE(#{entm}, 'YYYY-MM-DD') +1
  358. </if>
  359. </where>
  360. GROUP BY AIT.NAME,O.OBJ_AD_CODE, O.PTYPE
  361. ) o
  362. <where>
  363. <if test="adCode != null and adCode != ''">and o.AD_CODE LIKE '${adCode}%'</if>
  364. </where>
  365. ) T
  366. GROUP BY T.OBJ_NAME, T.OBJ_TYPE
  367. ORDER BY TO_NUMBER(T.OBJ_TYPE))
  368. <!--select count(1) OBJADCODESIZES FROM (
  369. select substr(OBJ_AD_CODE,1,4) from BIS_INSP_ALL_OBJ
  370. <where>
  371. <if test="adCode != null and adCode != '' ">
  372. and OBJ_AD_CODE like '${adCode}%'
  373. </if>
  374. <if test="objType != null and objType != '' ">
  375. and PTYPE = #{objType}
  376. </if>
  377. <if test="sttm != null and sttm != '' ">
  378. and OBJ_INTM &gt;= to_date(#{sttm}, 'yyyy-MM-dd')
  379. </if>
  380. <if test="entm != null and entm != '' ">
  381. and OBJ_INTM &lt; to_date(#{entm}, 'yyyy-MM-dd') + 1
  382. </if>
  383. and substr(OBJ_AD_CODE,3,2) &lt;&gt;'00'
  384. </where>
  385. GROUP BY substr(OBJ_AD_CODE,1,4) )-->
  386. </select>
  387. <select id="getObjAdCodeSizeX" resultType="java.util.Map">
  388. select sum(AD_CODE_SIZE_X) OBJADCODESIZEX from (
  389. SELECT
  390. count(distinct(substr(AD_CODE,0,6))) AD_CODE_SIZE_X
  391. FROM
  392. (
  393. SELECT OBJ_NAME,
  394. AD_CODE,
  395. 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
  396. FROM (
  397. SELECT
  398. AIT.NAME AS OBJ_NAME,
  399. <!-- 把福建省福州市下的平潭县 提到到平潭综合实验区 -->
  400. <!-- 把山东省莱芜市下的市辖区、莱芜区 归属到济南市莱芜区,钢城区 归属到济南市的钢城区, -->
  401. ( 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,
  402. O.PTYPE as OBJ_TYPE,
  403. COUNT( DISTINCT O.OBJ_ID ) OBJ_SIZE,
  404. COUNT(DISTINCT case when P.PBLM_ID is not null then P.PBLM_ID end ) PBLM_SIZE,
  405. NVL( SUM( CASE WHEN P.STATE = '2' THEN 1 ELSE 0 END ), 0 ) SUBMIT_PLBM,
  406. NVL( SUM( CASE P.INSP_PBLM_CATE WHEN '0' THEN 1 ELSE 0 END ), 0 ) INFO_PLBM,
  407. NVL( SUM( CASE P.INSP_PBLM_CATE WHEN '1' THEN 1 ELSE 0 END ), 0 ) WARM_PLBM,
  408. NVL( SUM( CASE P.INSP_PBLM_CATE WHEN '2' THEN 1 ELSE 0 END ), 0 ) ERROR_PLBM,
  409. NVL( SUM( CASE P.INSP_PBLM_CATE WHEN '3' THEN 1 ELSE 0 END ), 0 ) ERRORS_PLBM,
  410. NVL( SUM( CASE PL.PBLM_OUT WHEN '1' THEN 1 ELSE 0 END ), 0 ) PBLM_LOG_SIZE,
  411. NVL( COUNT(DISTINCT CASE when PL.PBLM_ID is not null then P.PBLM_ID end ), 0 ) MEND_SIZE,
  412. count(distinct(o.id)) GROUP_SIZE,
  413. SUM(( SELECT COUNT(DISTINCT(TT.PERSID)) FROM BIS_INSP_ALL_RLATION TT WHERE TT.ID = O.ID) )PERS_SIZE
  414. FROM
  415. BIS_INSP_ALL_OBJ O
  416. JOIN (select * FROM ATT_INSP_TYPE where code IN (select INSP_TYPE FROM REL_ORG_INSP_TYPE
  417. <where>
  418. <if test='orgId != null and orgId != "" '>
  419. AND ORG_ID = #{orgId}
  420. </if>
  421. </where>
  422. )) AIT ON AIT.PTYPE = O.PTYPE
  423. LEFT JOIN BIS_INSP_PBLM P ON P.OBJ_ID = O.OBJ_ID
  424. LEFT JOIN BIS_INSP_PBLM_PLIST Pl ON PL.PBLM_ID = P.PBLM_ID and PL.DATA_STAT='0'
  425. <where>
  426. <if test="objType != null and objType != ''">and O.PTYPE = #{objType}</if>
  427. <if test="orgId != null and orgId != ''">AND O.ID LIKE '___${orgId}%'</if>
  428. <if test="sttm != null and sttm != '' and entm != null and entm != '' ">
  429. and O.OBJ_INTM &gt;= TO_DATE(#{sttm}, 'YYYY-MM-DD') and O.OBJ_INTM &lt; TO_DATE(#{entm}, 'YYYY-MM-DD') +1
  430. </if>
  431. </where>
  432. GROUP BY AIT.NAME,O.OBJ_AD_CODE, O.PTYPE
  433. ) o
  434. <where>
  435. <if test="adCode != null and adCode != ''">and o.AD_CODE LIKE '${adCode}%'</if>
  436. </where>
  437. ) T
  438. GROUP BY T.OBJ_NAME, T.OBJ_TYPE
  439. ORDER BY TO_NUMBER(T.OBJ_TYPE))
  440. <!--select count(1) OBJADCODESIZEX FROM (
  441. select substr(OBJ_AD_CODE,1,6) from BIS_INSP_ALL_OBJ <where>
  442. <if test="adCode != null and adCode != '' ">
  443. and OBJ_AD_CODE like '${adCode}%'
  444. </if>
  445. <if test="objType != null and objType != '' ">
  446. and PTYPE = #{objType}
  447. </if>
  448. <if test="sttm != null and sttm != '' ">
  449. and OBJ_INTM &gt;= to_date(#{sttm}, 'yyyy-MM-dd')
  450. </if>
  451. <if test="entm != null and entm != '' ">
  452. and OBJ_INTM &lt; to_date(#{entm}, 'yyyy-MM-dd') + 1
  453. </if>
  454. and substr(OBJ_AD_CODE,3,2) &lt;&gt;'00'
  455. and substr(OBJ_AD_CODE,5,2) &lt;&gt; '00'
  456. </where>GROUP BY substr(OBJ_AD_CODE,1,6) )-->
  457. </select>
  458. <select id="getHasObjSize" resultType="java.util.Map">
  459. SELECT count(DISTINCT O.OBJ_ID) hasObjSize
  460. FROM (
  461. SELECT * FROM BIS_INSP_ALL_OBJ
  462. <where>
  463. <if test="province != null and province != '' ">AND OBJ_AD_CODE LIKE CONCAT(#{province}, '%')</if>
  464. <if test="adCode != null and adCode != '' ">
  465. and OBJ_AD_CODE like '${adCode}%'
  466. </if>
  467. <if test="objType != null and objType != '' ">
  468. and PTYPE = #{objType}
  469. </if>
  470. <if test="sttm != null and sttm != '' ">
  471. and OBJ_INTM &gt;= to_date(#{sttm}, 'yyyy-MM-dd')
  472. </if>
  473. <if test="entm != null and entm != '' ">
  474. and OBJ_INTM &lt; to_date(#{entm}, 'yyyy-MM-dd') + 1
  475. </if>
  476. </where>
  477. ) O
  478. RIGHT JOIN (
  479. <foreach collection="rgsterTable" index="index" item="item">
  480. <if test="index != 0">
  481. UNION ALL
  482. </if>
  483. <choose>
  484. <when test="item == 'BIS_INSP_GRW' ">
  485. SELECT OBJ_ID, INSP_STATE AS "STATE" FROM BIS_INSP_GRW WHERE INSP_STATE = '2'
  486. </when>
  487. <otherwise>
  488. SELECT OBJ_ID, STATE FROM ${item} WHERE STATE = '2'
  489. </otherwise>
  490. </choose>
  491. </foreach>
  492. ) R ON R.OBJ_ID = o.OBJ_ID
  493. </select>
  494. <select id="getObjTypeSizeMonth" resultType="java.util.Map">
  495. select nvl(count(DISTINCT PTYPE), 0) objTypeSizeMonth
  496. from BIS_INSP_ALL_OBJ
  497. where
  498. OBJ_INTM between to_date(to_CHAR(sysdate-30,'yyyy-MM-dd'),'yyyy-mm-dd') and sysdate
  499. <if test="orgId != null and orgId != '' ">
  500. AND ORG_ID = #{orgId}
  501. </if>
  502. <if test="adCode != null and adCode != ''">AND OBJ_AD_CODE LIKE '${adCode}%'</if>
  503. </select>
  504. <select id="getPblmSizeMonth" resultType="java.util.Map">
  505. SELECT
  506. nvl(COUNT(A.PBLM_ID), 0) pblmSizeMonth
  507. FROM
  508. BIS_INSP_PBLM A
  509. JOIN
  510. BIS_INSP_ALL_OBJ B ON A.OBJ_ID=B.OBJ_ID
  511. WHERE
  512. A.DATA_STAT= '0'
  513. AND A.coll_time between to_date(to_CHAR(sysdate-30, 'yyyy-MM-dd'),'yyyy-mm-dd') and sysdate
  514. <if test="orgId != null and orgId != '' ">AND B.ID LIKE '___${orgId}%'</if>
  515. <if test="adCode != null and adCode != '' ">AND B.OBJ_AD_CODE LIKE CONCAT(#{adCode}, '%')</if>
  516. </select>
  517. <select id="getDelPblmSizeMonth" resultType="java.util.Map">
  518. SELECT
  519. nvl(COUNT(A.PBLM_ID), 0) PBLMLOGSIZEMONTH
  520. FROM BIS_INSP_PBLM_DEL_LOG A
  521. JOIN BIS_INSP_ALL_OBJ B ON A.OBJ_ID=B.OBJ_ID
  522. WHERE A.PBLM_DEL_TM between to_date(to_CHAR(sysdate-30, 'yyyy-MM-dd'),'yyyy-mm-dd') and sysdate
  523. <if test="orgId != null and orgId != '' ">AND B.ID LIKE '___${orgId}%'</if>
  524. <if test="adCode != null and adCode != '' ">AND B.OBJ_AD_CODE LIKE CONCAT(#{adCode}, '%')</if>
  525. </select>
  526. <select id="getObjSizeJicha" resultType="java.util.Map">
  527. SELECT
  528. nvl(COUNT( DISTINCT r.id ), 0) objSize
  529. FROM TAC_INSP_YEAR_BATCH_OBJ O
  530. JOIN tac_pawp_rgstr r on o.ID = r.obj_id
  531. <where>
  532. <if test="year != null and year != ''">and O.YEAR = #{year}</if>
  533. <if test="batch != null and batch != ''">and O.BATCH = #{batch}</if>
  534. <if test="adCode != null and adCode != ''">and r.AD_CODE LIKE '${adCode}%'</if>
  535. <if test="province != null and province != ''">and r.PROVINCE LIKE '${province}%'</if>
  536. </where>
  537. </select>
  538. <select id="getPblmSizeJicha" resultType="java.util.Map">
  539. WITH O AS (
  540. SELECT
  541. DECODE(a.LIST_TYPE, '1', '前期与设计', '2', '建设管理', '3', '计划下达与执行', '4', '资金使用与管理', '5', '工程质量管理-工程实体质量',
  542. '6','安全管理', '') as NAME, r.AD_CODE as OBJ_AD_CODE, '8' as "PTYPE", a.INTM as "OBJ_INTM", COUNT( a.ID )
  543. PBLM_SIZE
  544. FROM TAC_INSP_YEAR_BATCH_OBJ O
  545. LEFT JOIN tac_pawp_rgstr r ON o.ID = r.obj_id
  546. <!--LEFT JOIN (SELECT * FROM TAC_PROVINCE_PBLM_INFO WHERE STEP_ID = #{lastStepId}) a ON a.rgstr_id = r.id-->
  547. LEFT JOIN (SELECT * FROM TAC_PBLM_INFO ) a ON a.rgstr_id = r.id
  548. <where>
  549. <if test="year != null and year != ''">and O.YEAR = #{year}</if>
  550. <if test="batch != null and batch != ''">and O.BATCH = #{batch}</if>
  551. </where>
  552. GROUP BY a.list_type, r.AD_CODE, A.INTM
  553. )
  554. SELECT
  555. NVL(SUM(PBLM_SIZE), 0) AS pblmSize
  556. FROM O
  557. <where>
  558. <if test="adCode != null and adCode != ''">OBJ_AD_CODE LIKE '${adCode}%'</if>
  559. </where>
  560. </select>
  561. <select id="getPblmSizeJichaZg" resultType="java.util.Map">
  562. WITH O AS (
  563. SELECT
  564. DECODE(a.LIST_TYPE, '1', '前期与设计', '2', '建设管理', '3', '计划下达与执行', '4', '资金使用与管理', '5', '工程质量管理-工程实体质量',
  565. '6','安全管理', '') as NAME, r.AD_CODE as OBJ_AD_CODE, '8' as "PTYPE", a.INTM as "OBJ_INTM", COUNT( a.ID )
  566. PBLM_SIZE
  567. FROM TAC_INSP_YEAR_BATCH_OBJ O
  568. LEFT JOIN tac_pawp_rgstr r ON o.ID = r.obj_id
  569. LEFT JOIN (SELECT * FROM TAC_PROVINCE_PBLM_MEND_INFO WHERE STEP_ID = #{lastStepId} and CRT_STATE='1') a ON
  570. a.rgstr_id = r.id
  571. <where>
  572. <if test="year != null and year != ''">and O.YEAR = #{year}</if>
  573. <if test="batch != null and batch != ''">and O.BATCH = #{batch}</if>
  574. </where>
  575. GROUP BY a.list_type, r.AD_CODE, A.INTM
  576. )
  577. SELECT
  578. NVL(SUM(PBLM_SIZE), 0) AS MENDSIZE
  579. FROM O
  580. <where>
  581. <if test="adCode != null and adCode != ''">OBJ_AD_CODE LIKE '${adCode}%'</if>
  582. </where>
  583. </select>
  584. <select id="getPblmSizeJichaFc" resultType="java.util.Map">
  585. WITH O AS (
  586. SELECT
  587. DECODE(a.LIST_TYPE, '1', '前期与设计', '2', '建设管理', '3', '计划下达与执行', '4', '资金使用与管理', '5', '工程质量管理-工程实体质量',
  588. '6','安全管理', '') as NAME, r.AD_CODE as OBJ_AD_CODE, '8' as "PTYPE", a.INTM as "OBJ_INTM", COUNT( a.ID )
  589. PBLM_SIZE
  590. FROM TAC_INSP_YEAR_BATCH_OBJ O
  591. LEFT JOIN tac_pawp_rgstr r ON o.ID = r.obj_id
  592. LEFT JOIN (SELECT * FROM TAC_PROVINCE_PBLM_MEND_INFO WHERE STEP_ID = #{lastStepId} and pblm_out='1') a ON
  593. a.rgstr_id = r.id
  594. <where>
  595. <if test="year != null and year != ''">and O.YEAR = #{year}</if>
  596. <if test="batch != null and batch != ''">and O.BATCH = #{batch}</if>
  597. </where>
  598. GROUP BY a.list_type, r.AD_CODE, A.INTM
  599. )
  600. SELECT
  601. NVL(SUM(PBLM_SIZE), 0) AS PBLMLOGSIZE
  602. FROM O
  603. <where>
  604. <if test="adCode != null and adCode != ''">OBJ_AD_CODE LIKE '${adCode}%'</if>
  605. </where>
  606. </select>
  607. <select id="getHasObjSizeJicha" resultType="java.util.Map">
  608. SELECT count(DISTINCT O.OBJ_ID) hasObjSize
  609. FROM (
  610. SELECT * FROM BIS_INSP_ALL_OBJ
  611. <where>
  612. PTYPE = '8'
  613. <if test="adCode != null and adCode != '' ">
  614. and OBJ_AD_CODE like '${adCode}%'
  615. </if>
  616. </where>
  617. ) O
  618. LEFT JOIN (
  619. <foreach collection="rgsterTable" index="index" item="item">
  620. <if test="index != 0">
  621. UNION ALL
  622. </if>
  623. <choose>
  624. <when test="item == 'BIS_INSP_GRW' ">
  625. SELECT OBJ_ID, INSP_STATE AS "STATE" FROM BIS_INSP_GRW WHERE INSP_STATE = '2'
  626. </when>
  627. <otherwise>
  628. SELECT OBJ_ID, STATE FROM ${item} WHERE STATE = '2'
  629. </otherwise>
  630. </choose>
  631. </foreach>
  632. ) r ON r.OBJ_ID = o.OBJ_ID
  633. </select>
  634. <select id="getBisInspAllSize" resultType="java.util.Map">
  635. select NVL(count(*),0) as BISINSPALLSIZE from BIS_INSP_ALL A
  636. JOIN (select * FROM ATT_INSP_TYPE where code IN (select INSP_TYPE FROM REL_ORG_INSP_TYPE
  637. <where>
  638. <if test="orgId != null and orgId != '' ">
  639. AND ORG_ID = #{orgId}
  640. </if>
  641. </where>
  642. )) T ON substr(A.ID,1,3) = T.CODE
  643. <where>
  644. LENGTH(A.ID) = 9
  645. <if test="orgId != null and orgId != '' ">AND A.ID LIKE '___${orgId}%'</if>
  646. <if test="province != null and province != '' ">AND A.PROVINCE LIKE CONCAT(#{province}, '%')</if>
  647. <if test="objType != null and objType != '' ">and A.ID LIKE concat(#{objType},'%')</if>
  648. <if test="sttm != null and sttm != '' ">and A.STTM &gt;= to_date(#{sttm}, 'yyyy-MM-dd')</if>
  649. <if test="entm != null and entm != '' ">and A.INTM &lt; to_date(#{entm}, 'yyyy-MM-dd') + 1</if>
  650. </where>
  651. </select>
  652. <select id="getBisInspAllGroupSize" resultType="java.util.Map">
  653. SELECT COUNT(DISTINCT C.ID) BISINSPALLGROUPSIZE
  654. FROM BIS_INSP_ALL C
  655. JOIN (select * FROM ATT_INSP_TYPE where code IN (select INSP_TYPE FROM REL_ORG_INSP_TYPE
  656. <where>
  657. <if test="orgId != null and orgId != '' ">
  658. AND ORG_ID = #{orgId}
  659. </if>
  660. </where>
  661. )) T ON SUBSTR(C.ID, 0, 3) = T.CODE
  662. LEFT JOIN BIS_INSP_ALL_OBJ O ON O.ID = C.ID
  663. WHERE LENGTH(C.ID) = '12'
  664. <if test="adCode != null and adCode != ''">AND O.OBJ_AD_CODE LIKE '${adCode}%'</if>
  665. <if test="orgId != null and orgId != '' ">
  666. AND C.ID LIKE '___${orgId}%'
  667. </if>
  668. <if test="objType != null and objType != '' ">
  669. and to_number(C.ID) LIKE '${objType}%'
  670. </if>
  671. <if test="sttm != null and sttm != '' ">
  672. and C.STTM &gt;= to_date(#{sttm}, 'yyyy-MM-dd')
  673. </if>
  674. <if test="entm != null and entm != '' ">
  675. and C.STTM &lt; to_date(#{entm}, 'yyyy-MM-dd') + 1
  676. </if>
  677. </select>
  678. <select id="getBisInspAllGroupSizeJicha" resultType="java.util.Map">
  679. SELECT nvl(COUNT(*),0) GROUPSIZE
  680. FROM TAC_INSP_YEAR_BATCH_GROUP g
  681. where exists (select *
  682. from TAC_INSP_YEAR_BATCH y
  683. JOIN TAC_INSP_YEAR_BATCH_AREA aa ON aa.YEAR_BATCH_ID = y.ID
  684. where y.id = g.year_batch_id
  685. <if test="year != null and year != ''">and y.YEAR = #{year}</if>
  686. <if test="batch != null and batch != ''">and y.BATCH = #{batch}</if>
  687. <if test="adCode != null and adCode != ''">and aa.AD_CODE LIKE '${adCode}%'</if>
  688. <if test="province != null and province != ''">and y.PROVINCE LIKE '${province}%'</if>
  689. )
  690. </select>
  691. <select id="getBisInspAllSizeMonth" resultType="java.util.Map">
  692. SELECT NVL(COUNT(distinct C.ID),0) BISINSPALLSIZEMONTH
  693. FROM BIS_INSP_ALL C
  694. LEFT JOIN BIS_INSP_ALL_OBJ O ON O.ID = C.ID
  695. WHERE LENGTH(C.ID) = '9'
  696. and C.INTM between to_date(to_CHAR(sysdate-30, 'yyyy-MM-dd'),'yyyy-mm-dd') and sysdate
  697. <if test="orgId != null and orgId != '' ">
  698. AND C.ID LIKE '___${orgId}%'
  699. </if>
  700. <if test="adCode != null and adCode != ''">AND O.OBJ_AD_CODE LIKE '${adCode}%'</if>
  701. </select>
  702. <!-- 统计 全部人员数量 -->
  703. <select id="getAllPerSize" resultType="java.util.Map">
  704. select NVL( count( DISTINCT rp.guid) ,0) as PERSIZEALL
  705. FROM BIS_INSP_ALL_RLATION_PERS rp,
  706. Bis_Insp_Pers_Org g
  707. WHERE rp.guid = g.pers_id
  708. and g.org_id in (
  709. select o.org_id from bis_insp_org o
  710. <!-- 当前登录人 所在行政区划 -->
  711. where o.ad_code LIKE CONCAT(#{province}, '%' )
  712. <!-- 选择的行政区划-->
  713. <if test='adCode != null and adCode != "" '>
  714. AND o.ad_code LIKE CONCAT(#{adCode}, '%' )
  715. </if>
  716. )
  717. </select>
  718. <select id="getBisInspAllRlationPerSize" resultType="java.util.Map">
  719. SELECT NVL(COUNT(DISTINCT B.PERSID),0) PERSIZE
  720. FROM BIS_INSP_ALL_RLATION B
  721. JOIN BIS_INSP_ALL C ON B.ID = C.ID
  722. JOIN BIS_INSP_ALL_RLATION_PERS P ON P.GUID = B.PERSID
  723. JOIN (select * FROM ATT_INSP_TYPE where code IN (select INSP_TYPE FROM REL_ORG_INSP_TYPE
  724. <where>
  725. <if test="orgId != null and orgId != '' ">
  726. AND ORG_ID = #{orgId}
  727. </if>
  728. </where>
  729. )) T ON SUBSTR(C.ID, 0, 3) = T.CODE
  730. LEFT JOIN BIS_INSP_ALL_OBJ O ON O.ID = C.ID
  731. <where>
  732. LENGTH( C.ID ) = 12
  733. <if test="adCode != null and adCode != ''">AND O.OBJ_AD_CODE LIKE '${adCode}%'</if>
  734. <if test="orgId != null and orgId != '' ">
  735. AND C.ID LIKE '___${orgId}%'
  736. </if>
  737. <if test="objType != null and objType != '' ">
  738. and to_number(C.ID) LIKE '${objType}%'
  739. </if>
  740. <if test="sttm != null and sttm != '' ">
  741. and C.STTM &gt;= to_date(#{sttm}, 'yyyy-MM-dd')
  742. </if>
  743. <if test="entm != null and entm != '' ">
  744. and C.INTM &lt; to_date(#{entm}, 'yyyy-MM-dd') + 1
  745. </if>
  746. </where>
  747. </select>
  748. <select id="getBisInspAllRlationPerNumSize" resultType="java.util.Map">
  749. SELECT count(AA.PERSID) PERNUMSIZE FROM (
  750. SELECT B.ID, B.PERSID
  751. FROM BIS_INSP_ALL_RLATION B
  752. JOIN BIS_INSP_ALL C ON B.ID = C.ID
  753. JOIN BIS_INSP_ALL_RLATION_PERS P ON P.GUID = B.PERSID
  754. JOIN (select * FROM ATT_INSP_TYPE where code IN (select INSP_TYPE FROM REL_ORG_INSP_TYPE
  755. <where>
  756. <if test="orgId != null and orgId != '' ">
  757. AND ORG_ID = #{orgId}
  758. </if>
  759. </where>
  760. )) T ON SUBSTR(C.ID, 1, 3) = T.CODE
  761. LEFT JOIN BIS_INSP_ALL_OBJ O ON O.ID = C.ID
  762. <where>
  763. LENGTH( C.ID ) = 12
  764. <if test="adCode != null and adCode != ''">AND O.OBJ_AD_CODE LIKE '${adCode}%'</if>
  765. <if test="orgId != null and orgId != '' ">
  766. AND C.ID LIKE '___${orgId}%'
  767. </if>
  768. <if test="objType != null and objType != '' ">
  769. AND to_number(C.ID) LIKE '${objType}%'
  770. </if>
  771. <if test="sttm != null and sttm != '' ">
  772. AND C.STTM &gt;= to_date(#{sttm}, 'yyyy-MM-dd')
  773. </if>
  774. <if test="entm != null and entm != '' ">
  775. AND C.INTM &lt; to_date(#{entm}, 'yyyy-MM-dd') + 1
  776. </if>
  777. </where>
  778. GROUP BY B.ID , B.PERSID
  779. ) AA
  780. </select>
  781. <select id="getBisInspAllRlationPerSizeJicha" resultType="java.util.Map">
  782. SELECT NVL(COUNT(*),0) PERSIZE
  783. FROM TAC_INSP_YEAR_BATCH_GROUP_PERS P
  784. where exists (select *
  785. from TAC_INSP_YEAR_BATCH y
  786. JOIN TAC_INSP_YEAR_BATCH_AREA aa ON aa.YEAR_BATCH_ID = y.ID
  787. where y.id = p.year_batch_id
  788. <if test="year != null and year != ''">and y.YEAR = #{year}</if>
  789. <if test="batch != null and batch != ''">and y.BATCH = #{batch}</if>
  790. <if test="adCode != null and adCode != ''">and aa.AD_CODE LIKE '${adCode}%'</if>
  791. <if test="province != null and province != ''">and y.PROVINCE LIKE '${province}%'</if>
  792. )
  793. AND GROUP_ID IS NOT NULL
  794. AND GROUP_NM IS NOT NULL
  795. </select>
  796. <select id="statisticsBySpecialtyType" resultType="java.util.Map">
  797. WITH O AS (
  798. <choose>
  799. <when test='objType == "8" '>
  800. SELECT
  801. DECODE(a.LIST_TYPE, '1', '前期与设计', '2', '建设管理', '3', '计划下达与执行', '4', '资金使用与管理', '5', '工程质量',
  802. '6','工程安全', '') as NAME, r.AD_CODE as OBJ_AD_CODE, a.LIST_TYPE as PTYPE, a.INTM as OBJ_INTM, COUNT(
  803. a.ID ) PBLM_SIZE
  804. FROM TAC_INSP_YEAR_BATCH_OBJ O
  805. LEFT JOIN tac_pawp_rgstr r ON o.ID = r.obj_id
  806. <!--LEFT JOIN (SELECT * FROM TAC_PROVINCE_PBLM_INFO WHERE STEP_ID = #{lastStepId}) a ON a.rgstr_id = r.id-->
  807. LEFT JOIN TAC_PBLM_INFO a ON a.rgstr_id = r.id
  808. <where>
  809. <if test="year != null and year != ''">and O.YEAR = #{year}</if>
  810. <if test="batch != null and batch != ''">and O.BATCH = #{batch}</if>
  811. </where>
  812. GROUP BY a.list_type, r.AD_CODE, A.INTM
  813. </when>
  814. <otherwise>
  815. SELECT
  816. A.NAME,
  817. <!-- 把福建省福州市下的平潭县 提到到平潭综合实验区 -->
  818. <!-- 把山东省莱芜市下的市辖区、莱芜区 归属到济南市莱芜区,钢城区 归属到济南市的钢城区, -->
  819. ( 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 ,
  820. O.PTYPE,
  821. COUNT( P.PBLM_ID ) PBLM_SIZE
  822. FROM
  823. BIS_INSP_ALL_OBJ O
  824. JOIN (select * FROM ATT_INSP_TYPE where code IN (select INSP_TYPE FROM REL_ORG_INSP_TYPE
  825. <where>
  826. <if test='orgId != null and orgId != "" '>
  827. AND ORG_ID = #{orgId}
  828. </if>
  829. </where>
  830. )) A ON A.PTYPE = O.PTYPE
  831. JOIN BIS_INSP_PBLM P ON P.OBJ_ID = O.OBJ_ID
  832. <where>
  833. <if test="orgId != null and orgId != '' ">AND O.ID LIKE '___${orgId}%'</if>
  834. <if test="objType != null and objType != ''">and O.PTYPE = #{objType}</if>
  835. <if test="sttm != null and sttm != '' and entm != null and entm != '' ">
  836. and O.OBJ_INTM &gt;= to_date(#{sttm}, 'yyyy-MM-dd')
  837. and O.OBJ_INTM &lt; to_date(#{entm}, 'yyyy-MM-dd') + 1
  838. </if>
  839. </where>
  840. GROUP BY A.NAME,O.OBJ_AD_CODE, O.PTYPE
  841. </otherwise>
  842. </choose>
  843. )
  844. SELECT
  845. PTYPE, NAME, SUM(PBLM_SIZE) AS VALUE
  846. FROM O
  847. WHERE name is not null
  848. <if test="adCode != null and adCode != ''">and OBJ_AD_CODE LIKE '${adCode}%'</if>
  849. GROUP BY PTYPE, NAME
  850. ORDER BY TO_NUMBER(PTYPE)
  851. </select>
  852. <!-- 福建省督查首页 统计 督查类型 查询 -->
  853. <select id="statisticsFjIndexBySpecialtyType" resultType="java.util.Map">
  854. WITH O AS (
  855. SELECT
  856. A.NAME,
  857. <!-- 把福建省福州市下的平潭县 提到到平潭综合实验区 -->
  858. <!-- 把山东省莱芜市下的市辖区、莱芜区 归属到济南市莱芜区,钢城区 归属到济南市的钢城区, -->
  859. ( 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 ,
  860. O.PTYPE,
  861. COUNT( P.PBLM_ID ) PBLM_SIZE
  862. FROM
  863. BIS_INSP_ALL_OBJ O
  864. JOIN (select * FROM ATT_INSP_TYPE where code IN (select INSP_TYPE FROM REL_ORG_INSP_TYPE
  865. <where>
  866. <if test='orgId != null and orgId != "" '>
  867. AND ORG_ID = #{orgId}
  868. </if>
  869. </where>
  870. )) A ON A.PTYPE = O.PTYPE
  871. JOIN BIS_INSP_PBLM P ON P.OBJ_ID = O.OBJ_ID
  872. <where>
  873. <if test="orgId != null and orgId != '' ">AND O.ID LIKE '___${orgId}%'</if>
  874. <if test="objType != null and objType != ''">and O.PTYPE = #{objType}</if>
  875. <if test="sttm != null and sttm != '' and entm != null and entm != '' ">
  876. and O.OBJ_INTM &gt;= to_date(#{sttm}, 'yyyy-MM-dd')
  877. and O.OBJ_INTM &lt; to_date(#{entm}, 'yyyy-MM-dd') + 1
  878. </if>
  879. </where>
  880. GROUP BY A.NAME,O.OBJ_AD_CODE, O.PTYPE
  881. )
  882. SELECT
  883. PTYPE, NAME
  884. FROM O
  885. WHERE name is not null
  886. <if test="adCode != null and adCode != ''">and OBJ_AD_CODE LIKE '${adCode}%'</if>
  887. GROUP BY PTYPE, NAME
  888. ORDER BY TO_NUMBER(PTYPE)
  889. </select>
  890. <!-- 福建省首页 按 督查类别 问题类别进行 统计 -->
  891. <select id="statisticsByPblmType" resultType="java.util.Map">
  892. SELECT
  893. PTYPE, NAME, PBLMNAME, SUM(PBLM_SIZE) AS "VALUE"
  894. FROM (
  895. SELECT
  896. A.NAME,
  897. <!-- 把福建省福州市下的平潭县 提到到平潭综合实验区 -->
  898. <!-- 把山东省莱芜市下的市辖区、莱芜区 归属到济南市莱芜区,钢城区 归属到济南市的钢城区, -->
  899. ( 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 ,
  900. O.PTYPE,
  901. COUNT(P.PBLM_ID ) PBLM_SIZE,
  902. (CASE WHEN P.PBLM_NAME_BZ IS NULL THEN P.INSP_PBLM_NAME ELSE P.PBLM_NAME_BZ END) AS "PBLMNAME"
  903. FROM
  904. BIS_INSP_ALL_OBJ O
  905. JOIN (select * FROM ATT_INSP_TYPE where code IN (select INSP_TYPE FROM REL_ORG_INSP_TYPE
  906. <where>
  907. <if test='orgId != null and orgId != "" '>
  908. AND ORG_ID = #{orgId}
  909. </if>
  910. </where>
  911. )) A ON A.PTYPE = O.PTYPE
  912. JOIN BIS_INSP_PBLM P ON P.OBJ_ID = O.OBJ_ID
  913. <where>
  914. <if test="orgId != null and orgId != '' ">AND O.ID LIKE '___${orgId}%'</if>
  915. <if test="objType != null and objType != ''">and O.PTYPE = #{objType}</if>
  916. <if test="sttm != null and sttm != '' and entm != null and entm != '' ">
  917. and O.OBJ_INTM &gt;= to_date(#{sttm}, 'yyyy-MM-dd')
  918. and O.OBJ_INTM &lt; to_date(#{entm}, 'yyyy-MM-dd') + 1
  919. </if>
  920. </where>
  921. GROUP BY A.NAME,O.OBJ_AD_CODE, O.PTYPE,
  922. (CASE WHEN P.PBLM_NAME_BZ IS NULL THEN P.INSP_PBLM_NAME ELSE P.PBLM_NAME_BZ END)
  923. ) O
  924. WHERE name is not null
  925. <if test="adCode != null and adCode != ''">and OBJ_AD_CODE LIKE '${adCode}%'</if>
  926. GROUP BY PTYPE, NAME, PBLMNAME
  927. ORDER BY TO_NUMBER(PTYPE)
  928. </select>
  929. <!-- 福建省督查首页 统计年度的批次 组数 每年1条记录 -->
  930. <select id="selectBatchAndGroupSize" resultType="java.util.Map">
  931. SELECT SUM(NVL(yi.YEAR_BATH,0) ) AS "YEARBATHSIZE", SUM(NVL(yi.YEAR_GROUP,0)) AS "YEARGROUPSIZE"
  932. FROM (select TO_NUMBER(#{year}) as YEAR from dual ) y
  933. LEFT JOIN (
  934. select * from BIS_INSP_YEAR_INFO
  935. <where>
  936. <if test="year != null and year != ''">and YEAR = TO_NUMBER(#{year})</if>
  937. <if test="batch != null and batch != ''">and YEAR_BATH = TO_NUMBER(#{batch})</if>
  938. <if test="adCode != null and adCode != '' ">AND AD_CODE LIKE CONCAT(#{adCode}, '%')</if>
  939. </where>
  940. ) yi ON yi.YEAR = y.YEAR
  941. GROUP BY y.YEAR
  942. </select>
  943. <select id="statisticsByEngType" resultType="java.util.Map">
  944. WITH O AS (
  945. SELECT B.TYPE AS "NAME",
  946. R.AD_CODE AS OBJ_AD_CODE,
  947. A.INTM AS "OBJ_INTM",
  948. COUNT(A.ID) PBLM_SIZE
  949. FROM TAC_INSP_YEAR_BATCH_OBJ O
  950. LEFT JOIN TAC_ATT_PAWP_BASE B ON B.ID = O.OJB_ID
  951. LEFT JOIN TAC_PAWP_RGSTR R ON O.ID = R.OBJ_ID
  952. LEFT JOIN (SELECT * FROM TAC_PROVINCE_PBLM_INFO) A ON A.RGSTR_ID = R.ID
  953. <where>
  954. <if test="year != null and year != ''">and O.YEAR = #{year}</if>
  955. <if test="batch != null and batch != ''">and O.BATCH = #{batch}</if>
  956. </where>
  957. GROUP BY B.TYPE, r.AD_CODE, A.INTM
  958. )
  959. SELECT
  960. NAME, SUM(PBLM_SIZE) AS "VALUE"
  961. FROM O
  962. WHERE name is not null
  963. <if test="adCode != null and adCode != ''">and OBJ_AD_CODE LIKE '${adCode}%'</if>
  964. <if test="sttm != null and sttm != '' and entm != null and entm != '' ">
  965. and OBJ_INTM &gt;= to_date(#{sttm}, 'yyyy-MM-dd')
  966. and OBJ_INTM &lt; to_date(#{entm}, 'yyyy-MM-dd') + 1
  967. </if>
  968. GROUP BY NAME
  969. ORDER BY NAME
  970. </select>
  971. <select id="statisticsByResubType" resultType="java.util.Map">
  972. WITH O AS (
  973. SELECT
  974. PS.SYS_TYPE AS "PTYPE",
  975. PS.SYS_NAME AS "NAME",
  976. R.AD_CODE AS OBJ_AD_CODE,
  977. A.INTM AS "OBJ_INTM",
  978. COUNT(A.ID) PBLM_SIZE
  979. FROM TAC_INSP_YEAR_BATCH_OBJ O
  980. LEFT JOIN TAC_ATT_PAWP_BASE B ON B.ID = O.OJB_ID
  981. LEFT JOIN TAC_PAWP_RGSTR R ON O.ID = R.OBJ_ID
  982. LEFT JOIN (SELECT * FROM TAC_PROVINCE_PBLM_INFO) A ON A.RGSTR_ID = R.ID
  983. LEFT JOIN (
  984. SELECT PS.PBLM_ID,
  985. DECODE(OS.SYS_TYPE, '101', '100', OS.SYS_TYPE) SYS_TYPE,
  986. DECODE(OS.SYS_NAME, '-', '其他', NULL, '其他', OS.SYS_NAME) SYS_NAME
  987. FROM TAC_PBLM_SUBJECT PS
  988. JOIN TAC_OBJ_SUBJECT OS ON PS.SUB_ID = OS.ID
  989. ) PS ON PS.PBLM_ID = A.ID
  990. <where>
  991. <if test="year != null and year != ''">and O.YEAR = #{year}</if>
  992. <if test="batch != null and batch != ''">and O.BATCH = #{batch}</if>
  993. </where>
  994. GROUP BY PS.SYS_TYPE,PS.SYS_NAME, R.AD_CODE, A.INTM
  995. )
  996. SELECT
  997. PTYPE, NAME, SUM(PBLM_SIZE) AS "VALUE"
  998. FROM O
  999. WHERE name is not null
  1000. <if test="adCode != null and adCode != ''">and OBJ_AD_CODE LIKE '${adCode}%'</if>
  1001. <if test="sttm != null and sttm != '' and entm != null and entm != '' ">
  1002. and OBJ_INTM &gt;= to_date(#{sttm}, 'yyyy-MM-dd')
  1003. and OBJ_INTM &lt; to_date(#{entm}, 'yyyy-MM-dd') + 1
  1004. </if>
  1005. GROUP BY PTYPE, NAME
  1006. ORDER BY TO_NUMBER(PTYPE)
  1007. </select>
  1008. <select id="personCount" resultType="java.util.Map">
  1009. select TYPE, GROUP_NAME, count(PERSID) AS VALUE
  1010. from (
  1011. select
  1012. T.NAME AS TYPE, BIA.PNM || '(' || PBIA.PNM || ')' AS GROUP_NAME, T.CODE, BIA.ID, R.PERSID
  1013. from ATT_INSP_TYPE T
  1014. join BIS_INSP_ALL BIA on T.CODE = substr(BIA.ID, 0, 3)
  1015. left join BIS_INSP_ALL_RLATION R on R.ID = BIA.ID
  1016. left join BIS_INSP_ALL PBIA on PBIA.ID = BIA.PID
  1017. where length(BIA.ID) = 12
  1018. <if test="orgId != null and orgId != ''">and BIA.ID like '___${orgId}%'</if>
  1019. <if test="objType != null and objType != ''">and BIA.ID like '${objType}%'</if>
  1020. <if test="sttm != null and sttm != '' and entm != null and entm != '' ">
  1021. and BIA.INTM &gt;= to_date(#{sttm}, 'yyyy-MM-dd')
  1022. and BIA.INTM &lt; to_date(#{entm}, 'yyyy-MM-dd') + 1
  1023. </if>
  1024. )
  1025. group by CODE ,TYPE, ID, GROUP_NAME
  1026. ORDER BY CODE, ID
  1027. </select>
  1028. <select id="getZgSize" resultType="java.util.Map">
  1029. select nvl(count(pl.id),0) AS "MENDSIZE"
  1030. <!-- 不统计非系统来源整改数 add lxf 2022/11/19 系统来源 数量-->
  1031. ,nvl(count( case when pl.PBLM_ID is not null then pl.PBLM_ID end ),0) as "MENDSIZESYS"
  1032. ,nvl(count( case when pl.PBLM_ID is null then pl.id end ),0) as "MENDSIZENO"
  1033. from BIS_INSP_PBLM_PLIST pl
  1034. <!--湖南省 统计整改数 add lxf 2023/09/20 所有来源 数量-->
  1035. <!-- LEFT JOIN BIS_INSP_PBLM P ON P.PBLM_ID = pl.PBLM_ID-->
  1036. <!-- left join BIS_INSP_ALL_OBJ O ON P.OBJ_ID = O.OBJ_ID-->
  1037. <!-- JOIN (select * FROM ATT_INSP_TYPE where code IN (select INSP_TYPE FROM REL_ORG_INSP_TYPE-->
  1038. <!-- <where>-->
  1039. <!-- <if test='orgId != null and orgId != "" '>-->
  1040. <!-- AND ORG_ID = #{orgId}-->
  1041. <!-- </if>-->
  1042. <!-- </where>-->
  1043. <!-- )) A ON A.PTYPE = O.PTYPE-->
  1044. where pl.DATA_STAT='0'
  1045. and (
  1046. pl.PERS_ID = #{persId}
  1047. OR pl.pblm_classify in (select pblm_classify from bis_insp_pblm_mend_pri where MAND_PERS_ID =#{persId} and
  1048. DATA_STAT='0')
  1049. )
  1050. <if test="province != null and province != '' ">AND pl.OBJ_AD_CODE LIKE CONCAT(#{province}, '%')</if>
  1051. <if test="adCode != null and adCode != '' ">and pl.OBJ_AD_CODE LIKE CONCAT(#{adCode}, '%')</if>
  1052. <if test="objType != null and objType != '' ">and pl.OBJ_TYPE = #{objType}</if>
  1053. <!-- <if test="sttm != null and sttm != '' ">and O.OBJ_INTM &gt;= to_date(#{sttm}, 'yyyy-MM-dd') </if>-->
  1054. <!-- <if test="entm != null and entm != '' ">and O.OBJ_INTM &lt; to_date(#{entm}, 'yyyy-MM-dd') + 1 </if>-->
  1055. <if test="sttm != null and sttm != '' ">and pl.INTM &gt;= to_date(#{sttm}, 'yyyy-MM-dd') </if>
  1056. <if test="entm != null and entm != '' ">and pl.INTM &lt; to_date(#{entm}, 'yyyy-MM-dd') + 1 </if>
  1057. </select>
  1058. <select id="getPdZgSize" resultType="java.util.Map">
  1059. select count(pl.id) AS "PBLMLOGSIZE"
  1060. from BIS_INSP_PBLM_PLIST pl
  1061. <!--湖南省 统计整改数 add lxf 2023/09/20 所有来源 数量-->
  1062. <!-- LEFT JOIN BIS_INSP_PBLM P ON P.PBLM_ID = pl.PBLM_ID-->
  1063. <!-- left join BIS_INSP_ALL_OBJ O ON P.OBJ_ID = O.OBJ_ID-->
  1064. <!-- JOIN (select * FROM ATT_INSP_TYPE where code IN (select INSP_TYPE FROM REL_ORG_INSP_TYPE-->
  1065. <!-- <where>-->
  1066. <!-- <if test='orgId != null and orgId != "" '>-->
  1067. <!-- AND ORG_ID = #{orgId}-->
  1068. <!-- </if>-->
  1069. <!-- </where>-->
  1070. <!-- )) A ON A.PTYPE = O.PTYPE-->
  1071. where pl.DATA_STAT='0'
  1072. AND pl.PBLM_OUT = '1'
  1073. and (
  1074. pl.PERS_ID = #{persId}
  1075. OR pl.pblm_classify in (select pblm_classify from bis_insp_pblm_mend_pri where MAND_PERS_ID =#{persId} and
  1076. DATA_STAT='0')
  1077. )
  1078. <if test="province != null and province != '' ">AND pl.OBJ_AD_CODE LIKE CONCAT(#{province}, '%')</if>
  1079. <if test="adCode != null and adCode != '' ">and pl.OBJ_AD_CODE LIKE CONCAT(#{adCode}, '%')</if>
  1080. <if test="objType != null and objType != '' ">and pl.OBJ_TYPE = #{objType}</if>
  1081. <!-- <if test="sttm != null and sttm != '' ">and O.OBJ_INTM &gt;= to_date(#{sttm}, 'yyyy-MM-dd')</if>-->
  1082. <!-- <if test="entm != null and entm != '' ">and O.OBJ_INTM &lt; to_date(#{entm}, 'yyyy-MM-dd') + 1 </if>-->
  1083. <if test="sttm != null and sttm != '' ">and pl.INTM &gt;= to_date(#{sttm}, 'yyyy-MM-dd')</if>
  1084. <if test="entm != null and entm != '' ">and pl.INTM &lt; to_date(#{entm}, 'yyyy-MM-dd') + 1 </if>
  1085. </select>
  1086. </mapper>