From efaa2a7a5b7d9d1a36f4d6a7e275d2b76f6cd9d3 Mon Sep 17 00:00:00 2001
From: 陈昶聿 <chychen@nbjetron.com>
Date: 星期四, 06 八月 2026 18:06:09 +0800
Subject: [PATCH] 【景宁】查询随访任务组科室关联列表、查询随访任务组疾病关联列表

---
 smartor/src/main/resources/mapper/smartor/PatMedOperationMapper.xml |  188 ++++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 160 insertions(+), 28 deletions(-)

diff --git a/smartor/src/main/resources/mapper/smartor/PatMedOperationMapper.xml b/smartor/src/main/resources/mapper/smartor/PatMedOperationMapper.xml
index 880a5cc..7f5cc26 100644
--- a/smartor/src/main/resources/mapper/smartor/PatMedOperationMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/PatMedOperationMapper.xml
@@ -12,8 +12,8 @@
         <result property="opreqid" column="opreqid"/>
         <result property="opreqcode" column="opreqcode"/>
         <result property="opsstatus" column="opsstatus"/>
-        <result property="operationcode" column="operationcode"/>
-        <result property="operationname" column="operationname"/>
+        <result property="optypecode" column="optypecode"/>
+        <result property="optypename" column="optypename"/>
         <result property="operatortime" column="operatortime"/>
         <result property="opreqtime" column="opreqtime"/>
         <result property="reqdoccode" column="reqdoccode"/>
@@ -63,12 +63,23 @@
         <result property="deptname" column="deptname"/>
         <result property="hospitaldistrictcode" column="hospitaldistrictcode"/>
         <result property="hospitaldistrictname" column="hospitaldistrictname"/>
+        <result property="leaveldeptcode" column="leaveldeptcode"/>
+        <result property="leaveldeptname" column="leaveldeptname"/>
+        <result property="leavehospitaldistrictcode" column="leavehospitaldistrictcode"/>
+        <result property="leavehospitaldistrictname" column="leavehospitaldistrictname"/>
         <result property="roomno" column="roomno"/>
         <result property="bedNo" column="bed_no"/>
         <result property="drcode" column="drcode"/>
         <result property="drname" column="drname"/>
         <result property="nurseId" column="nurse_id"/>
         <result property="nurseName" column="nurse_name"/>
+        <result property="checkFlag" column="check_flag"/>
+        <result property="longTaskReason" column="long_task_reason"/>
+        <result property="opid" column="opid"/>
+        <result property="opcode" column="opcode"/>
+        <result property="opdesc" column="opdesc"/>
+        <result property="oplevelcode" column="oplevelcode"/>
+        <result property="opleveldesc" column="opleveldesc"/>
     </resultMap>
 
     <sql id="selectPatMedOperationVo">
@@ -79,8 +90,8 @@
                opreqid,
                opreqcode,
                opsstatus,
-               operationcode,
-               operationname,
+               optypecode,
+               optypename,
                operatortime,
                opreqtime,
                reqdoccode,
@@ -130,19 +141,31 @@
                deptname,
                hospitaldistrictcode,
                hospitaldistrictname,
+               leaveldeptcode,
+               leaveldeptname,
+               leavehospitaldistrictcode,
+               leavehospitaldistrictname,
                roomno,
                bed_no,
                drcode,
                drname,
                nurse_id,
-               nurse_name
+               nurse_name,
+               check_flag,
+               long_task_reason,
+               opid,
+               opcode,
+               opdesc,
+               oplevelcode,
+               opleveldesc
         from pat_med_operation
     </sql>
 
     <select id="selectPatMedOperationList" parameterType="com.smartor.domain.PatMedOperation"
             resultMap="PatMedOperationResult">
         <include refid="selectPatMedOperationVo"/>
-        <where>
+        where 1=1
+            and del_flag='0'
             <if test="patid != null ">
                 and patid = #{patid}
             </if>
@@ -161,15 +184,20 @@
             <if test="opsstatus != null  and opsstatus != ''">
                 and opsstatus = #{opsstatus}
             </if>
-            <if test="operationcode != null  and operationcode != ''">
-                and operationcode = #{operationcode}
+            <if test="optypecode != null  and optypecode != ''">
+                and optypecode = #{optypecode}
             </if>
