From 486fae71e8e826787a75ed343ec286ca70da51dd Mon Sep 17 00:00:00 2001
From: 陈昶聿 <chychen@nbjetron.com>
Date: 星期三, 18 三月 2026 15:58:12 +0800
Subject: [PATCH] 【丽水】获取当前用户随访数量统计 补充

---
 ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceSubtaskController.java |    2 ++
 smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml                       |    6 ++++++
 2 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceSubtaskController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceSubtaskController.java
index f43a74c..06ae897 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceSubtaskController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceSubtaskController.java
@@ -670,6 +670,8 @@
             List<String> deptCodes = sysUser.getDeptCodes();
             List<String> wardCodes = sysUser.getWardCodes();
             ServiceSubtaskEntity entity = new ServiceSubtaskEntity();
+            entity.setOrgid(sysUser.getOrgid());
+            entity.setDeptcode(sysUser.getDeptCode());
             entity.setLeaveldeptcodes(deptCodes);
             entity.setLeavehospitaldistrictcodes(wardCodes);
             map = serviceSubtaskService.getCurrentUserServiceSubtaskCount(entity);
diff --git a/smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml b/smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml
index f473c9d..10f9bd4 100644
--- a/smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml
@@ -2265,6 +2265,12 @@
         COUNT(*) AS allVisitCount
         FROM service_subtask
         WHERE del_flag = '0'
+        <if test="orgid != null and orgid != ''">
+            AND orgid = #{orgid}
+        </if>
+        <if test="deptcode != null and deptcode != ''">
+            AND deptcode = #{deptcode}
+        </if>
         <if test="leavehospitaldistrictcodes != null and leavehospitaldistrictcodes.size() > 0">
             AND leavehospitaldistrictcode IN
             <foreach collection="leavehospitaldistrictcodes" item="leavehospitaldistrictcode" open="("

--
Gitblit v1.9.3