From 066e23c438ec762c522d39817b513a13ec6b3767 Mon Sep 17 00:00:00 2001
From: 陈昶聿 <chychen@nbjetron.com>
Date: 星期一, 14 九月 2026 14:03:38 +0800
Subject: [PATCH] 【景宁】景宁 只要存在相同诊断、患者的门诊记录则当再次随访处理

---
 smartor/src/main/resources/mapper/smartor/IvrLibaTemplateScriptMapper.xml |   74 +++++++++++++++++++++++++++++++++---
 1 files changed, 67 insertions(+), 7 deletions(-)

diff --git a/smartor/src/main/resources/mapper/smartor/IvrLibaTemplateScriptMapper.xml b/smartor/src/main/resources/mapper/smartor/IvrLibaTemplateScriptMapper.xml
index ff1d04a..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"/>
@@ -55,13 +55,24 @@
         <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,
@@ -96,7 +107,7 @@
                next_scriptno,
                otherdata,
                score,
-               is_must,
+               ismandatory,
                playWavOnly,
                del_flag,
                update_by,
@@ -170,10 +181,28 @@
         <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>
 
 
@@ -185,6 +214,19 @@
                 <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>
@@ -231,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>
@@ -247,6 +289,12 @@
             <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>
@@ -281,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>
@@ -297,6 +345,12 @@
             <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>
 
@@ -330,11 +384,17 @@
             <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>

--
Gitblit v1.9.3