From 0c0a64646a2a04d24a3c7e28d1e9d2a96dc569e4 Mon Sep 17 00:00:00 2001
From: 陈昶聿 <chychen@nbjetron.com>
Date: 星期二, 13 一月 2026 17:32:55 +0800
Subject: [PATCH] 【市一】获取随访统计比例sql调整
---
smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml | 28 ++++++++++++++++++++++++----
1 files changed, 24 insertions(+), 4 deletions(-)
diff --git a/smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml b/smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml
index f75750b..06bb5ab 100644
--- a/smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml
@@ -1203,8 +1203,15 @@
AND date_format(visit_time,'%y%m%d') <= date_format(#{endTime},'%y%m%d')
</if>
<if test="visitDeptCode != null">and visit_dept_code = #{visitDeptCode}</if>
- <if test="visitDeptName != null">abd visit_dept_name = #{visitDeptName}</if>
- <if test="isabnormal != null">abd isabnormal = #{isabnormal}</if>
+ <if test="visitDeptName != null">and visit_dept_name = #{visitDeptName}</if>
+ <if test="isabnormal != null">and isabnormal = #{isabnormal}</if>
+ <!-- 鐩墠鍙粺璁¤闊冲拰闂嵎 -->
+ <if test="type != null">
+ and type = #{type}
+ </if>
+ <if test="pageSize != null and pageNum != null">
+ limit ${pageSize} OFFSET ${pageNum}
+ </if>
</select>
<select id="getSfStatisticsJoy" parameterType="com.smartor.domain.ServiceSubtaskCountReq"
@@ -1330,12 +1337,18 @@
<select id="getSfStatisticsCategory" parameterType="com.smartor.domain.ServiceSubtaskCountReq"
resultMap="ServiceSubtaskResult2">
- SELECT a.sub_id as subTaskId,
+ SELECT
<if test="configValue != null and configValue != ''">
SUM(CASE WHEN a.categoryid IN(${configValue})
THEN 1 ELSE 0 END) AS joyAllCount,
</if>
- COUNT(sub_id) joyCount
+ <if test="configValue != null and configValue != ''">
+ SUM(CASE WHEN a.categoryid IN(${configValue})
+ AND IFNULL(a.matchedtext,a.asrtext) is not null
+ AND IFNULL(a.matchedtext,a.asrtext) != ''
+ THEN 1 ELSE 0 END) AS joyCount,
+ </if>
+ a.sub_id as subTaskId
FROM service_subtask_detail a
INNER JOIN service_subtask t ON a.sub_id = t.id
where 1=1
@@ -1358,6 +1371,13 @@
#{deptcode}
</foreach>
</if>
+ <if test="subTaskIds != null and subTaskIds.size() > 0">
+ AND t.id IN
+ <foreach collection="subTaskIds" item="subTaskId" open="(" separator=","
+ close=")">
+ #{subTaskId}
+ </foreach>
+ </if>
<if test="serviceType != null and serviceType.size() > 0">
AND t.service_type IN
<foreach collection="serviceType" item="serviceType" open="(" separator=","
--
Gitblit v1.9.3