From b25c3b5188e402695f3792ad7da53e452682cd80 Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期一, 12 十月 2026 19:43:07 +0800
Subject: [PATCH] 满意度统计BUG修改

---
 ruoyi-satisfaction/src/main/resources/mapper/satisfaction/SatisfactionScriptMapper.xml |   51 ++++++++++++++++++++++++++++++++-------------------
 1 files changed, 32 insertions(+), 19 deletions(-)

diff --git a/ruoyi-satisfaction/src/main/resources/mapper/satisfaction/SatisfactionScriptMapper.xml b/ruoyi-satisfaction/src/main/resources/mapper/satisfaction/SatisfactionScriptMapper.xml
index f4fab02..aa1b34c 100644
--- a/ruoyi-satisfaction/src/main/resources/mapper/satisfaction/SatisfactionScriptMapper.xml
+++ b/ruoyi-satisfaction/src/main/resources/mapper/satisfaction/SatisfactionScriptMapper.xml
@@ -16,7 +16,7 @@
       鍙e緞瑕佺偣锛堝繀椤讳笌鍘熸枃閫愬瓧涓�鑷达級锛�
       - queryIvrScriptByAssort / querySvyScriptByCategory锛歩ds 涓虹┖鏃朵笉鎷� IN 鏉′欢锛�
       - selectIvrScriptByDimension锛歞imensionList 涓虹┖鏃舵嫾 `dimension IS NOT NULL`锛�
-      - selectSvyScriptByDimension锛歞imensionList 涓虹┖鏃躲�愪笉鎷笺�戣鏉′欢锛堜袱渚т笉涓�鑷存槸鍘熸枃琛屼负锛夛紱
+      - selectSvyScriptByDimension锛歞imensionList 涓虹┖鏃躲�愬悓鏍枫�戞嫾璇ユ潯浠讹紙鍘熸枃鍐欏湪 <where> 鏈�鍚庝竴琛岋紝鏋佹槗鐪嬫紡锛涙棭鏈熻縼绉绘浘璇垽涓轰笉鎷硷紝宸蹭慨姝o級锛�
       - selectIvr/SvyTargetOptionScores锛歴criptIds 涓� null 鏃朵笉鎷艰繃婊わ紝绛変簬鍙栧叏閮ㄥ垎鍊笺��
     -->
 
@@ -45,7 +45,11 @@
     <!-- ================================================ 婊℃剰搴﹀垎绫伙紙闂嵎渚э級
          鍘燂細SvyLibScriptCategoryMapper.selectSvyLibScriptCategoryList
              锛堣 statement 瀹為檯瀹氫箟鍦� SvyLibTopicCategoryMapper.xml锛宯amespace 涓庢枃浠跺悕涓嶄竴鑷达級
-         娉ㄦ剰锛氶棶鍗蜂晶鍘熸枃灏辨槸鐩存帴鍙栥�愬叏閮ㄨ銆戯紙涓嶆嫾鏍戙�佷笉绛涢《灞傦級锛屼笌璇煶渚т笉鍚屻�� -->
+         娉ㄦ剰锛氶棶鍗蜂晶鍘熸枃灏辨槸鐩存帴鍙栥�愬叏閮ㄨ銆戯紙涓嶆嫾鏍戙�佷笉绛涢《灞傦級锛屼笌璇煶渚т笉鍚屻��
+         鈿狅笍 orgid 鐨勬潯浠朵笌鍘熸枃閫愬瓧涓�鑷达細鍘熸枃闂嵎渚ф槸 `<if test="orgid != null">`锛�**娌℃湁** != ''锛夛紝
+            璇煶渚ф墠鏄� `orgid != null and orgid != ''`銆備袱渚т笉涓�鑷存槸鍘熸枃琛屼负锛屽繀椤讳繚鐣欙細
+            鑻ョ粰闂嵎渚т篃鍔犱笂 `!= ''`锛屽綋鍏ュ弬 orgid 涓虹┖涓叉椂锛屽師瀹炵幇鎸� `orgid = ''` 鏌ワ紙鏃犳暟鎹級锛�
+            鍔犱簡 != '' 鍒欏彉鎴愪笉甯� orgid 鏉′欢锛堣繑鍥炲叏閮ㄦ満鏋勬暟鎹級鈥斺�� 缁撴灉浼氬彉銆� -->
     <select id="selectSvyCategoryList"
             resultType="com.ruoyi.satisfaction.domain.row.SatisfactionCategoryRow">
         select id,
