From 87b79ea739ec32bd7d0e493a6ea8525212f6c763 Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期六, 10 十月 2026 15:11:17 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master' into smartor_ls_261008
---
smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml | 145 +++++++++++++++++++++++++++++++++++++++++++-----
1 files changed, 129 insertions(+), 16 deletions(-)
diff --git a/smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml b/smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml
index 9c23ee0..8724894 100644
--- a/smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml
@@ -571,6 +571,43 @@
AND date_format(visit_time,'%y%m%d') <= date_format(#{endTime},'%y%m%d')
</if>
</select>
+ <!--
+ 婊℃剰搴︾粺璁★細鍙煡鏈鏉′欢涓嬪疄闄呭瓨鍦ㄥ摢浜� type銆�
+ 杩囨护鏉′欢涓� selectSatisfactionSubtaskList 瀹屽叏涓�鑷达紝鍙槸锛�
+ 1) 鍙� select distinct type锛堝師鏉ユ槸鎶婁笂鐧句釜瀛楁鍏ㄦ煡鍥炴潵锛夛紱
+ 2) visit_time 鏀规垚鍙蛋绱㈠紩鐨勮寖鍥存潯浠讹紙鍘熸潵瀵瑰垪濂� date_format锛岀储寮曠敤涓嶄笂锛夈��
+ -->
+ <select id="selectSatisfactionSubtaskTypes" parameterType="com.smartor.domain.VO.PatSatisfactionReqVO"
+ resultType="java.lang.String">
+ select distinct type
+ from service_subtask
+ where del_flag = 0
+ <if test="questionType != null">and type = #{questionType}</if>
+ <if test="hospitaldistrictcodes != null and hospitaldistrictcodes.size() > 0">
+ AND leavehospitaldistrictcode IN
+ <foreach collection="hospitaldistrictcodes" item="hospitaldistrictcode" open="(" separator=","
+ close=")">
+ #{hospitaldistrictcode}
+ </foreach>
+ </if>
+ <if test="deptcodes != null and deptcodes.size() > 0">
+ AND deptcode IN
+ <foreach collection="deptcodes" item="deptcode" open="(" separator="," close=")">
+ #{deptcode}
+ </foreach>
+ </if>
+ <if test="serviceTypes != null and serviceTypes.size() > 0">
+ AND service_type IN
+ <foreach collection="serviceTypes" item="serviceType" open="(" separator="," close=")">
+ #{serviceType}
+ </foreach>
+ </if>
+ <if test="startTime != null and endTime != null">
+ AND visit_time >= #{startTime}
+ AND visit_time < date_add(#{endTime}, interval 1 day)
+ </if>
+ </select>
+
<select id="getCompensateServiceSubtaskList" parameterType="com.smartor.domain.entity.ServiceSubtaskEntity"
resultMap="ServiceSubtaskResult">
<include refid="selectServiceSubtaskVo"/>
@@ -738,6 +775,12 @@
</if>
<if test="managementDoctorCode != null">and management_doctor_code = #{managementDoctorCode}</if>
<if test="managementDoctor != null">and management_doctor like concat('%',#{managementDoctor}, '%')</if>
+ <if test="startOutHospTime != null">
+ AND date_format(endtime,'%y%m%d') >= date_format(#{startOutHospTime},'%y%m%d')
+ </if>
+ <if test="endOutHospTime != null">
+ AND date_format(endtime,'%y%m%d') <= date_format(#{endOutHospTime},'%y%m%d')
+ </if>
) a
</select>
@@ -770,6 +813,7 @@
</if>
WHERE ss.del_flag = 0
AND ss.visit_time IS NOT NULL
+ AND ss.sendstate != 4
<if test="starttime == null and endtime==null">
AND DATE(ss.visit_time) < DATE(NOW())
</if>
@@ -802,6 +846,12 @@
close=")">
#{serviceType}
</foreach>
+ </if>
+ <if test="startOutHospTime != null">
+ AND date_format(ss.endtime,'%y%m%d') >= date_format(#{startOutHospTime},'%y%m%d')
+ </if>
+ <if test="endOutHospTime != null">
+ AND date_format(ss.endtime,'%y%m%d') <= date_format(#{endOutHospTime},'%y%m%d')
</if>
<if test="groupKey != null and groupKey != ''">
AND ss.${groupKey} IN
@@ -2896,6 +2946,60 @@
</select>
<!--
+ 婊℃剰搴︽煴鐘跺浘锛氫竴娆℃�х粺璁℃湰娆¤姹傚叏閮ㄦā鏉跨殑鍙戦�侀噺銆�
+ 涓� querySendCount 鐨勮繃婊ゆ潯浠跺畬鍏ㄤ竴鑷达紝鍖哄埆鏄細
+ 1) 鎸� libtemplateid 鍒嗙粍锛屼竴娆¤繑鍥炴墍鏈夋ā鏉匡紙鏇夸唬閫愪釜妯℃澘鏌ヨ锛夛紱
+ 2) visit_time 鏀规垚鍙蛋绱㈠紩鐨勮寖鍥存潯浠讹紙鍘熸潵瀵瑰垪濂� date_format锛岀储寮曠敤涓嶄笂锛夈��
+ -->
+ <select id="selectSatisfactionSendCount" parameterType="com.smartor.domain.entity.SatisfactionStatQuery"
+ resultType="java.util.Map">
+ select libtemplateid as libtemplateid, count(distinct id) as cnt
+ from service_subtask
+ where del_flag = 0
+ <if test="orgid != null and orgid != ''">
+ and orgid = #{orgid}
+ </if>
+ <if test="campusid != null and campusid != ''">
+ and campusid = #{campusid}
+ </if>
+ <if test="type != null and type != ''">and type = #{type}</if>
+ <if test="startTime != null">
+ and visit_time >= #{startTime}
+ </if>
+ <if test="endTime != null">
+ and visit_time < date_add(#{endTime}, interval 1 day)
+ </if>
+ <if test="libTemplateIds != null and libTemplateIds.size() > 0">
+ and 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">
+ 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">
+ deptcode IN
+ <foreach collection="deptcodes" item="deptcode" open="(" separator="," close=")">
+ #{deptcode}
+ </foreach>
+ </if>
+ )
+ </if>
+ group by libtemplateid
+ </select>
+
+ <!--
鎸夌梾鍖烘垨绉戝鍒嗙粍缁熻 continue_flag 鏁伴噺
浼犱簡 leavehospitaldistrictcodes 鈫� 鎸夌梾鍖虹淮搴�
浼犱簡 deptcodes 鈫� 鎸夌瀹ょ淮搴�
@@ -3399,14 +3503,15 @@
<select id="statQuestionOptionBySubtaskIds" resultType="com.smartor.domain.ServiceSubtaskDetailRatioExport">
SELECT
d.questiontext AS questiontext,
- t.taskid AS taskid,
- t.task_name AS taskName,
+ <!-- 鏄庣粏宸叉寜銆岄鐩� + 閫夐」銆嶆眹鎬伙紝浠诲姟/绉戝/鐥呭尯鍙槸闄勫甫淇℃伅锛屽繀椤荤敤鑱氬悎鍑芥暟鍙栧�硷紙MySQL ONLY_FULL_GROUP_BY锛� -->
+ MAX(t.taskid) AS taskid,
+ MAX(t.task_name) AS taskName,
d.asrtext AS optionresult,
d.score AS score,
- s.deptcode AS deptcode,
- s.deptname AS deptname,
- s.leavehospitaldistrictcode AS leavehospitaldistrictcode,
- s.leavehospitaldistrictname AS leavehospitaldistrictname,
+ MAX(s.deptcode) AS deptcode,
+ MAX(s.deptname) AS deptname,
+ MAX(s.leavehospitaldistrictcode) AS leavehospitaldistrictcode,
+ MAX(s.leavehospitaldistrictname) AS leavehospitaldistrictname,
d.targetvalue AS targetvalue,
d.value_type AS valueType,
COUNT(*) AS count,
@@ -3424,9 +3529,15 @@
AND d2.del_flag = '0'
)
INNER JOIN (
+ <!-- 鍒嗘瘝 = 璇ラ鍚勯�夐」椤规暟涔嬪拰锛堟湭浣滅瓟鐨勭┖ asrtext 涓嶈繘鍒嗘瘝锛夛紝杩欐牱涓�閬撻鍚勯�夐」姣斾緥鍚堣鎵嶆槸 100% -->
+ SELECT
+ x.questiontext AS questiontext,
+ SUM(x.option_count) AS total_count
+ FROM (
SELECT
d.questiontext,
- COUNT(*) AS total_count
+ d.asrtext,
+ COUNT(*) AS option_count
FROM
service_task t
INNER JOIN service_subtask s ON s.taskid = t.taskid
@@ -3467,7 +3578,11 @@
<if test="endFinishTime != null">
AND date_format(s.finishtime,'%y%m%d') <= date_format(#{endFinishTime},'%y%m%d')
</if>
- GROUP BY d.questiontext
+ <!-- 鏈綔绛旓紙asrtext 涓虹┖锛夌殑鏄庣粏涓嶈鍏ュ垎姣� -->
+ AND d.asrtext IS NOT NULL AND TRIM(d.asrtext) <> ''
+ GROUP BY d.questiontext, d.asrtext
+ ) x
+ GROUP BY x.questiontext
) t2 ON t2.questiontext = d.questiontext
WHERE 1=1
<!-- 鍘婚噸锛氭槑缁嗚鍚屼竴瀛愪换鍔″悓涓�棰樼洰鍙繚鐣欐渶鏂颁竴鏉★紝閲嶇瓟涓嶉噸澶嶈鍏ラ」鏁� -->
@@ -3486,6 +3601,8 @@
</if>
AND s.sendstate = 6
AND d.del_flag=0
+ <!-- 鏈綔绛旓紙asrtext 涓虹┖锛変笉绠椾换浣曢�夐」锛屾槑缁嗛噷鐩存帴鎺掗櫎锛岄伩鍏嶅嚭鐜扮┖閫夐」琛� -->
+ AND d.asrtext IS NOT NULL AND TRIM(d.asrtext) <> ''
<if test="valueType != null">AND d.value_type >= #{valueType}</if>
<if test="scoreStart != null">AND d.score >= #{scoreStart}</if>
<if test="scoreEnd != null">AND d.score <= #{scoreEnd}</if>
@@ -3504,21 +3621,17 @@
<if test="endFinishTime != null">
AND date_format(s.finishtime,'%y%m%d') <= date_format(#{endFinishTime},'%y%m%d')
</if>
+ <!-- 鍙寜銆岄鐩� + 閫夐」銆嶆眹鎬伙細鍘熸潵 GROUP BY 甯︿笂 taskid/绉戝/鐥呭尯锛屽悓涓�涓�夐」琚媶鎴愬琛屻�佹瘡琛屾暟閲忛兘鏄� 1锛�
+ 鍓嶇/瀵煎嚭鎷垮埌鐨勩�屾暟閲忋�嶅氨姘歌繙鍋氫笉浜嗙疮鍔� -->
GROUP BY
- t.taskid,
d.questiontext,
+ d.asrtext,
d.score,
d.targetvalue,
- d.asrtext,
- t.task_name,
- s.deptcode,
- s.deptname,
- s.leavehospitaldistrictcode,
- s.leavehospitaldistrictname,
d.value_type
ORDER BY
d.questiontext,
- t.taskid
+ MIN(t.taskid)
</select>
<select id="statQuestionOptionByKsOrBq" resultType="com.smartor.domain.DTO.QuestionCountKsOrBqDTO"
--
Gitblit v1.9.3