From 8de44bc87172f479b79832535a64584ba0a65d08 Mon Sep 17 00:00:00 2001
From: 陈昶聿 <chychen@nbjetron.com>
Date: 星期三, 18 三月 2026 16:55:11 +0800
Subject: [PATCH] 【丽水】获取当前用户随访数量统计 补充
---
smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml | 35 +++++++++++++++++++++++++++++++++--
1 files changed, 33 insertions(+), 2 deletions(-)
diff --git a/smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml b/smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml
index 0cc9e60..58fa3a5 100644
--- a/smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml
@@ -2090,8 +2090,8 @@
SUM(CASE WHEN sendstate >= 3 OR sendstate = 1 THEN 1 ELSE 0 END) AS yfs,
SUM(CASE WHEN sendstate = 2 THEN 1 ELSE 0 END) AS dsf,
SUM(CASE WHEN sendstate = 1 THEN 1 ELSE 0 END) AS blq,
- SUM(CASE WHEN excep IS NOT NULL AND excep != '0' THEN 1 ELSE 0 END) AS yc,
- SUM(CASE WHEN isabnormal IS NOT NULL AND isabnormal = 2 THEN 1 ELSE 0 END) AS jg
+ SUM(CASE WHEN excep IS NOT NULL AND excep = '1' THEN 1 ELSE 0 END) AS yc,
+ SUM(CASE WHEN excep IS NOT NULL AND excep = '2' THEN 1 ELSE 0 END) AS jg
FROM service_subtask
where 1=1
and del_flag = 0
@@ -2246,6 +2246,9 @@
<if test="guid != null and guid != ''">
AND guid = #{guid}
</if>
+ <if test="excep != null ">
+ AND excep = #{excep}
+ </if>
<if test="visitCount != null and visitCount == 1">
AND visit_count = 1
</if>
@@ -2254,4 +2257,32 @@
</if>
</select>
+ <select id="getCurrentUserServiceSubtaskCount" parameterType="com.smartor.domain.entity.ServiceSubtaskEntity" resultType="map">
+ SELECT
+ COUNT(CASE WHEN sendstate IN (1, 2) AND date_format(endSendDateTime,'%y%m%d') <= date_format(CURDATE(),'%y%m%d') THEN 1 END) AS pendingVisitCount,
+ COUNT(CASE WHEN sendstate = 5 THEN 1 END) AS failedVisitCount,
+ COUNT(CASE WHEN isabnormal IN (1, 2) THEN 1 END) AS abnormalVisitCount,
+ COUNT(*) AS allVisitCount
+ FROM service_subtask
+ WHERE del_flag = '0'
+ <if test="orgid != null and orgid != ''">
+ AND orgid = #{orgid}
+ </if>
+ <if test="leavehospitaldistrictcodes != null and leavehospitaldistrictcodes.size() > 0">
+ AND leavehospitaldistrictcode IN
+ <foreach collection="leavehospitaldistrictcodes" item="leavehospitaldistrictcode" open="("
+ separator=","
+ close=")">
+ #{leavehospitaldistrictcode}
+ </foreach>
+ </if>
+ <if test=" leaveldeptcodes != null and leaveldeptcodes.size()>0">
+ AND deptcode IN
+ <foreach collection="leaveldeptcodes" item="leaveldeptcode" open="(" separator=","
+ close=")">
+ #{leaveldeptcode}
+ </foreach>
+ </if>
+ </select>
+
</mapper>
--
Gitblit v1.9.3