From 60ade5154522a042c816abaa1840751011ae0371 Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期二, 29 九月 2026 19:15:03 +0800
Subject: [PATCH] 1.省立同德满度问题处理 2.门急诊数据采集优化

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

diff --git a/smartor/src/main/resources/mapper/smartor/ServiceSubtaskDetailMapper.xml b/smartor/src/main/resources/mapper/smartor/ServiceSubtaskDetailMapper.xml
index fe90a21..945af85 100644
--- a/smartor/src/main/resources/mapper/smartor/ServiceSubtaskDetailMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/ServiceSubtaskDetailMapper.xml
@@ -185,6 +185,24 @@
 
     </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
@@ -327,6 +345,57 @@
         group by ss.libtemplateid, ssd.questiontext, ssd.score
     </select>
 
+    <select id="selectSatisfactionFillPersonCount" parameterType="com.smartor.domain.entity.SatisfactionStatQuery"
+            resultType="java.util.Map">
+        select ss.libtemplateid as libtemplateid,
+               count(distinct ssd.sub_id) as cnt
+        from service_subtask_detail ssd
+        join service_subtask ss on ss.id = ssd.sub_id
+        where ssd.del_flag = 0
+        and ss.del_flag = 0
+        <if test="orgid != null and orgid != ''">
+            and ss.orgid = #{orgid}
+        </if>
+        <if test="campusid != null and campusid != ''">
+            and ss.campusid = #{campusid}
+        </if>
+        <if test="type != null and type != ''">and ss.type = #{type}</if>
+        <if test="startTime != null">
+            and ss.visit_time &gt;= #{startTime}
+        </if>
+        <if test="endTime != null">
+            and ss.visit_time &lt; date_add(#{endTime}, interval 1 day)
+        </if>
+        <if test="libTemplateIds != null and libTemplateIds.size() > 0">
+            and ss.libtemplateid IN
+            <foreach collection="libTemplateIds" item="libTemplateId" open="(" separator="," close=")">
+                #{libTemplateId}
+            </foreach>
+        </if>
+        <if test="(hospitaldistrictcodes != null and hospitaldistrictcodes.size() > 0) or (deptcodes != null and deptcodes.size() > 0)">
+            AND (
+            <if test="hospitaldistrictcodes != null and hospitaldistrictcodes.size() > 0">
+                ss.leavehospitaldistrictcode IN
+                <foreach collection="hospitaldistrictcodes" item="hospitaldistrictcode" open="("
+                         separator=","
+                         close=")">
+                    #{hospitaldistrictcode}
+                </foreach>
+            </if>
+            <if test="hospitaldistrictcodes != null and hospitaldistrictcodes.size() > 0 and deptcodes != null and deptcodes.size() > 0">
+                OR
+            </if>
+            <if test="deptcodes != null and deptcodes.size() > 0">
+                ss.deptcode IN
+                <foreach collection="deptcodes" item="deptcode" open="(" separator="," close=")">
+                    #{deptcode}
+                </foreach>
+            </if>
+            )
+        </if>
+        group by ss.libtemplateid
+    </select>
+
     <!--
         婊℃剰搴︾粺璁★紙statistics / statisticsByDimension锛夛細涓�娆℃�х粺璁℃湰娆¤姹傚叏閮ㄩ棶棰樼殑濉姤閲忋��
         绛変环浜庡姣忎釜闂鎵ц queryFillCount(subids, questiontext)锛屽尯鍒槸锛�

--
Gitblit v1.9.3