From e4872d9fdd9f277eacc518459418cb406570b99a Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期五, 11 九月 2026 10:57:28 +0800
Subject: [PATCH] Merge branch 'master' of http://116.62.18.175:6699/r/smartor
---
smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml | 114 +++++++++++++++++++++++++++++++++++++++++++++++----------
1 files changed, 94 insertions(+), 20 deletions(-)
diff --git a/smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml b/smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml
index 52eef2d..4910e68 100644
--- a/smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml
@@ -358,6 +358,12 @@
#{itemTaskId}
</foreach>
</if>
+ <if test="operationItemIds != null and operationItemIds.size() > 0">
+ AND operation_item_id IN
+ <foreach collection="operationItemIds" item="operationItemIdItem" open="(" separator="," close=")">
+ #{operationItemIdItem}
+ </foreach>
+ </if>
<if test="templateid != null and templateid != ''">and templateid = #{templateid}</if>
<if test="templatename != null and templatename != ''">and templatename like concat('%', #{templatename},
'%')
@@ -396,7 +402,7 @@
</if>
<if test="deptOrDistrict==2">
AND (1=1
- <if test="leavehospitaldistrictcodes != null and leavehospitaldistrictcodes.size() > 0">
+ <if test="leavehospitaldistrictcodes != null">
AND leavehospitaldistrictcode IN
<foreach collection="leavehospitaldistrictcodes" item="leavehospitaldistrictcode" open="("
separator=","
@@ -404,7 +410,7 @@
#{leavehospitaldistrictcode}
</foreach>
</if>
- <if test=" leaveldeptcodes != null and leaveldeptcodes.size()>0">
+ <if test=" leaveldeptcodes != null">
OR deptcode IN
<foreach collection="leaveldeptcodes" item="leaveldeptcode" open="(" separator=","
close=")">
@@ -483,6 +489,7 @@
<if test="libtemplatename != null ">and libtemplatename = #{libtemplatename}</if>
<if test="openid != null ">and openid = #{openid}</if>
<if test="sendstate != null ">and sendstate = #{sendstate}</if>
+ <if test="operationItemId != null ">and operation_item_id = #{operationItemId}</if>
<if test="drname != null and drname != ''">and drname like concat('%', #{drname}, '%')</if>
<if test="taskName != null and taskName != ''">and task_name like concat('%', #{taskName}, '%')</if>
<if test="drcode != null and drcode != ''">and (drcode = #{drcode}</if>
@@ -506,10 +513,10 @@
<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
- <foreach collection="visitDeptCodes" item="visitDeptCodes" open="("
+ <foreach collection="visitDeptCodes" item="visitDeptCode" open="("
separator=","
close=")">
- #{visitDeptCodes}
+ #{visitDeptCode}
</foreach>
</if>
<if test="sort != null and sort==0">order by endtime asc</if>
@@ -1367,16 +1374,17 @@
<if test="continueTimeNext != null ">continue_time_next = #{continueTimeNext,jdbcType=TIMESTAMP},</if>
<if test="continueContent != null ">continue_content = #{continueContent},</if>
</trim>
- where
- <if test="patid != null ">
- patid = #{patid}
- </if>
- <if test="taskid != null ">
- and taskid = #{taskid}
- </if>
- <if test="id != null ">
- and id = #{id}
- </if>
+ <where>
+ <if test="patid != null ">
+ patid = #{patid}
+ </if>
+ <if test="taskid != null ">
+ and taskid = #{taskid}
+ </if>
+ <if test="id != null ">
+ and id = #{id}
+ </if>
+ </where>
</update>
<update id="updateServiceSubtaskByTaskGuid" parameterType="com.smartor.domain.ServiceSubtask">
@@ -1816,7 +1824,8 @@
continue_content,
continue_count,
continue_time_next,
- task_situation
+ task_situation,
+ remark
from service_subtask
where 1=1
and del_flag = 0
@@ -2558,8 +2567,9 @@
</if>
</if>
<if test="deptOrDistrict==2">
+ AND (1=1
<if test="leavehospitaldistrictcodes != null and leavehospitaldistrictcodes.size() > 0">
- AND (leavehospitaldistrictcode IN
+ AND leavehospitaldistrictcode IN
<foreach collection="leavehospitaldistrictcodes" item="leavehospitaldistrictcode" open="("
separator=","
close=")">
@@ -2569,17 +2579,18 @@
<if test=" leaveldeptcodes != null and leaveldeptcodes.size()>0">
OR deptcode IN
<foreach collection="leaveldeptcodes" item="leaveldeptcode" open="(" separator=","
- close="))">
+ close=")">
#{leaveldeptcode}
</foreach>
</if>
+ )
</if>
<if test="visitCount != null and visitCount > 1 and visitDeptCodes != null and visitDeptCodes.size() > 0">
AND visit_dept_code IN
- <foreach collection="visitDeptCodes" item="visitDeptCodes" open="("
+ <foreach collection="visitDeptCodes" item="visitDeptCode" open="("
separator=","
close=")">
- #{visitDeptCodes}
+ #{visitDeptCode}
</foreach>
</if>
<if test="leavehospitaldistrictname != null and leavehospitaldistrictname != ''">
@@ -2993,7 +3004,8 @@
continue_content,
continue_count,
continue_time_next,
- task_situation
+ task_situation,
+ remark
from service_subtask
where 1=1
and del_flag = 0
@@ -3036,6 +3048,7 @@
SELECT
d.questiontext AS questiontext,
t.taskid AS taskid,
+ t.task_name AS taskName,
d.asrtext AS optionresult,
COUNT(*) AS count,
CONCAT(ROUND(COUNT(*) * 100.0 / t2.total_count, 2), '%') AS ratio
@@ -3057,6 +3070,7 @@
#{taskId}
</foreach>
and s.sendstate=6
+ and d.del_flag=0
GROUP BY
t.taskid,
d.questiontext
@@ -3066,6 +3080,7 @@
#{taskId}
</foreach>
AND s.sendstate = 6
+ and d.del_flag=0
<if test="startOutHospTime != null">
AND date_format(s.endtime,'%y%m%d') >= date_format(#{startOutHospTime},'%y%m%d')
</if>
@@ -3081,5 +3096,64 @@
t.taskid
</select>
+ <!-- 鏂版柟娉曪細鏍规嵁瀛愪换鍔� ID 缁熻闂閫夐」鐧惧垎姣� (鐢ㄤ簬婊℃剰搴︾粺璁� serviceType=6) -->
+ <select id="statQuestionOptionBySubtaskIds" resultType="com.smartor.domain.ServiceSubtaskDetailRatioExport">
+ SELECT
+ d.questiontext AS questiontext,
+ t.taskid AS taskid,
+ t.task_name AS taskName,
+ d.asrtext AS optionresult,
+ COUNT(*) AS count,
+ CONCAT(ROUND(COUNT(*) * 100.0 / t2.total_count, 2), '%') AS ratio
+ FROM
+ service_task t
+ INNER JOIN service_subtask s ON s.taskid = t.taskid
+ INNER JOIN service_subtask_detail d ON d.sub_id = s.id
+ INNER JOIN (
+ SELECT
+ d.questiontext,
+ COUNT(*) AS total_count
+ FROM
+ service_task t
+ INNER JOIN service_subtask s ON s.taskid = t.taskid
+ INNER JOIN service_subtask_detail d ON d.sub_id = s.id
+ WHERE s.id IN
+ <foreach collection="subtaskIds" item="subtaskId" open="(" separator="," close=")">
+ #{subtaskId}
+ </foreach>
+ AND s.sendstate = 6
+ AND d.del_flag=0
+ GROUP BY d.questiontext -- 鈫� 鍏抽敭淇敼锛氭寜棰樼洰鍒嗙粍缁熻姣忎釜棰樼洰鐨勬�绘暟
+ ) t2 ON t2.questiontext = d.questiontext -- 鈫� 鍏宠仈鍒板綋鍓嶉鐩�
+ WHERE s.id IN
+ <foreach collection="subtaskIds" item="subtaskId" open="(" separator="," close=")">
+ #{subtaskId}
+ </foreach>
+ AND s.sendstate = 6
+ AND d.del_flag=0
+ <if test="startOutHospTime != null">
+ AND date_format(s.endtime,'%y%m%d') >= date_format(#{startOutHospTime},'%y%m%d')
+ </if>
+ <if test="endOutHospTime != null">
+ AND date_format(s.endtime,'%y%m%d') <= date_format(#{endOutHospTime},'%y%m%d')
+ </if>
+ GROUP BY
+ t.taskid,
+ d.questiontext,
+ d.asrtext
+ ORDER BY
+ d.questiontext,
+ t.taskid
+ </select>
+
+ <select id="selectServiceSubtaskListDeadLine" parameterType="com.smartor.domain.entity.ServiceSubtaskEntity"
+ resultMap="ServiceSubtaskResult">
+ <include refid="selectServiceSubtaskVo"/>
+ where 1=1
+ and del_flag = 0
+ and visit_count = 1
+ and endtime
+ </select>
+
</mapper>
--
Gitblit v1.9.3