From 26d1f59f0266672398975ba0337bb3d8267c2d95 Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期一, 12 十月 2026 15:36:52 +0800
Subject: [PATCH] 满意度扫码BUG修改
---
smartor/src/main/resources/mapper/smartor/ServiceSubtaskDetailTraceMapper.xml | 373 +++++++++++++++++++++++++++++++++++++++++++++++++---
1 files changed, 349 insertions(+), 24 deletions(-)
diff --git a/smartor/src/main/resources/mapper/smartor/ServiceSubtaskDetailTraceMapper.xml b/smartor/src/main/resources/mapper/smartor/ServiceSubtaskDetailTraceMapper.xml
index a7c9511..1bc14e8 100644
--- a/smartor/src/main/resources/mapper/smartor/ServiceSubtaskDetailTraceMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/ServiceSubtaskDetailTraceMapper.xml
@@ -53,11 +53,42 @@
<result property="pid" column="pid"/>
<result property="categoryid" column="categoryid"/>
<result property="templateType" column="template_type"/>
+ <result property="isMydException" column="is_myd_exception"/>
+ <result property="dimension" column="dimension"/>
+ <result property="dutyDeptPersonName" column="duty_dept_person_name"/>
+ <result property="dutyDeptPersonCode" column="duty_dept_person_code"/>
+ <result property="reportDeptPersonCode" column="report_dept_person_name"/>
+ <result property="reportDeptPersonName" column="report_dept_person_code"/>
+ <result property="circulationDeptPersonCode" column="circulation_dept_person_code"/>
+ <result property="circulationDeptPersonName" column="circulation_dept_person_name"/>
+ <result property="circulationDeptCode" column="circulation_dept_code"/>
+ <result property="circulationDeptName" column="circulation_dept_name"/>
+ <result property="circulationExplain" column="circulation_explain"/>
+ <result property="circulationTime" column="circulation_time"/>
+ <result property="circulationStatus" column="circulation_status"/>
+ <result property="circulationPersonName" column="circulation_person_name"/>
+ <result property="circulationPersonCode" column="circulation_person_code"/>
+
</resultMap>
<sql id="selectServiceSubtaskDetailTtraceVo">
select id,
+ circulation_status,
+ circulation_person_name,
+ circulation_person_code,
+ duty_dept_person_name,
+ duty_dept_person_code,
+ report_dept_person_name,
+ report_dept_person_code,
+ circulation_dept_person_code,
+ circulation_dept_person_name,
+ circulation_dept_code,
+ circulation_dept_name,
+ circulation_explain,
+ circulation_time,
detail_id,
+ is_myd_exception,
+ dimension,
template_type,
sub_id,
taskid,
@@ -247,36 +278,211 @@
<if test="type != null and type != ''">
and type = #{type}
</if>
+ <if test="dimension != null and dimension != ''">
+ and dimension = #{dimension}
+ </if>
+ <if test="isMydException != null ">
+ and is_myd_exception = #{isMydException}
+ </if>
+ <if test="dutyDeptPersonName != null and dutyDeptPersonName != ''">
+ and duty_dept_person_name like concat('%', #{dutyDeptPersonName}, '%')
+ </if>
+ <if test="dutyDeptPersonCode != null and dutyDeptPersonCode != ''">
+ and duty_dept_person_code like concat('%', #{dutyDeptPersonCode}, '%')
+ </if>
+ <if test="reportDeptPersonName != null and reportDeptPersonName != ''">
+ and report_dept_person_name like concat('%', #{reportDeptPersonName}, '%')
+ </if>
+ <if test="reportDeptPersonCode != null and reportDeptPersonCode != ''">
+ and report_dept_person_code like concat('%', #{reportDeptPersonCode}, '%')
+ </if>
+ <if test="circulationDeptPersonCode != null and circulationDeptPersonCode != ''">
+ and circulation_dept_person_code like concat('%', #{circulationDeptPersonCode}, '%')
+ </if>
+ <if test="circulationDeptPersonName != null and circulationDeptPersonName != ''">
+ and circulation_dept_person_name like concat('%', #{circulationDeptPersonName}, '%')
+ </if>
+ <if test="circulationDeptCode != null and circulationDeptCode != ''">
+ and circulation_dept_code like concat('%', #{circulationDeptCode}, '%')
+ </if>
+ <if test="circulationDeptName != null and circulationDeptName != ''">
+ and circulation_dept_name like concat('%', #{circulationDeptName}, '%')
+ </if>
+ <if test="circulationExplain != null and circulationExplain != ''">
+ and circulation_explain like concat('%', #{circulationExplain}, '%')
+ </if>
+ <if test="circulationTime != null ">
+ and circulation_time = #{circulationTime}
+ </if>
+ <if test="circulationStatus != null ">
+ and circulation_status = #{circulationStatus}
+ </if>
+ <if test="circulationPersonName != null and circulationPersonName != ''">
+ and circulation_person_name like concat('%', #{circulationPersonName}, '%')
+ </if>
+ <if test="circulationPersonCode != null and circulationPersonCode != ''">
+ and circulation_person_code =#{circulationPersonCode}
+ </if>
+ <if test="pageSize != null and pageNum != null">limit ${pageSize} OFFSET ${pageNum}</if>
</select>
- <select id="tracedeallist" parameterType="com.smartor.domain.VO.DetailTraceDealVO"
- resultMap="ServiceSubtaskDetailTtraceResult">
- <include refid="selectServiceSubtaskDetailTtraceVo"/>
- where del_flag=0
+ <!--
+ 寮傚父闂澶勭悊鎯呭喌鏌ヨ锛坱racedeallist锛夌殑鍏叡杩囨护鏉′欢銆�
+ 涓嬮潰 5 鏉� SQL 鍏辩敤鏈墖娈碉紝淇濊瘉銆屽垎椤垫暟鎹�侀棶棰樻�绘暟銆佸叏閲忔眹鎬汇�嶇殑鍙e緞瀹屽叏涓�鑷淬��
+ 娉ㄦ剰锛歲uestiontext 涓虹┖鐨勮鍘熷疄鐜伴噷琚� stream().filter(questiontext != null) 涓㈡帀浜嗭紝
+ 鎵�浠ヨ繖閲岀粺涓�鎺掗櫎锛屾眹鎬绘暟鎵嶅拰鍘熸潵涓�鑷淬��
+ -->
+ <sql id="traceDealWhere">
+ and del_flag = 0
+ and questiontext is not null
+ <if test="vo.templateid != null and vo.templateid != ''">
+ and templateid = #{vo.templateid}
+ </if>
+ <if test="vo.todeptcode != null and vo.todeptcode != ''">
+ and FIND_IN_SET(#{vo.todeptcode}, todeptcode)
+ </if>
+ <if test="vo.todeptname != null and vo.todeptname != ''">
+ and todeptname like concat('%', #{vo.todeptname}, '%')
+ </if>
+ <if test="vo.handleStartTime != null and vo.handleEndTime != null">
+ and handle_time between #{vo.handleStartTime} and #{vo.handleEndTime}
+ </if>
+ <if test="vo.orgid != null and vo.orgid != ''">
+ and orgid = #{vo.orgid}
+ </if>
+ <if test="vo.type != null and vo.type != ''">
+ and type = #{vo.type}
+ </if>
+ <if test="vo.templateType != null">
+ and template_type = #{vo.templateType}
+ </if>
+ <if test="vo.isMydException != null ">
+ and is_myd_exception = #{vo.isMydException}
+ </if>
+ <if test="vo.dimension != null and vo.dimension != ''">
+ and dimension = #{vo.dimension}
+ </if>
+ <if test="vo.dutyDeptPersonName != null and vo.dutyDeptPersonName != ''">
+ and duty_dept_person_name like concat('%', #{vo.dutyDeptPersonName}, '%')
+ </if>
+ <if test="vo.dutyDeptPersonCode != null and vo.dutyDeptPersonCode != ''">
+ and duty_dept_person_code like concat('%', #{vo.dutyDeptPersonCode}, '%')
+ </if>
+ <if test="vo.reportDeptPersonName != null and vo.reportDeptPersonName != ''">
+ and report_dept_person_name like concat('%', #{vo.reportDeptPersonName}, '%')
+ </if>
+ <if test="vo.reportDeptPersonCode != null and vo.reportDeptPersonCode != ''">
+ and report_dept_person_code like concat('%', #{vo.reportDeptPersonCode}, '%')
+ </if>
+ <if test="vo.circulationDeptPersonCode != null and vo.circulationDeptPersonCode != ''">
+ and circulation_dept_person_code like concat('%', #{vo.circulationDeptPersonCode}, '%')
+ </if>
+ <if test="vo.circulationDeptPersonName != null and vo.circulationDeptPersonName != ''">
+ and circulation_dept_person_name like concat('%', #{vo.circulationDeptPersonName}, '%')
+ </if>
+ <if test="vo.circulationDeptCode != null and vo.circulationDeptCode != ''">
+ and circulation_dept_code like concat('%', #{vo.circulationDeptCode}, '%')
+ </if>
+ <if test="vo.circulationDeptName != null and vo.circulationDeptName != ''">
+ and circulation_dept_name like concat('%', #{vo.circulationDeptName}, '%')
+ </if>
+ <if test="vo.circulationExplain != null and vo.circulationExplain != ''">
+ and circulation_explain like concat('%', #{vo.circulationExplain}, '%')
+ </if>
+ <if test="vo.circulationTime != null ">
+ and circulation_time = #{vo.circulationTime}
+ </if>
+ <if test="vo.circulationStatus != null ">
+ and circulation_status = #{vo.circulationStatus}
+ </if>
+ <if test="vo.circulationPersonName != null and vo.circulationPersonName != ''">
+ and circulation_person_name like concat('%', #{vo.circulationPersonName}, '%')
+ </if>
+ <if test="vo.circulationPersonCode != null and vo.circulationPersonCode != ''">
+ and circulation_person_code = #{vo.circulationPersonCode}
+ </if>
+ </sql>
- <if test="templateid != null and templateid != ''">
- and templateid = #{templateid}
- </if>
- <if test="todeptcode != null and todeptcode != ''">
- and FIND_IN_SET(#{todeptcode}, todeptcode)
- </if>
- <if test="todeptname != null and todeptname != ''">
- and todeptname like concat('%', #{todeptname}, '%')
- </if>
- <if test="handleStartTime != null and handleEndTime != null">
- and handle_time between #{handleStartTime} and #{handleEndTime}
- </if>
+ <!--
+ 褰撳墠椤电殑闂鍒嗙粍鑱氬悎锛氬垎椤垫寜闂缁村害涓嬫帹鍒� SQL銆�
+ 鍘熸潵鏄妸 service_subtask_detail_trace 鍏ㄨ〃锛堝惈 patdesc/recordurl 绛夊ぇ瀛楁锛夋媺鍥� Java 鍐嶅垎缁勶紝
+ pageSize 瀹屽叏娌$敓鏁堬紱鐜板湪 DB 鍙鐞嗗綋鍓嶉〉鐨勯鐩��
- <if test="orgid != null and orgid != ''">
- and orgid = #{orgid}
+ 娉ㄦ剰鍒嗙粍缁村害蹇呴』鏄� questiontext锛堟帴鍙f枃妗g害瀹氥�屾瘡涓棶棰樺搴斾竴鏉¤褰曘�嶏級锛�
+ 涓�涓� questiontext 鍙兘瀵瑰簲澶氫釜 scriptid锛岃繖鏃惰鎶婅闂鎵�鏈� scriptid 鐨勬湁鏁堝~鍐欐暟鍔犺捣鏉ワ紝
+ 鎵�浠ヨ繖閲岀敤 group_concat(distinct scriptid) 鎶� scriptid 鍒楄〃甯﹀洖 Java锛坰criptid 鍙栨渶灏忓�肩敤浜庡睍绀猴級銆�
+ 濡傛灉鏀规垚 group by questiontext, scriptid锛屽悓涓�涓棶棰樹細鎷嗘垚澶氳锛�
+ 涓� countTraceDealQuestions锛堟寜 questiontext 鍘婚噸锛夈�乼otal銆佽礋璐g瀹ゃ�佹渶鏂板鐞嗕汉鐨勫彛寰勯兘浼氫笉涓�鑷淬��
+ -->
+ <select id="selectTraceDealGroups" resultType="java.util.Map">
+ select questiontext as questiontext,
+ min(scriptid) as scriptid,
+ group_concat(distinct scriptid) as scriptids,
+ min(template_type) as templateType,
+ count(*) as exceptionFillNum,
+ sum(case when handle_flag = '1' then 1 else 0 end) as yesDeal,
+ sum(case when handle_flag = '1' then 0 else 1 end) as noDeal
+ from service_subtask_detail_trace
+ where 1 = 1
+ <include refid="traceDealWhere"/>
+ group by questiontext
+ order by questiontext
+ <if test="vo.pageSize != null and vo.pageNum != null">
+ limit ${vo.pageSize} offset ${vo.pageNum}
</if>
+ </select>
- <if test="type != null and type != ''">
- and type = #{type}
- </if>
- <if test="templateType != null">
- and template_type = #{templateType}
- </if>
+ <!-- 闂鎬绘暟锛堝垎椤� total锛屾寜闂缁村害锛� -->
+ <select id="countTraceDealQuestions" resultType="long">
+ select count(distinct questiontext)
+ from service_subtask_detail_trace
+ where 1 = 1
+ <include refid="traceDealWhere"/>
+ </select>
+
+ <!-- 鍏ㄩ噺姹囨�伙紙涓嶅彈鍒嗛〉褰卞搷锛夛細鎬绘暟 + 宸插鐞嗘暟锛屾湭澶勭悊鏁板湪 Java 閲岀浉鍑� -->
+ <select id="sumTraceDeal" resultType="java.util.Map">
+ select count(*) as totalException,
+ sum(case when handle_flag = '1' then 1 else 0 end) as yesDeal
+ from service_subtask_detail_trace
+ where 1 = 1
+ <include refid="traceDealWhere"/>
+ </select>
+
+ <!-- 褰撳墠椤甸棶棰樼殑璐熻矗绉戝锛堟寜绉戝缂栧彿鍘婚噸锛屽悕绉板彇缁勫唴闈炵┖鐨勪竴涓級 -->
+ <select id="selectTraceDealDepts" resultType="java.util.Map">
+ select questiontext as questiontext,
+ todeptcode as deptCode,
+ min(todeptname) as deptName
+ from service_subtask_detail_trace
+ where 1 = 1
+ <include refid="traceDealWhere"/>
+ and todeptcode is not null and todeptcode != ''
+ and questiontext in
+ <foreach collection="questiontexts" item="qt" open="(" separator="," close=")">
+ #{qt}
+ </foreach>
+ group by questiontext, todeptcode
+ </select>
+
+ <!-- 褰撳墠椤甸棶棰樼殑鏈�鏂板鐞嗕汉鍜屽鐞嗘椂闂达紙handle_time 鏈�澶х殑涓�鏉★級 -->
+ <select id="selectTraceDealLatestHandle" resultType="java.util.Map">
+ select t.questiontext as questiontext,
+ t.handle_by as handleBy,
+ t.handle_time as handleTime
+ from service_subtask_detail_trace t
+ inner join (select questiontext, max(handle_time) as maxHandleTime
+ from service_subtask_detail_trace
+ where 1 = 1
+ <include refid="traceDealWhere"/>
+ and handle_time is not null
+ and questiontext in
+ <foreach collection="questiontexts" item="qt" open="(" separator="," close=")">
+ #{qt}
+ </foreach>
+ group by questiontext) m
+ on m.questiontext = t.questiontext and m.maxHandleTime = t.handle_time
+ where t.del_flag = 0
</select>
@@ -386,6 +592,43 @@
</if>
<if test="templateType != null">template_type,
</if>
+ <if test="dimension != null">dimension,
+ </if>
+ <if test="isMydException != null">is_myd_exception,
+ </if>
+ <if test="dutyDeptPersonName != null">duty_dept_person_name,
+ </if>
+ <if test="dutyDeptPersonCode != null">duty_dept_person_code,
+ </if>
+ <if test="reportDeptPersonName != null">report_dept_person_name,
+ </if>
+ <if test="reportDeptPersonCode != null">report_dept_person_code,
+ </if>
+ <if test="circulationDeptPersonCode != null">circulation_dept_person_code,
+ </if>
+ <if test="circulationDeptPersonName != null">circulation_dept_person_name,
+ </if>
+ <if test="circulationDeptCode != null ">
+ circulation_dept_code,
+ </if>
+ <if test="circulationDeptName != null">
+ circulation_dept_name,
+ </if>
+ <if test="circulationExplain != null ">
+ circulation_explain,
+ </if>
+ <if test="circulationTime != null ">
+ circulation_time,
+ </if>
+ <if test="circulationStatus != null ">
+ circulation_status,
+ </if>
+ <if test="circulationPersonName != null and circulationPersonName != ''">
+ circulation_person_name,
+ </if>
+ <if test="circulationPersonCode != null and circulationPersonCode != ''">
+ circulation_person_code,
+ </if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="detailId != null">#{detailId},
@@ -483,6 +726,43 @@
<if test="type != null">#{type},
</if>
<if test="templateType != null">#{templateType},
+ </if>
+ <if test="dimension != null">#{dimension},
+ </if>
+ <if test="isMydException != null">#{isMydException},
+ </if>
+ <if test="dutyDeptPersonName != null">#{dutyDeptPersonName},
+ </if>
+ <if test="dutyDeptPersonCode != null">#{dutyDeptPersonCode},
+ </if>
+ <if test="reportDeptPersonName != null">#{reportDeptPersonName},
+ </if>
+ <if test="reportDeptPersonCode != null">#{reportDeptPersonCode},
+ </if>
+ <if test="circulationDeptPersonCode != null">#{circulationDeptPersonCode},
+ </if>
+ <if test="circulationDeptPersonName != null">#{circulationDeptPersonName},
+ </if>
+ <if test="circulationDeptCode != null">
+ #{circulationDeptCode},
+ </if>
+ <if test="circulationDeptName != null">
+ #{circulationDeptName},
+ </if>
+ <if test="circulationExplain != null">
+ #{circulationExplain},
+ </if>
+ <if test="circulationTime != null ">
+ #{circulationTime},
+ </if>
+ <if test="circulationStatus != null ">
+ #{circulationStatus},
+ </if>
+ <if test="circulationPersonName != null and circulationPersonName != ''">
+ #{circulationPersonName},
+ </if>
+ <if test="circulationPersonCode != null and circulationPersonCode != ''">
+ #{circulationPersonCode},
</if>
</trim>
</insert>
@@ -634,6 +914,51 @@
<if test="templateType != null">template_type =
#{templateType},
</if>
+ <if test="dimension != null">dimension =
+ #{dimension},
+ </if>
+ <if test="isMydException != null">is_myd_exception =
+ #{isMydException},
+ </if>
+ <if test="dutyDeptPersonName != null">duty_dept_person_name =
+ #{dutyDeptPersonName},
+ </if>
+ <if test="dutyDeptPersonCode != null">duty_dept_person_code =
+ #{dutyDeptPersonCode},
+ </if>
+ <if test="reportDeptPersonName != null">report_dept_person_name =
+ #{reportDeptPersonName},
+ </if>
+ <if test="reportDeptPersonCode != null">report_dept_person_code =
+ #{reportDeptPersonCode},
+ </if>
+ <if test="circulationDeptPersonCode != null">circulation_dept_person_code =
+ #{circulationDeptPersonCode},
+ </if>
+ <if test="circulationDeptPersonName != null">circulation_dept_person_name =
+ #{circulationDeptPersonName},
+ </if>
+ <if test="circulationDeptCode != null">circulation_dept_code =
+ #{circulationDeptCode},
+ </if>
+ <if test="circulationDeptName != null">circulation_dept_name =
+ #{circulationDeptName},
+ </if>
+ <if test="circulationExplain != null">circulation_explain =
+ #{circulationExplain},
+ </if>
+ <if test="circulationTime != null">circulation_time =
+ #{circulationTime},
+ </if>
+ <if test="circulationStatus != null ">
+ circulation_status = #{circulationStatus},
+ </if>
+ <if test="circulationPersonName != null and circulationPersonName != ''">
+ circulation_person_name =#{circulationPersonName},
+ </if>
+ <if test="circulationPersonCode != null and circulationPersonCode != ''">
+ circulation_person_code =#{circulationPersonCode},
+ </if>
</trim>
where id = #{id}
</update>
--
Gitblit v1.9.3