From 5ef44ce6297e223faecc3819911d2891a3c582c7 Mon Sep 17 00:00:00 2001
From: 陈昶聿 <chychen@nbjetron.com>
Date: 星期二, 06 一月 2026 10:16:07 +0800
Subject: [PATCH] 【市一】随访满意度明细调整

---
 smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml |   34 ++++++++++++++++++++++++++--------
 1 files changed, 26 insertions(+), 8 deletions(-)

diff --git a/smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml b/smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml
index 62fce89..fb3ad76 100644
--- a/smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml
@@ -100,14 +100,17 @@
 
     </resultMap>
 
-    <resultMap type="com.smartor.domain.ServiceSubtaskCategoryCount" id="ServiceSubtaskCategoryCountResult">
-        <result property="month" column="month"/>
-        <result property="serviceType" column="service_type"/>
-        <result property="subTaskId" column="subTaskId"/>
-        <result property="completedCount" column="completed_count"/>
-        <result property="allCount" column="all_count"/>
-        <result property="completedPercent" column="completed_percent"/>
-        <result property="name" column="name"/>
+    <resultMap type="com.smartor.domain.ServiceSubtaskScriptCount" id="ServiceSubtaskScriptCountResult">
+        <result property="scriptid" column="scriptid"/>
+        <result property="templateid" column="templateid"/>
+        <result property="scriptContent" column="script_content"/>
+        <result property="completedQuantity" column="completed_quantity"/>
+        <result property="allQuantity" column="all_quantity"/>
+        <result property="completedPercentage" column="completed_percentage"/>
+        <result property="optionText" column="option_text"/>
+        <result property="chosenQuantity" column="chosen_quantity"/>
+        <result property="chosenPercentage" column="chosen_percentage"/>
+        <result property="options" column="options"/>
     </resultMap>
 
     <sql id="selectServiceSubtaskVo">
@@ -1354,9 +1357,16 @@
             resultMap="ServiceSubtaskScriptCountResult">
         SELECT
         a.id as scriptid,
+        a.templateid as templateid,
         a.script_content,
         b.completed_quantity,
         b.all_quantity,
+        <if test="type == 1">
+            '' as options,
+        </if>
+        <if test="type == 2">
+            c.options,
+        </if>
         ROUND(b.completed_quantity/b.all_quantity,2) as completed_percentage
         FROM
         <if test="type == 1">
@@ -1415,6 +1425,14 @@
         </if>
         group by ssd.scriptid) b
         ON a.id = b.scriptid
+        <!-- 缁熻闂嵎 -->
+        <if test="type == 2">
+            LEFT JOIN (
+            SELECT target.scriptid,GROUP_CONCAT(optioncontent) as options
+            FROM svy_task_template_targetoption target
+            group by target.scriptid
+            ) c ON a.scriptid = c.scriptid
+        </if>
     </select>
 
     <select id="getSfStatisticsScriptItemDetails" parameterType="com.smartor.domain.ServiceSubtaskCountReq"

--
Gitblit v1.9.3