From 26d1f59f0266672398975ba0337bb3d8267c2d95 Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期一, 12 十月 2026 15:36:52 +0800
Subject: [PATCH] 满意度扫码BUG修改

---
 smartor/src/main/resources/mapper/smartor/ServiceSubtaskDetailMapper.xml |   49 ++++++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 46 insertions(+), 3 deletions(-)

diff --git a/smartor/src/main/resources/mapper/smartor/ServiceSubtaskDetailMapper.xml b/smartor/src/main/resources/mapper/smartor/ServiceSubtaskDetailMapper.xml
index 0591b17..6c48fbf 100644
--- a/smartor/src/main/resources/mapper/smartor/ServiceSubtaskDetailMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/ServiceSubtaskDetailMapper.xml
@@ -18,6 +18,8 @@
         <result property="assigntime" column="assigntime"/>
         <result property="starttime" column="starttime"/>
         <result property="answertime" column="answertime"/>
+        <result property="dimension" column="lib_templateid"/>
+        <result property="isMydException" column="is_myd_exception"/>
 
         <result property="silent" column="silent"/>
         <result property="dtmfKey" column="dtmf_key"/>
@@ -70,6 +72,8 @@
     <sql id="selectServiceSubtaskDetailVo">
         select id,
                sub_id,
+               is_myd_exception,
+               dimension,
                lib_templateid,
                targetid,
                answerps,
@@ -129,6 +133,8 @@
         <include refid="selectServiceSubtaskDetailVo"/>
         where 1=1
         <if test="subId != null">and sub_id = #{subId}</if>
+        <if test="isMydException != null">and is_myd_exception = #{isMydException}</if>
+        <if test="dimension != null">and dimension = #{dimension}</if>
         <if test="templateType != null">and template_type = #{templateType}</if>
         <if test="libTemplateid != null">and lib_templateid = #{libTemplateid}</if>
         <if test="targetid != null">and targetid = #{targetid}</if>
@@ -179,10 +185,30 @@
 
     </select>
 
+    <!--
+        寮傚父闂澶勭悊鎯呭喌鏌ヨ锛坱racedeallist锛夌殑銆屾湁鏁堝~鍐欐暟銆嶏細
+        鍘熸潵瀵规瘡涓� scriptid 閮芥墽琛屼竴娆� selectServiceSubtaskDetailList锛堟煡鍥炲叏閮ㄥ垪鍐嶅幓 size锛夛紝
+        涓�涓棶棰樹竴娆°�佽�屼笖鏁翠釜鎺ュ彛浼氳璋冪敤涓ら亶锛屽嚑鍗佷笂鐧句釜闂灏辨槸涓婄櫨娆″ぇ琛ㄦ壂鎻忥紱
+        杩欓噷鍚堝苟鎴愪竴鏉� group by銆�
+        娉ㄦ剰锛氫负涓庡師鍙e緞瀹屽叏涓�鑷达紝杩欓噷涓嶅姞 del_flag 鏉′欢锛堝師 selectServiceSubtaskDetailList
+        铏界劧 Java 閲� setDelFlag("0")锛屼絾 SQL 閲屽苟娌℃湁 del_flag 杩囨护锛夈��
+    -->
+    <select id="countDetailByScriptIds" resultType="java.util.Map">
+        select scriptid as scriptid, count(*) as cnt
+        from service_subtask_detail
+        where scriptid in
+        <foreach collection="scriptIds" item="scriptId" open="(" separator="," close=")">
+            #{scriptId}
+        </foreach>
+        group by scriptid
+    </select>
+
     <select id="getServiceSubtaskDetails" parameterType="com.smartor.domain.ServiceSubtaskDetailVO"
             resultType="java.util.HashMap">
         select
             ssd.sub_id,
+            ssd.is_myd_exception,
+            ssd.dimension,
             ssd.taskid,
             ssd.patid,
             sd.sendname,
