From aed6d61750963f48efbd74f843175075684819de Mon Sep 17 00:00:00 2001
From: 陈昶聿 <chychen@nbjetron.com>
Date: 星期二, 12 五月 2026 15:00:46 +0800
Subject: [PATCH] 【市一】随访查询结果为0
---
smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 53 insertions(+), 0 deletions(-)
diff --git a/smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml b/smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml
index 06dc0aa..fc77ed8 100644
--- a/smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml
@@ -92,6 +92,7 @@
<result property="continueContent" column="continue_content"/>
<result property="continueCount" column="continue_count"/>
<result property="continueTimeNext" column="continue_time_next"/>
+ <result property="operationItemId" column="operation_item_id"/>
</resultMap>
<resultMap type="com.smartor.domain.ServiceSubtaskCount" id="ServiceSubtaskResult2">
@@ -212,6 +213,7 @@
continue_content,
continue_count,
continue_time_next,
+ operation_item_id,
task_situation
from service_subtask
</sql>
@@ -264,6 +266,7 @@
resultMap="ServiceSubtaskResult">
<include refid="selectServiceSubtaskVo"/>
where del_flag = 0
+ <if test="subId != null ">and id = #{subId}</if>
<if test="continueFlag != null ">and continue_flag = #{continueFlag}</if>
<if test="continueTimeNow != null ">and continue_time_now = #{continueTimeNow,jdbcType=TIMESTAMP}</if>
<if test="continueCount != null ">and continue_count = #{continueCount}</if>
@@ -871,6 +874,7 @@
<if test="continueCount != null ">continue_count,</if>
<if test="continueTimeNext != null ">continue_time_next,</if>
<if test="continueContent != null ">continue_content,</if>
+ <if test="operationItemId != null ">operation_item_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="sendname != null">#{sendname},</if>
@@ -962,6 +966,7 @@
<if test="continueCount != null ">#{continueCount},</if>
<if test="continueTimeNext != null ">#{continueTimeNext,jdbcType=TIMESTAMP},</if>
<if test="continueContent != null ">#{continueContent},</if>
+ <if test="operationItemId != null ">#{operationItemId},</if>
</trim>
</insert>
@@ -1058,6 +1063,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="operationItemId != null ">operation_item_id = #{operationItemId},</if>
</trim>
where id = #{id}
</update>
@@ -1391,6 +1397,7 @@
deptname,
sendstate,
preachform,
+ current_preachform,
excep,
nurse_id,
nurse_name,
@@ -2495,4 +2502,50 @@
ORDER BY groupCode
</select>
+ <!-- 瀹f暀缁熻锛氭寜鐥呭尯鎴栫瀹ゅ垎缁勶紝缁熻鍙戦�佹�婚噺銆佸彂閫佹垚鍔熼噺锛坰endstate=6锛夈�佸凡璇婚噺锛坒inishtime涓嶄负绌猴級 -->
+ <select id="getHeLibraryCount" parameterType="com.smartor.domain.VO.HeLibraryCountVO" resultType="map">
+ SELECT
+ <choose>
+ <when test="hospitaldistrictcodes != null and hospitaldistrictcodes.size() > 0">
+ leavehospitaldistrictcode AS groupCode,
+ leavehospitaldistrictname AS groupName,
+ </when>
+ <otherwise>
+ deptcode AS groupCode,
+ deptname AS groupName,
+ </otherwise>
+ </choose>
+ COUNT(*) AS totalCount,
+ SUM(CASE WHEN sendstate = 6 THEN 1 ELSE 0 END) AS sendSuccessCount,
+ SUM(CASE WHEN finishtime IS NOT NULL THEN 1 ELSE 0 END) AS readCount
+ FROM service_subtask
+ WHERE del_flag = 0
+ AND service_type = 4
+ <if test="starttime != null">AND starttime >= #{starttime}</if>
+ <if test="endtime != null">AND endtime <= #{endtime}</if>
+ <if test="visittime != null">AND DATE(visit_time) = DATE(#{visittime})</if>
+ <if test="finishtime != null">AND DATE(finishtime) = DATE(#{finishtime})</if>
+ <if test="hospType != null and hospType != ''">AND hosp_type = #{hospType}</if>
+ <choose>
+ <when test="hospitaldistrictcodes != null and hospitaldistrictcodes.size() > 0">
+ AND leavehospitaldistrictcode IN
+ <foreach collection="hospitaldistrictcodes" item="code" open="(" separator="," close=")">
+ #{code}
+ </foreach>
+ GROUP BY leavehospitaldistrictcode, leavehospitaldistrictname
+ ORDER BY groupCode
+ </when>
+ <otherwise>
+ <if test="deptcodes != null and deptcodes.size() > 0">
+ AND deptcode IN
+ <foreach collection="deptcodes" item="code" open="(" separator="," close=")">
+ #{code}
+ </foreach>
+ </if>
+ GROUP BY deptcode, deptname
+ ORDER BY groupCode
+ </otherwise>
+ </choose>
+ </select>
+
</mapper>
--
Gitblit v1.9.3