@@ -57,7 +61,7 @@
         <if test="q.type != null and q.type != ''">
             and type like concat('%', #{q.type}, '%')
         </if>
-        <if test="q.orgid != null and q.orgid != ''">
+        <if test="q.orgid != null">
             and orgid = #{q.orgid}
         </if>
         order by seqno asc
@@ -75,11 +79,11 @@
         select id,
                templateid,
                scriptid,
-               script_content,
-               script_assortname,
-               script_assortid,
-               script_topic,
-               script_type,
+               script_content as scriptContent,
+               script_assortname as scriptAssortname,
+               script_assortid as scriptAssortid,
+               script_topic as scriptTopic,
+               script_type as scriptType,
                dimension
         from ivr_liba_template_script
         where del_flag = 0
@@ -102,11 +106,11 @@
             resultType="com.ruoyi.satisfaction.domain.row.SatisfactionSvyScriptRow">
         select id,
                svyid,
-               script_content,
+               script_content as scriptContent,
                categoryName,
                categoryid,
-               script_topic,
-               script_type,
+               script_topic as scriptTopic,
+               script_type as scriptType,
                dimension
         from svy_lib_template_script
         where del_flag = 0
@@ -120,13 +124,13 @@
 
     <!-- ================================================ 鎸夌淮搴﹀彇闂锛堣闊充晶锛�
          鍘燂細IvrLibaTemplateScriptMapper.selectILTSBydimension
-         鍙e緞瑕佺偣锛歞imensionList 涓虹┖鏃舵嫾 `dimension IS NOT NULL`锛堥棶鍗蜂晶涓嶆嫾锛屼袱渚т笉鍚屾槸鍘熸枃琛屼负锛� -->
+         鍙e緞瑕佺偣锛歞imensionList 涓虹┖鏃舵嫾 `dimension IS NOT NULL`锛堥棶鍗蜂晶鍘熸枃涔熸湁锛岃 selectSvyScriptByDimension锛� -->
     <select id="selectIvrScriptByDimension"
             resultType="com.ruoyi.satisfaction.domain.row.SatisfactionIvrScriptRow">
         select templateid,
                scriptid,
-               script_content,
-               script_assortname,
+               script_content as scriptContent,
+               script_assortname as scriptAssortname,
                dimension
         from ivr_liba_template_script
         <where>
@@ -145,13 +149,19 @@
 
     <!-- ================================================ 鎸夌淮搴﹀彇闂锛堥棶鍗蜂晶锛�
          鍘燂細SvyLibTemplateScriptMapper.selectSLTScriptListBydimension
-         鍙e緞瑕佺偣锛歞imensionList 涓虹┖鏃躲�愪笉鎷笺�慸imension IS NOT NULL锛堢瓑浜庡叏琛� del_flag=0锛夛紱
-                   鑱氬悎鐢ㄧ殑妯℃澘 id 涓庨�夐」鍏宠仈 id 閮芥槸 svyid -->
+         鈿狅笍 涓や晶鍏跺疄銆愰兘瑕併�戞嫾 dimension IS NOT NULL锛�
+            - 璇煶渚э紙selectIvrScriptByDimension锛夎鏉′欢绱ц窡鍦� dimensionList 鍒嗘敮涔嬪悗锛�
+            - 闂嵎渚у師鏂囨妸瀹冨啓鍦� <where> 鐨�**鏈�鍚庝竴琛�**锛堝湪 duty/report/circulation 閭d簺
+              婊℃剰搴︾敤涓嶅埌鐨勬潯浠朵箣鍚庯級锛屽鏄撶湅婕� 鈥斺�� 鏃╂湡杩佺Щ鏃舵浘璇垽涓�"闂嵎渚т笉鎷�"锛屽凡淇銆�
+         鈿狅笍 蹇呴』鍚屾椂鍙� id 涓� svyid 涓や釜銆愪笉鍚屻�戠殑鍒楋紙鍘熸枃鐨� <include> 鐗囨灏辨槸杩欐牱锛夛細
+            鑱氬悎缁熻锛堝彂閫侀噺/濉姤閲忥級鎸� svyid 鍒嗙粍锛岃�屽彇銆岄�夐」鍒嗗�笺�嶆椂鐢ㄧ殑鏄� id锛堜富閿級锛�
+            瀵瑰簲 svy_lib_template_targetoption.scriptid銆傛棭鏈熻縼绉绘椂鏇捐鍐欐垚 `svyid as id`锛�
+            瀵艰嚧閫夐」鍒嗗�煎尮閰嶄笉涓� -> 鏈�楂樺垎/鏈�浣庡垎鎭掍负 0.0銆� -->
     <select id="selectSvyScriptByDimension"
             resultType="com.ruoyi.satisfaction.domain.row.SatisfactionSvyScriptRow">
-        select svyid,
-               svyid as id,
-               script_content,
+        select id,
+               svyid,
+               script_content as scriptContent,
                categoryName,
                dimension
         from svy_lib_template_script
@@ -163,6 +173,9 @@
                     #{dimension}
                 </foreach>
             </if>
+            <if test="q.dimensionList == null or q.dimensionList.size() == 0">
+                and dimension IS NOT NULL
+            </if>
         </where>
     </select>
 

--
Gitblit v1.9.3