-            <if test="operationname != null  and operationname != ''">
-                and operationname like concat('%', #{operationname}, '%')
+            <if test="optypename != null  and optypename != ''">
+                and optypename like concat('%', #{optypename}, '%')
             </if>
-
-            <if test="operatortime != null ">
-                and operatortime = #{operatortime}
+            <!--            <if test="operatortime != null ">-->
+            <!--                and operatortime = #{operatortime}-->
+            <!--            </if>-->
+            <if test="beginTime != null ">and date_format(operatortime,'%y%m%d') &gt;=
+                date_format(#{beginTime},'%y%m%d')
+            </if>
+            <if test="endTime != null ">and date_format(operatortime,'%y%m%d') &lt;=
+                date_format(#{endTime},'%y%m%d')
             </if>
             <if test="opreqtime != null ">
                 and opreqtime = #{opreqtime}
@@ -297,6 +325,18 @@
             <if test="hospitaldistrictname != null  and hospitaldistrictname != ''">
                 and hospitaldistrictname like concat('%', #{hospitaldistrictname}, '%')
             </if>
+            <if test="leaveldeptcode != null  and leaveldeptcode != ''">
+                and leaveldeptcode = #{leaveldeptcode}
+            </if>
+            <if test="leaveldeptname != null  and leaveldeptname != ''">
+                and leaveldeptname like concat('%', #{leaveldeptname}, '%')
+            </if>
+            <if test="leavehospitaldistrictcode != null  and leavehospitaldistrictcode != ''">
+                and leavehospitaldistrictcode = #{leavehospitaldistrictcode}
+            </if>
+            <if test="leavehospitaldistrictname != null  and leavehospitaldistrictname != ''">
+                and leavehospitaldistrictname like concat('%', #{leavehospitaldistrictname}, '%')
+            </if>
             <if test="roomno != null  and roomno != ''">
                 and roomno = #{roomno}
             </if>
@@ -315,7 +355,27 @@
             <if test="nurseName != null  and nurseName != ''">
                 and nurse_name like concat('%', #{nurseName}, '%')
             </if>
-        </where>
+            <if test="checkFlag != null  and checkFlag != ''">
+                and check_flag = #{checkFlag}
+            </if>
+            <if test="longTaskReason != null  and longTaskReason != ''">
+                and long_task_reason = #{longTaskReason}
+            </if>
+            <if test="opid != null  and opid != ''">
+                and opid = #{opid}
+            </if>
+            <if test="opcode != null  and opcode != ''">
+                and opcode = #{opcode}
+            </if>
+            <if test="opdesc != null  and opdesc != ''">
+                and opdesc = #{opdesc}
+            </if>
+            <if test="oplevelcode != null  and oplevelcode != ''">
+                and oplevelcode = #{oplevelcode}
+            </if>
+            <if test="opleveldesc != null  and opleveldesc != ''">
+                and opleveldesc = #{opleveldesc}
+            </if>
     </select>
 
     <select id="selectPatMedOperationById" parameterType="Long"
@@ -324,12 +384,9 @@
         where id = #{id}
     </select>
 
-    <insert id="insertPatMedOperation" parameterType="com.smartor.domain.PatMedOperation" useGeneratedKeys="true"
-            keyProperty="id">
+    <insert id="insertPatMedOperation" parameterType="com.smartor.domain.PatMedOperation" useGeneratedKeys="true" keyProperty="id">
         insert into pat_med_operation
         <trim prefix="(" suffix=")" suffixOverrides=",">
-            <if test="id != null">id,
-            </if>
             <if test="patid != null">patid,
             </if>
             <if test="patcode != null">patcode,
@@ -342,9 +399,9 @@
             </if>
             <if test="opsstatus != null">opsstatus,
             </if>
-            <if test="operationcode != null">operationcode,
+            <if test="optypecode != null">optypecode,
             </if>
-            <if test="operationname != null">operationname,
+            <if test="optypename != null">optypename,
             </if>
             <if test="operatortime != null">operatortime,
             </if>
@@ -444,6 +501,14 @@
             </if>
             <if test="hospitaldistrictname != null">hospitaldistrictname,
             </if>
+            <if test="leaveldeptcode != null">leaveldeptcode,
+            </if>
+            <if test="leaveldeptname != null">leaveldeptname,
+            </if>
+            <if test="leavehospitaldistrictcode != null">leavehospitaldistrictcode,
+            </if>
+            <if test="leavehospitaldistrictname != null">leavehospitaldistrictname,
+            </if>
             <if test="roomno != null">roomno,
             </if>
             <if test="bedNo != null">bed_no,
@@ -456,10 +521,22 @@
             </if>
             <if test="nurseName != null">nurse_name,
             </if>
+            <if test="checkFlag != null">check_flag,
+            </if>
+            <if test="longTaskReason != null">long_task_reason,
+            </if>
+            <if test="opid != null">opid,
+            </if>
+            <if test="opcode != null">opcode,
+            </if>
+            <if test="opdesc != null">opdesc,
+            </if>
+            <if test="oplevelcode != null">oplevelcode,
+            </if>
+            <if test="opleveldesc != null">opleveldesc,
+            </if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
-            <if test="id != null">#{id},
-            </if>
             <if test="patid != null">#{patid},
             </if>
             <if test="patcode != null">#{patcode},
@@ -472,9 +549,9 @@
             </if>
             <if test="opsstatus != null">#{opsstatus},
             </if>
-            <if test="operationcode != null">#{operationcode},
+            <if test="optypecode != null">#{optypecode},
             </if>
-            <if test="operationname != null">#{operationname},
+            <if test="optypename != null">#{optypename},
             </if>
             <if test="operatortime != null">#{operatortime},
             </if>
@@ -574,6 +651,14 @@
             </if>
             <if test="hospitaldistrictname != null">#{hospitaldistrictname},
             </if>
+            <if test="leaveldeptcode != null">#{leaveldeptcode},
+            </if>
+            <if test="leaveldeptname != null">#{leaveldeptname},
+            </if>
+            <if test="leavehospitaldistrictcode != null">#{leavehospitaldistrictcode},
+            </if>
+            <if test="leavehospitaldistrictname != null">#{leavehospitaldistrictname},
+            </if>
             <if test="roomno != null">#{roomno},
             </if>
             <if test="bedNo != null">#{bedNo},
@@ -585,6 +670,20 @@
             <if test="nurseId != null">#{nurseId},
             </if>
             <if test="nurseName != null">#{nurseName},
+            </if>
+            <if test="checkFlag != null">#{checkFlag},
+            </if>
+            <if test="longTaskReason != null">#{longTaskReason},
+            </if>
+            <if test="opid != null">#{opid},
+            </if>
+            <if test="opcode != null">#{opcode},
+            </if>
+            <if test="opdesc != null">#{opdesc},
+            </if>
+            <if test="oplevelcode != null">#{oplevelcode},
+            </if>
+            <if test="opleveldesc != null">#{opleveldesc},
             </if>
         </trim>
     </insert>
@@ -610,11 +709,11 @@
             <if test="opsstatus != null">opsstatus =
                 #{opsstatus},
             </if>
-            <if test="operationcode != null">operationcode =
-                #{operationcode},
+            <if test="optypecode != null">optypecode =
+                #{optypecode},
             </if>
-            <if test="operationname != null">operationname =
-                #{operationname},
+            <if test="optypename != null">optypename =
+                #{optypename},
             </if>
             <if test="operatortime != null">operatortime =
                 #{operatortime},
@@ -763,6 +862,18 @@
             <if test="hospitaldistrictname != null">hospitaldistrictname =
                 #{hospitaldistrictname},
             </if>
+            <if test="leaveldeptcode != null">leaveldeptcode =
+                #{leaveldeptcode},
+            </if>
+            <if test="leaveldeptname != null">leaveldeptname =
+                #{leaveldeptname},
+            </if>
+            <if test="leavehospitaldistrictcode != null">leavehospitaldistrictcode =
+                #{leavehospitaldistrictcode},
+            </if>
+            <if test="leavehospitaldistrictname != null">leavehospitaldistrictname =
+                #{leavehospitaldistrictname},
+            </if>
             <if test="roomno != null">roomno =
                 #{roomno},
             </if>
@@ -781,6 +892,27 @@
             <if test="nurseName != null">nurse_name =
                 #{nurseName},
             </if>
+            <if test="checkFlag != null">check_flag =
+                #{checkFlag},
+            </if>
+            <if test="longTaskReason != null">long_task_reason =
+                #{longTaskReason},
+            </if>
+            <if test="opid != null">opid =
+                #{opid},
+            </if>
+            <if test="opcode != null">opcode =
+                #{opcode},
+            </if>
+            <if test="opdesc != null">opdesc =
+                #{opdesc},
+            </if>
+            <if test="oplevelcode != null">oplevelcode =
+                #{oplevelcode},
+            </if>
+            <if test="opleveldesc != null">opleveldesc =
+                #{opleveldesc},
+            </if>
         </trim>
         where id = #{id}
     </update>

--
Gitblit v1.9.3