From 9fc52256df321e14a179811eda954491f5b71fea Mon Sep 17 00:00:00 2001
From: 陈昶聿 <chychen@nbjetron.com>
Date: 星期五, 09 一月 2026 17:55:19 +0800
Subject: [PATCH] 【市一】问题统计接口调整
---
smartor/src/main/resources/mapper/smartor/SvyTaskTemplateScriptMapper.xml | 81 +++++++++++++++++++++++++++++++++++++++-
1 files changed, 79 insertions(+), 2 deletions(-)
diff --git a/smartor/src/main/resources/mapper/smartor/SvyTaskTemplateScriptMapper.xml b/smartor/src/main/resources/mapper/smartor/SvyTaskTemplateScriptMapper.xml
index 1c723d2..2fc9ce7 100644
--- a/smartor/src/main/resources/mapper/smartor/SvyTaskTemplateScriptMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/SvyTaskTemplateScriptMapper.xml
@@ -44,7 +44,23 @@
<result property="score" column="score"/>
<result property="prompt" column="prompt"/>
<result property="groupName" column="group_name"/>
+ <result property="categoryid" column="categoryid"/>
+ </resultMap>
+
+ <resultMap type="com.smartor.domain.ServiceSubtaskScriptCount" id="ServiceSubtaskScriptCountResult">
+ <result property="scriptid" column="scriptid"/>
+ <result property="templateid" column="templateid"/>
+ <result property="scriptType" column="script_type"/>
+ <result property="scriptContent" column="script_content"/>
+ <result property="subtaskType" column="subtask_type"/>
+ <result property="completedQuantity" column="completed_quantity"/>
+ <result property="allQuantity" column="all_quantity"/>
+ <result property="completedPercentage" column="completed_percentage"/>
+ <result property="optionText" column="option_text"/>
+ <result property="chosenQuantity" column="chosen_quantity"/>
+ <result property="chosenPercentage" column="chosen_percentage"/>
+ <result property="options" column="options"/>
</resultMap>
<sql id="selectSvyTaskTemplateScriptVo">
@@ -52,6 +68,7 @@
sort,
ishide,
prompt,
+ categoryid,
group_name,
branch_flag,
branch_nextscriptno,
@@ -70,8 +87,9 @@
<select id="selectSvyTaskTemplateScriptList" parameterType="com.smartor.domain.SvyTaskTemplateScript"
resultMap="SvyTaskTemplateScriptResult">
<include refid="selectSvyTaskTemplateScriptVo"/>
- <where>
+ where 1=1
<if test="taskid != null ">and taskid = #{taskid}</if>
+ <if test="categoryid != null ">and categoryid = #{categoryid}</if>
<if test="ishide != null ">and ishide = #{ishide}</if>
<if test="scriptno != null ">and scriptno = #{scriptno}</if>
<if test="templateID != null ">and templateID = #{templateID}</if>
@@ -107,7 +125,6 @@
<if test="branchNextscriptno != null and branchNextscriptno != ''">and branch_nextscriptno =
#{branchNextscriptno}
</if>
- </where>
</select>
<select id="selectSvyTaskTemplateScriptByID" parameterType="Long" resultMap="SvyTaskTemplateScriptResult">
@@ -157,6 +174,7 @@
<if test="prompt != null ">prompt,</if>
<if test="groupName != null ">group_name,</if>
<if test="ishide != null ">ishide,</if>
+ <if test="categoryid != null ">categoryid,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="taskid != null">#{taskid},</if>
@@ -197,6 +215,7 @@
<if test="prompt != null ">#{prompt},</if>
<if test="groupName != null ">#{groupName},</if>
<if test="ishide != null ">#{ishide},</if>
+ <if test="categoryid != null ">#{categoryid},</if>
</trim>
</insert>
@@ -243,6 +262,7 @@
<if test="prompt != null">prompt = #{prompt},</if>
<if test="groupName != null ">group_name = #{groupName},</if>
<if test="ishide != null ">ishide = #{ishide},</if>
+ <if test="categoryid != null ">categoryid = #{categoryid},</if>
</trim>
where id = #{d}
</update>
@@ -259,4 +279,61 @@
#{id}
</foreach>
</delete>
+
+ <select id="getSvyTemplateScriptListForSubtaskCount" parameterType="com.smartor.domain.ServiceSubtaskCountReq"
+ resultMap="ServiceSubtaskScriptCountResult">
+ SELECT
+ ss.templateid,
+ ssd.scriptid,
+ task_script.script_type,
+ task_script.script_content,
+ task_targetoption.optioncontent AS option_text
+ FROM
+ service_subtask_detail ssd
+ INNER JOIN service_subtask ss ON ssd.sub_id = ss.id
+ INNER JOIN svy_task_template_script task_script
+ ON task_script.id = ssd.scriptid
+ INNER JOIN svy_task_template_targetoption task_targetoption
+ ON task_targetoption.scriptid = task_script.id
+ where 1=1
+ and ss.del_flag=0
+ <if test="orgid != null and orgid != ''">
+ and ss.orgid = #{orgid}
+ </if>
+ <if test="leavehospitaldistrictcodes != null and leavehospitaldistrictcodes.size() > 0">
+ AND ss.leavehospitaldistrictcode IN
+ <foreach collection="leavehospitaldistrictcodes" item="leavehospitaldistrictcode" open="(" separator=","
+ close=")">
+ #{leavehospitaldistrictcode}
+ </foreach>
+ </if>
+ <if test="deptcodes != null and deptcodes.size() > 0">
+ AND ss.deptcode IN
+ <foreach collection="deptcodes" item="deptcode" open="(" separator=","
+ close=")">
+ #{deptcode}
+ </foreach>
+ </if>
+ <if test="serviceType != null and serviceType.size() > 0">
+ AND ss.service_type IN
+ <foreach collection="serviceType" item="serviceType" open="(" separator=","
+ close=")">
+ #{serviceType}
+ </foreach>
+ </if>
+ <if test="startTime != null and endTime!=null">
+ AND date_format(ss.visit_time,'%y%m%d') >= date_format(#{startTime},'%y%m%d')
+ AND date_format(ss.visit_time,'%y%m%d') <= date_format(#{endTime},'%y%m%d')
+ </if>
+ <!-- 鐩墠鍙粺璁¤闊冲拰闂嵎 -->
+ <if test="type != null">
+ and ss.type = #{type}
+ </if>
+ <if test="configValue != null and configValue != ''">
+ AND ssd.categoryid IN (${configValue})
+ </if>
+ group by ss.templateid, ssd.scriptid,
+ task_script.script_type, task_script.script_content,
+ task_targetoption.optioncontent
+ </select>
</mapper>
--
Gitblit v1.9.3