From 051964f3cd65e421681a8af7b90c27011c36650d Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期二, 22 九月 2026 10:29:53 +0800
Subject: [PATCH] 1.门诊满意度综合得分排名(按科室或病区) 修改serviceTypes
---
smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml | 102 ++++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 100 insertions(+), 2 deletions(-)
diff --git a/smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml b/smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml
index 9471442..f902060 100644
--- a/smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml
@@ -98,6 +98,7 @@
<result property="scheduleDetailId" column="schedule_detail_id"/>
<result property="scheduleSeq" column="schedule_seq"/>
<result property="loopCount" column="loop_count"/>
+ <result property="isManuallyCalled" column="is_manually_called"/>
<result property="campusid" column="campusid"/>
</resultMap>
@@ -245,7 +246,8 @@
schedule_detail_id,
schedule_seq,
loop_count,
- task_situation
+ task_situation,
+ is_manually_called
from service_subtask
</sql>
@@ -513,6 +515,7 @@
<if test="createBy != null">and create_by = #{createBy}</if>
<if test="taskGuid != null">and task_guid = #{taskGuid}</if>
<if test="isabnormal != null">and isabnormal = #{isabnormal}</if>
+ <if test="isManuallyCalled != null">and is_manually_called = #{isManuallyCalled}</if>
<if test="isVisitAgain != null">and is_visit_again = #{isVisitAgain}</if>
<if test="visitCount != null and visitCount > 1 and visitDeptCodes != null and visitDeptCodes.size() > 0">
AND visit_dept_code IN
@@ -976,6 +979,7 @@
<if test="scheduleDetailId != null ">schedule_detail_id,</if>
<if test="scheduleSeq != null ">schedule_seq,</if>
<if test="loopCount != null ">loop_count,</if>
+ <if test="isManuallyCalled != null ">is_manually_called,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="sendname != null">#{sendname},</if>
@@ -1073,6 +1077,7 @@
<if test="scheduleDetailId != null ">#{scheduleDetailId},</if>
<if test="scheduleSeq != null ">#{scheduleSeq},</if>
<if test="loopCount != null ">#{loopCount},</if>
+ <if test="isManuallyCalled != null ">#{isManuallyCalled},</if>
</trim>
</insert>
@@ -1175,6 +1180,7 @@
<if test="scheduleDetailId != null ">schedule_detail_id = #{scheduleDetailId},</if>
<if test="scheduleSeq != null ">schedule_seq = #{scheduleSeq},</if>
<if test="loopCount != null ">loop_count = #{loopCount},</if>
+ <if test="isManuallyCalled != null ">is_manually_called = #{isManuallyCalled},</if>
</trim>
where id = #{id}
</update>
@@ -1273,6 +1279,7 @@
<if test="continueCount != null ">continue_count = #{continueCount},</if>
<if test="continueTimeNext != null ">continue_time_next = #{continueTimeNext,jdbcType=TIMESTAMP},</if>
<if test="continueContent != null ">continue_content = #{continueContent},</if>
+ <if test="isManuallyCalled != null ">is_manually_called = #{isManuallyCalled},</if>
</trim>
where 1=1
<if test="patid != null ">and patid = #{patid}</if>
@@ -1375,6 +1382,7 @@
<if test="continueCount != null ">continue_count = #{continueCount},</if>
<if test="continueTimeNext != null ">continue_time_next = #{continueTimeNext,jdbcType=TIMESTAMP},</if>
<if test="continueContent != null ">continue_content = #{continueContent},</if>
+ <if test="isManuallyCalled != null ">is_manually_called = #{isManuallyCalled},</if>
</trim>
<where>
<if test="patid != null ">
@@ -1485,6 +1493,7 @@
<if test="continueCount != null ">continue_count = #{continueCount},</if>
<if test="continueTimeNext != null ">continue_time_next = #{continueTimeNext,jdbcType=TIMESTAMP},</if>
<if test="continueContent != null ">continue_content = #{continueContent},</if>
+ <if test="isManuallyCalled != null ">is_manually_called = #{isManuallyCalled},</if>
</trim>
where task_guid = #{taskGuid} and task_name = #{taskName}
</update>
@@ -3027,7 +3036,7 @@
ROUND(avg(d.score), 2) AS totalScore
FROM service_subtask_detail d
JOIN service_task t ON d.taskid = t.taskid
- WHERE t.service_type IN (6, 14)
+ WHERE t.service_type IN (14)
AND t.del_flag = 0
AND d.del_flag = 0
AND d.create_time >= #{startFinishTime}
@@ -3457,6 +3466,95 @@
and endtime
</select>
+ <!-- 闂ㄨ瘖婊℃剰搴︾患鍚堝緱鍒嗘帓鍚嶏紙鎸夌瀹ゆ垨鐥呭尯锛� -->
+ <!-- 缁煎悎婊℃剰搴� = 危(璇勫垎鏄庣粏鏉冮噸) / 璇勫垎鏄庣粏鏉℃暟 脳 100%锛屾潈閲嶅彧鍙� 1銆�0.8銆�0.6銆�0.4銆�0.2 浜旀。 -->
+ <select id="selectMzMydScoreRank" parameterType="com.smartor.domain.VO.MzMydScoreRankVO"
+ resultType="com.smartor.domain.DTO.MzMydScoreRankDTO">
+ SELECT
+ t.code AS code,
+ t.name AS name,
+ ROUND(AVG(t.w) * 100, 2) AS score,
+ COUNT(*) AS itemCount
+ FROM (
+ SELECT
+ <choose>
+ <when test='dimensionType == "2"'>
+ s.leavehospitaldistrictcode AS code,
+ s.leavehospitaldistrictname AS name,
+ </when>
+ <otherwise>
+ s.deptcode AS code,
+ s.deptname AS name,
+ </otherwise>
+ </choose>
+ CAST(d.score AS DECIMAL(10,4)) AS w
+ FROM service_subtask s
+ INNER JOIN service_subtask_detail d ON d.sub_id = s.id
+ WHERE s.del_flag = '0'
+ AND d.del_flag = '0'
+ AND s.sendstate = 6
+ <if test="serviceTypes != null and serviceTypes.size() > 0">
+ AND service_type IN
+ <foreach collection="serviceTypes" item="serviceType" open="(" separator=","
+ close=")">
+ #{serviceType}
+ </foreach>
+ </if>
+<!-- <!– 鍙彇鍏紡閲岀殑浜旀。鏉冮噸锛岀┖鍊�/0/鏈瓟绛夋棦涓嶈繘鍒嗗瓙涔熶笉杩涘垎姣� –>-->
+<!-- AND CAST(d.score AS DECIMAL(10,4)) IN (1, 0.8, 0.6, 0.4, 0.2)-->
+ <!-- 鍚屼竴瀛愪换鍔″悓涓�棰樼洰鍙繚鐣欐渶鏂颁竴鏉★紝閬垮厤閲嶇瓟琚噸澶嶈鍏ラ」鏁� -->
+ AND d.id = (
+ SELECT MAX(d2.id)
+ FROM service_subtask_detail d2
+ WHERE d2.sub_id = d.sub_id
+ AND d2.questiontext <=> d.questiontext
+ AND d2.del_flag = '0'
+ )
+ <if test="orgid != null and orgid != ''">
+ AND s.orgid = #{orgid}
+ </if>
+ <if test="campusid != null and campusid != ''">
+ AND s.campusid = #{campusid}
+ </if>
+ <if test="startFinishTime != null">
+ AND s.finishtime >= #{startFinishTime}
+ </if>
+ <if test="endFinishTime != null">
+ AND s.finishtime < DATE_ADD(#{endFinishTime}, INTERVAL 1 DAY)
+ </if>
+ <if test="questionText != null and questionText != ''">and d.questiontext like concat('%', #{questionText},
+ '%')
+ </if>
+ <choose>
+ <when test='dimensionType == "2"'>
+ AND s.leavehospitaldistrictcode IS NOT NULL AND s.leavehospitaldistrictcode <> ''
+ AND s.leavehospitaldistrictname IS NOT NULL AND s.leavehospitaldistrictname <> ''
+ <if test="districtCodes != null and districtCodes.size() > 0">
+ AND s.leavehospitaldistrictcode IN
+ <foreach collection="districtCodes" item="districtCode" open="(" separator="," close=")">
+ #{districtCode}
+ </foreach>
+ </if>
+ </when>
+ <otherwise>
+ AND s.deptcode IS NOT NULL AND s.deptcode <> ''
+ AND s.deptname IS NOT NULL AND s.deptname <> ''
+ <if test="deptCodes != null and deptCodes.size() > 0">
+ AND s.deptcode IN
+ <foreach collection="deptCodes" item="deptCode" open="(" separator="," close=")">
+ #{deptCode}
+ </foreach>
+ </if>
+ </otherwise>
+ </choose>
+ ) t
+ GROUP BY t.code, t.name
+ ORDER BY AVG(t.w) DESC, COUNT(*) DESC
+ <if test="limit != null and limit > 0">
+ LIMIT #{limit}
+ </if>
+ </select>
+
</mapper>
--
Gitblit v1.9.3