From 473464d85747da2d549203ad769da4ca9ea867a9 Mon Sep 17 00:00:00 2001
From: tangzy <tangzy123456>
Date: Thu, 25 Nov 2021 14:38:42 +0800
Subject: [PATCH] 1.统计

---
 src/main/java/org/springblade/modules/information/mapper/InformationMapper.xml |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 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 3c9617b..998fa6f 100644
--- a/src/main/java/org/springblade/modules/information/mapper/InformationMapper.xml
+++ b/src/main/java/org/springblade/modules/information/mapper/InformationMapper.xml
@@ -1017,7 +1017,7 @@
         i.departmentid
         FROM
         sys_information i
-        LEFT JOIN sys_jurisdiction j ON j.id= i.jurisdiction where 1=1
+        LEFT JOIN sys_jurisdiction j ON j.id= i.jurisdiction where 1=1 and s.status=0
         <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1372091709474910209'">
             and i.jurisdiction =#{jurisdiction}
         </if>
@@ -1075,7 +1075,7 @@
         u.dept_id
         FROM
         sys_performance p
-        INNER JOIN blade_user u ON p.securityId = u.id WHERE 1=1
+        INNER JOIN blade_user u ON p.cardid = u.cardid WHERE 1=1
         <if test="type!=null and type=='1'.toString()">
             and to_days(p.time) = to_days(now())
         </if>
@@ -1085,9 +1085,11 @@
         GROUP BY
         dept_id
         ) J ON J.dept_id = H.departmentid
-        WHERE 1 = 1
+        LEFT JOIN blade_dept d ON H.departmentid = d.id
+        LEFT JOIN sys_jurisdiction j ON j.id = H.jurisdiction
+        WHERE 1 =1
         <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1372091709474910209'">
-            AND H.jurisdiction in(${jurisdiction})
+            and (j.id = #{jurisdiction} or j.parent_id = #{jurisdiction})
         </if>
         <if test="deptid!=null and deptid!=''">
             AND H.departmentid = #{deptid}
@@ -1196,7 +1198,7 @@
         A.stats,
         j.dept_name AS jurname
         FROM
-        ( SELECT jurisdiction, departmentid,enterpriseName,stats,create_time FROM sys_information where state !=1) A
+        ( SELECT jurisdiction, departmentid,enterpriseName,stats,create_time FROM sys_information where stats !=1) A
         LEFT JOIN (
         SELECT
         J.znum+J.fznum as num,

--
Gitblit v1.9.3