From 62f265b5f230b199dd82253443e568f80cd5d800 Mon Sep 17 00:00:00 2001
From: tangzy <tangzy123456>
Date: Wed, 18 Aug 2021 11:30:02 +0800
Subject: [PATCH] 1.统计接口调整

---
 src/main/java/org/springblade/modules/information/mapper/InformationMapper.xml |   56 +++++++++++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 47 insertions(+), 9 deletions(-)

diff --git a/src/main/java/org/springblade/modules/information/mapper/InformationMapper.xml b/src/main/java/org/springblade/modules/information/mapper/InformationMapper.xml
index e6b5959..1e16a8e 100644
--- a/src/main/java/org/springblade/modules/information/mapper/InformationMapper.xml
+++ b/src/main/java/org/springblade/modules/information/mapper/InformationMapper.xml
@@ -856,6 +856,7 @@
         SELECT COUNT
         (*) as num,
         d.dept_name,
+        u.real_name,
         j.dept_name AS jurname
         FROM blade_user u
         LEFT JOIN blade_dept d ON d.id = u.dept_id
@@ -873,7 +874,7 @@
         <if test="type!=null and type=='2'">
             and DATE_FORMAT(u.update_time, '%Y%m' ) = DATE_FORMAT( CURDATE( ) , '%Y%m' )
         </if>
-        GROUP BY d.dept_name,
+        GROUP BY d.dept_name,u.real_name,
         j.dept_name
     </select>
     <!--表现差的数量-->
@@ -1160,7 +1161,8 @@
             and J.enterpriseName like concat('%', #{enterpriseName},'%')
         </if>
         GROUP BY J.enterpriseName,
-        J.departmentid, J.cznum, J.ghnum, J.ghnum, J.pcnum, J.sbnum, J.zcnum, J.znum, J.jurname,J.jurisdiction
+        J.departmentid, J.cznum, J.ghnum, J.ghnum, J.pcnum, J.sbnum, J.zcnum, J.znum, J.jurname,J.jurisdiction limit
+        #{current},#{size};
     </select>
 
     <!--公司经济情况进入图表-->
@@ -1214,6 +1216,7 @@
             and J.enterpriseName like concat('%', #{enterpriseName},'%')
         </if>
         GROUP BY J.departmentid, J.enterpriseName, J.jurisdiction, J.jurname, J.pcnum, J.sbcount, J.sbnum, J.zb, J.znum
+        limit #{current},#{size};
     </select>
 
 
@@ -1280,21 +1283,56 @@
         SELECT d.dept_name AS gsname,
         di.dispatcherTime,
         di.end_time,
-        de.dept_name as fwname,
+        u.name AS fwname,
         di.num,
         j.dept_name as jurname
         FROM sys_dispatcher di
         LEFT JOIN blade_dept d ON d.id = di.dept_id
-        LEFT JOIN blade_dept de ON de.id = di.dispatcher_unit_id
+        LEFT JOIN sys_dispatcher_unit u ON u.id = di.dispatcher_unit_id
         LEFT JOIN sys_jurisdiction j ON j.id = di.jurisdiction where 1=1
-        <if test="name!=null and name!=''">
-            and di.dept_name like concat('%', #{name},'%')
-        </if>
+        and di.dept_id=#{deptid}
         <if test="jurisdiction!=null and jurisdiction!=''and jurisdiction!='1123598813738675201'">
             and di.jurisdiction =#{jurisdiction}
         </if>
-        <if test="fwname!=null and name!=''">
-            and de.dept_name like concat('%', #{fwname},'%')
+        <if test="fid!=null and fid!=''">
+            and di.dispatcher_unit_id=#{fid}
         </if>
+        limit #{current},#{size};
+    </select>
+    <!--服务单位下拉-->
+    <select id="selectFw" resultType="java.util.HashMap">
+        SELECT id, name
+        FROM `sys_dispatcher_unit`
+    </select>
+
+    <!--单位处罚数量-->
+    <select id="selectCf" resultType="java.util.HashMap">
+        SELECT COUNT(*) AS num,
+        i.enterpriseName,
+        j.dept_name as jurname,
+        i.departmentid
+        FROM `sys_punish` p
+        LEFT JOIN sys_information i ON i.departmentid = p.deptid
+        LEFT JOIN sys_jurisdiction j ON j.id = p.jurisdiction where 1=1
+        <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1123598813738675201'">
+            and p.jurisdiction =#{jurisdiction}
+        </if>
+        GROUP BY i.enterpriseName, i.departmentid, j.dept_name
+    </select>
+
+    <!--单位材料不全数量-->
+    <select id="selectCl" resultType="java.util.HashMap">
+        SELECT
+        COUNT( * ) AS num,
+        i.enterpriseName,
+        j.dept_name as jurname
+        FROM
+        sys_information i
+        LEFT JOIN sys_jurisdiction j ON j.id=i.jurisdiction WHERE i.creditCode is NULL
+        <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1123598813738675201'">
+            and i.jurisdiction =#{jurisdiction}
+        </if>
+        GROUP BY
+        i.enterpriseName,j.dept_name
     </select>
 </mapper>

--
Gitblit v1.9.3