From 141eef1ac1e9111fb33f96a95b59ba69422f8688 Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期一, 14 九月 2026 17:02:17 +0800
Subject: [PATCH] 1.优化问卷详情的查询速度

---
 smartor/src/main/resources/mapper/smartor/IvrLibaTemplateScriptMapper.xml |  106 ++++++++++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 96 insertions(+), 10 deletions(-)

diff --git a/smartor/src/main/resources/mapper/smartor/IvrLibaTemplateScriptMapper.xml b/smartor/src/main/resources/mapper/smartor/IvrLibaTemplateScriptMapper.xml
index 0231b76..f7d7118 100644
--- a/smartor/src/main/resources/mapper/smartor/IvrLibaTemplateScriptMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/IvrLibaTemplateScriptMapper.xml
@@ -40,7 +40,7 @@
         <result property="scriptTopic" column="script_topic"/>
         <result property="nextScriptno" column="next_scriptno"/>
         <result property="otherdata" column="otherdata"/>
-        <result property="isMust" column="is_must"/>
+        <result property="ismandatory" column="ismandatory"/>
         <result property="scriptDesc" column="script_desc"/>
         <result property="scriptType" column="script_type"/>
         <result property="branchFlag" column="branch_flag"/>
@@ -53,11 +53,27 @@
         <result property="dutyDeptCode" column="duty_dept_code"/>
         <result property="reportDeptCode" column="report_dept_name"/>
         <result property="reportDeptName" column="report_dept_code"/>
+        <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"/>
     </resultMap>
 
     <sql id="selectIvrLibaTemplateScriptVo">
         select id,
                scriptno,
+               is_myd_exception,
+               duty_dept_person_name,
+               duty_dept_person_code,
+               report_dept_person_name,
+               report_dept_person_code,
+               circulation_dept_person_code,
+               circulation_dept_person_name,
+               dimension,
                sort,
                script_assortname,
                duty_dept_name,
@@ -91,7 +107,7 @@
                next_scriptno,
                otherdata,
                score,
-               is_must,
+               ismandatory,
                playWavOnly,
                del_flag,
                update_by,
@@ -111,6 +127,8 @@
         <include refid="selectIvrLibaTemplateScriptVo"/>
         where del_flag = 0
         <if test="scriptno != null ">and scriptno = #{scriptno}</if>
+        <if test="isMydException != null ">and is_myd_exception = #{isMydException}</if>
+        <if test="dimension != null ">and dimension = #{dimension}</if>
         <if test="scriptAssortid != null ">and script_assortid = #{scriptAssortid}</if>
         <if test="groupName != null ">and group_name = #{groupName}</if>
         <if test="scriptDesc != null ">and script_desc = #{scriptDesc}</if>
@@ -163,10 +181,54 @@
         <if test="guid != null  and guid != ''">and guid = #{guid}</if>
         <if test="targetid != null ">and targetid = #{targetid}</if>
         <if test="targetvalue != null  and targetvalue != ''">and targetvalue = #{targetvalue}</if>
-        <if test="isMust != null  and isMust != ''">and is_must = #{isMust}</if>
+        <if test="ismandatory != null  and ismandatory != ''">and ismandatory = #{ismandatory}</if>
         <if test="scriptType != null">and script_type = #{scriptType}</if>
         <if test="sort != null">and sort = #{sort}</if>
         <if test="score != null">and score = #{score}</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>
+    </select>
+
+
+    <select id="selectILTSBydimension" parameterType="com.smartor.domain.IvrLibaTemplateScript"
+            resultMap="IvrLibaTemplateScriptResult">
+        <include refid="selectIvrLibaTemplateScriptVo"/>
+        <where>del_flag=0
+            <if test="dimensionList != null ">and dimension in
+                <foreach item="dimension" collection="dimensionList" open="(" separator="," close=")">
+                    #{dimension}
+                </foreach>
+            </if>
+            <if test="dimensionList == null ">and dimension IS NOT NULL </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>
+        </where>
     </select>
 
     <select id="selectIvrLibaTemplateScriptByID" parameterType="Long" resultMap="IvrLibaTemplateScriptResult">
@@ -211,7 +273,7 @@
             <if test="scriptTopic != null">script_topic,</if>
             <if test="nextScriptno != null">next_scriptno,</if>
             <if test="otherdata != null">otherdata,</if>
-            <if test="isMust != null  and isMust != ''">is_must,</if>
+            <if test="ismandatory != null  and ismandatory != ''">ismandatory,</if>
             <if test="scriptDesc != null ">script_desc,</if>
             <if test="scriptType != null ">script_type,</if>
             <if test="branchFlag != null  and branchFlag != ''">branch_flag,</if>
@@ -225,6 +287,14 @@
             <if test="dutyDeptCode != null  and dutyDeptCode != ''">duty_dept_code,</if>
             <if test="reportDeptName != null  and reportDeptName != ''">report_dept_name,</if>
             <if test="reportDeptCode != null  and reportDeptCode != ''">report_dept_code,</if>