@@ -205,6 +231,8 @@
         <if test="subId != null">and ssd.sub_id = #{subId}</if>
         <if test="taskid != null">and ssd.taskid = #{taskid}</if>
         <if test="questiontext != null and questiontext != ''">and ssd.questiontext = #{questiontext}</if>
+        <if test="isMydException != null">and ssd.is_myd_exception = #{isMydException}</if>
+        <if test="dimension != null">and ssd.dimension = #{dimension}</if>
         <if test="matchedtext != null and matchedtext != ''">and ssd.matchedtext = #{matchedtext}</if>
         <if test="asrtext != null and asrtext != ''">and ssd.asrtext = #{asrtext}</if>
         <if test="scriptid != null">and ssd.scriptid = #{scriptid}</if>
@@ -230,6 +258,13 @@
                 #{scriptId}
             </foreach>
         </if>
+        <if test="isFilled != null and isFilled != '0'">
+            AND IFNULL(ssd.matchedtext,ssd.asrtext) is not null
+            AND IFNULL(ssd.matchedtext,ssd.asrtext) != ''
+        </if>
+        <if test="configValue != null and configValue != ''">
+            AND ssd.categoryid IN (${configValue})
+        </if>
         order by ssd.sub_id desc, ssd.id desc
     </select>
     <select id="selectServiceSubtaskDetailByCalldetailid" parameterType="String" resultMap="ServiceSubtaskDetailResult">
@@ -248,7 +283,7 @@
         <if test="questiontext != null">and questiontext = #{questiontext}</if>
     </select>
 
-    <select id="isExistServiceSubtaskDetail" resultType="com.smartor.domain.DTO.ServiceSubtaskDetailDTO">
+                <select id="isExistServiceSubtaskDetail" resultType="com.smartor.domain.DTO.ServiceSubtaskDetailDTO">
         select id, questiontext, matchedtext, score
         from service_subtask_detail
         where del_flag = 0
@@ -314,6 +349,8 @@
             <if test="templateType != null">template_type,</if>
             <if test="libTemplateid != null">lib_templateid,</if>
             <if test="score != null">score,</if>
+            <if test="isMydException != null">is_myd_exception,</if>
+            <if test="dimension != null">dimension,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="id != null">#{id},</if>
@@ -369,12 +406,16 @@
             <if test="templateType != null">#{templateType},</if>
             <if test="libTemplateid != null">#{libTemplateid},</if>
             <if test="score != null">#{score},</if>
+            <if test="isMydException != null">#{isMydException},</if>
+            <if test="dimension != null">#{dimension},</if>
         </trim>
     </insert>
 
     <update id="updateServiceSubtaskDetail" parameterType="com.smartor.domain.ServiceSubtaskDetail">
         update service_subtask_detail
         <trim prefix="SET" suffixOverrides=",">
+            <if test="isMydException != null">is_myd_exception = #{isMydException},</if>
+            <if test="dimension != null">dimension = #{dimension},</if>
             <if test="subId != null">sub_id = #{subId},</if>
             <if test="taskid != null">taskid = #{taskid},</if>
             <if test="targetid != null">targetid = #{targetid},</if>
@@ -430,7 +471,6 @@
         </trim>
         where id = #{id}
     </update>
-
 
     <update id="updateSSDByCondition" parameterType="com.smartor.domain.ServiceSubtaskDetail">
         update service_subtask_detail
@@ -487,6 +527,8 @@
             <if test="templateType != null">template_type = #{templateType},</if>
             <if test="libTemplateid != null">lib_templateid = #{libTemplateid},</if>
             <if test="score != null">score = #{score},</if>
+            <if test="isMydException != null">is_myd_exception = #{isMydException},</if>
+            <if test="dimension != null">dimension = #{dimension},</if>
         </trim>
         where patid = #{patid} and scriptid = #{scriptid} and sub_id = #{subId}
     </update>
@@ -521,4 +563,5 @@
             ivr_liba_target.targetname,
             service_subtask_detail.matchedtext
     </select>
-</mapper>
+
+        </mapper>

--
Gitblit v1.9.3