From 34f78281cf395a24e1f3f1c3b861186ff8a03b7b Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期五, 16 十月 2026 11:09:40 +0800
Subject: [PATCH] 出入院模块、门急诊模块、模块模块、宣教模块、其它模块
---
smartor/src/main/resources/mapper/smartor/ServiceSubtaskDetailMapper.xml | 212 ----------------------------------------------------
1 files changed, 2 insertions(+), 210 deletions(-)
diff --git a/smartor/src/main/resources/mapper/smartor/ServiceSubtaskDetailMapper.xml b/smartor/src/main/resources/mapper/smartor/ServiceSubtaskDetailMapper.xml
index 945af85..6c48fbf 100644
--- a/smartor/src/main/resources/mapper/smartor/ServiceSubtaskDetailMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/ServiceSubtaskDetailMapper.xml
@@ -283,185 +283,7 @@
<if test="questiontext != null">and questiontext = #{questiontext}</if>
</select>
- <!--
- 婊℃剰搴︽煴鐘跺浘锛氫竴娆℃�х粺璁℃湰娆¤姹傚叏閮ㄦā鏉跨殑濉姤閲忋��
- 绛変环浜庡姣忎釜妯℃澘鎵ц queryFillCount(subids, questiontext)锛屽尯鍒槸锛�
- 1) 鐢� join service_subtask 浠f浛鍏堟妸鍏ㄩ儴 sub_id 鏌ュ洖 Java 鍐嶆嫾 IN(...)锛�
- 2) 鎸� libtemplateid + questiontext + score 鍒嗙粍锛屽彧鍥炰紶鍒嗗�间笌鏉℃暟锛�
- 3) visit_time 鏀规垚鍙蛋绱㈠紩鐨勮寖鍥存潯浠躲��
- 娉ㄦ剰锛氳繖閲屽埢鎰忎笉鍦� SQL 閲岃繃婊� questiontext锛岀敱 Java 鎸夊師 queryFillCount 鐨�
- 銆宷uestiontext 涓� null 鏃朵笉鎷艰鏉′欢銆嶈涔夊仛鍖归厤锛屼繚璇佺粨鏋滃彛寰勫畬鍏ㄤ竴鑷淬��
- -->
- <select id="selectSatisfactionFillStat" parameterType="com.smartor.domain.entity.SatisfactionStatQuery"
- resultType="java.util.Map">
- select ss.libtemplateid as libtemplateid,
- ssd.questiontext as questiontext,
- ssd.score as score,
- count(*) 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 >= #{startTime}
- </if>
- <if test="endTime != null">
- and ss.visit_time < 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, 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 >= #{startTime}
- </if>
- <if test="endTime != null">
- and ss.visit_time < 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)锛屽尯鍒槸锛�
- 1) 鐢� join service_subtask 浠f浛鍏堟妸鍏ㄩ儴 sub_id 鏌ュ洖 Java 鍐嶆嫾 IN(...)锛�
- 2) 鎸� 妯℃澘+闂+matchedtext+score 鍒嗙粍锛屽彧鍥炰紶閫夐」/鍒嗗�间笌鏉℃暟锛�
- 3) targetvalue 鐢� min() 鍙栬闂鐨勪竴涓潪绌洪�夐」涓诧紙鍚屼竴涓棶棰樿鍊间竴鑷达級锛�
- 4) visit_time 鏀规垚鍙蛋绱㈠紩鐨勮寖鍥存潯浠躲��
- 娉ㄦ剰锛氳繖閲屽埢鎰忎笉鍦� SQL 閲岃繃婊� questiontext锛岀敱 Java 鎸夊師 queryFillCount 鐨�
- 銆宷uestiontext 涓� null 鏃朵笉鎷艰鏉′欢銆嶈涔夊仛鍖归厤锛屼繚璇佺粨鏋滃彛寰勫畬鍏ㄤ竴鑷淬��
- -->
- <select id="selectSatisfactionFillStatByMatchedtext" parameterType="com.smartor.domain.entity.SatisfactionStatQuery"
- resultType="java.util.Map">
- select ss.libtemplateid as libtemplateid,
- ssd.questiontext as questiontext,
- ssd.matchedtext as matchedtext,
- ssd.score as score,
- count(*) as cnt,
- min(ssd.targetvalue) as targetvalue
- 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 >= #{startTime}
- </if>
- <if test="endTime != null">
- and ss.visit_time < 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, ssd.questiontext, ssd.matchedtext, ssd.score
- </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
@@ -650,7 +472,6 @@
where id = #{id}
</update>
-
<update id="updateSSDByCondition" parameterType="com.smartor.domain.ServiceSubtaskDetail">
update service_subtask_detail
<trim prefix="SET" suffixOverrides=",">
@@ -743,33 +564,4 @@
service_subtask_detail.matchedtext
</select>
- <select id="selectRepeatDetailIds" resultType="Long">
- SELECT d1.id
- FROM service_subtask_detail d1
- INNER JOIN (
- SELECT sub_id, questiontext,
- MAX(create_time) AS max_create_time,
- MAX(id) AS keep_id
- FROM service_subtask_detail
- WHERE del_flag = 0
- GROUP BY sub_id, questiontext
- HAVING COUNT(*) > 1
- ) d2 ON d1.sub_id = d2.sub_id
- AND d1.questiontext = d2.questiontext
- AND (
- d1.create_time < d2.max_create_time
- OR (d1.create_time = d2.max_create_time AND d1.id < d2.keep_id)
- )
- WHERE d1.del_flag = 0
- </select>
-
- <update id="deleteRepeatDetailByIds">
- UPDATE service_subtask_detail
- SET del_flag = 1
- WHERE del_flag = 0
- AND id IN
- <foreach collection="ids" item="id" open="(" separator="," close=")">
- #{id}
- </foreach>
- </update>
-</mapper>
+ </mapper>
--
Gitblit v1.9.3