+            <if test="isMydException != null  and isMydException != ''">is_myd_exception,</if>
+            <if test="dimension != null  and dimension != ''">dimension,</if>
+            <if test="dutyDeptPersonName != null  and dutyDeptPersonName != ''">duty_dept_person_name,</if>
+            <if test="dutyDeptPersonCode != null  and dutyDeptPersonCode != ''">duty_dept_person_code,</if>
+            <if test="reportDeptPersonName != null  and reportDeptPersonName != ''">report_dept_person_name,</if>
+            <if test="reportDeptPersonCode != null  and reportDeptPersonCode != ''">report_dept_person_code,</if>
+            <if test="circulationDeptPersonCode != null  and circulationDeptPersonCode != ''">circulation_dept_person_code,</if>
+            <if test="circulationDeptPersonName != null  and circulationDeptPersonName != ''">circulation_dept_person_name,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="scriptno != null">#{scriptno},</if>
@@ -259,7 +329,7 @@
             <if test="scriptTopic != null">#{scriptTopic},</if>
             <if test="nextScriptno != null">#{nextScriptno},</if>
             <if test="otherdata != null">#{otherdata},</if>
-            <if test="isMust != null  and isMust != ''">#{isMust},</if>
+            <if test="ismandatory != null  and ismandatory != ''">#{ismandatory},</if>
             <if test="scriptDesc != null ">#{scriptDesc},</if>
             <if test="scriptType != null ">#{scriptType},</if>
             <if test="branchFlag != null  and branchFlag != ''">#{branchFlag},</if>
@@ -273,6 +343,14 @@
             <if test="dutyDeptCode != null  and dutyDeptCode != ''">#{dutyDeptCode},</if>
             <if test="reportDeptName != null  and reportDeptName != ''">#{reportDeptName},</if>
             <if test="reportDeptCode != null  and reportDeptCode != ''">#{reportDeptCode},</if>
+            <if test="isMydException != null  and isMydException != ''">#{isMydException},</if>
+            <if test="dimension != null  and dimension != ''">#{dimension},</if>
+            <if test="dutyDeptPersonName != null  and dutyDeptPersonName != ''">#{dutyDeptPersonName},</if>
+            <if test="dutyDeptPersonCode != null  and dutyDeptPersonCode != ''">#{dutyDeptPersonCode},</if>
+            <if test="reportDeptPersonName != null  and reportDeptPersonName != ''">#{reportDeptPersonName},</if>
+            <if test="reportDeptPersonCode != null  and reportDeptPersonCode != ''">#{reportDeptPersonCode},</if>
+            <if test="circulationDeptPersonCode != null  and circulationDeptPersonCode != ''">#{circulationDeptPersonCode},</if>
+            <if test="circulationDeptPersonName != null  and circulationDeptPersonName != ''">#{circulationDeptPersonName},</if>
         </trim>
     </insert>
 
@@ -306,13 +384,21 @@
             <if test="orgid != null">orgid = #{orgid},</if>
             <if test="pid != null">pid = #{pid},</if>
             <if test="guid != null">guid = #{guid},</if>
+            <if test="dutyDeptPersonName != null  and dutyDeptPersonName != ''">duty_dept_person_name = #{dutyDeptPersonName},</if>
+            <if test="dutyDeptPersonCode != null  and dutyDeptPersonCode != ''">duty_dept_person_code = #{dutyDeptPersonCode},</if>
+            <if test="reportDeptPersonName != null  and reportDeptPersonName != ''">report_dept_person_name = #{reportDeptPersonName},</if>
+            <if test="reportDeptPersonCode != null  and reportDeptPersonCode != ''">report_dept_person_code = #{reportDeptPersonCode},</if>
+            <if test="circulationDeptPersonName != null  and circulationDeptPersonName != ''">circulation_dept_person_name = #{circulationDeptPersonName},</if>
+            <if test="circulationDeptPersonCode != null  and circulationDeptPersonCode != ''">circulation_dept_person_code = #{circulationDeptPersonCode},</if>
             <if test="targetid != null">targetid = #{targetid},</if>
             <if test="scriptTopic != null">script_topic = #{scriptTopic},</if>
             <if test="nextScriptno != null">next_scriptno = #{nextScriptno},</if>
             <if test="otherdata != null">otherdata = #{otherdata},</if>
-            <if test="isMust != null  and isMust != ''">is_must = #{isMust},</if>
+            <if test="ismandatory != null  and ismandatory != ''">ismandatory = #{ismandatory},</if>
             <if test="scriptDesc != null ">script_desc = #{scriptDesc},</if>
             <if test="scriptType != null ">script_type = #{scriptType},</if>
+            <if test="isMydException != null  and isMydException != ''">is_myd_exception = #{isMydException},</if>
+            <if test="dimension != null  and dimension != ''">dimension = #{dimension},</if>
             <if test="sort != null ">sort = #{sort},</if>
             <if test="ivrtext != null ">ivrtext = #{ivrtext},</if>
             <if test="branchFlag != null  and branchFlag != ''">branch_flag = #{branchFlag},</if>
@@ -350,10 +436,10 @@
         <include refid="selectIvrLibaTemplateScriptVo"/>
         where del_flag=0
         <if test="scriptAssortids != null and scriptAssortids.size > 0">
-        and script_assortid in
-        <foreach item="scriptAssortid" collection="scriptAssortids" open="(" separator="," close=")">
-            #{scriptAssortid}
-        </foreach>
+            and script_assortid in
+            <foreach item="scriptAssortid" collection="scriptAssortids" open="(" separator="," close=")">
+                #{scriptAssortid}
+            </foreach>
         </if>
     </select>
 </mapper>

--
Gitblit v1.9.3