From 9db295a6e2a7be9ab74e23d3fcf002086cc5713e Mon Sep 17 00:00:00 2001
From: 陈昶聿 <chychen@nbjetron.com>
Date: 星期五, 04 九月 2026 16:43:51 +0800
Subject: [PATCH] 【市一】处理市一同步
---
smartor/src/main/resources/mapper/smartor/PatMedOperationItemMapper.xml | 262 ++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 261 insertions(+), 1 deletions(-)
diff --git a/smartor/src/main/resources/mapper/smartor/PatMedOperationItemMapper.xml b/smartor/src/main/resources/mapper/smartor/PatMedOperationItemMapper.xml
index 080bf13..f654970 100644
--- a/smartor/src/main/resources/mapper/smartor/PatMedOperationItemMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/PatMedOperationItemMapper.xml
@@ -29,10 +29,27 @@
<result property="pid" column="pid"/>
<result property="opercheckFlag" column="opercheck_flag"/>
<result property="longTaskReason" column="long_task_reason"/>
+ <result property="inhospstate" column="inhospstate"/>
+ <result property="inhospEndtime" column="inhosp_endtime"/>
+ <result property="serialnum" column="serialnum"/>
+
+ <result property="deptcode" column="deptcode"/>
+ <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="patid" column="patid"/>
+ <result property="drcode" column="drcode"/>
+ <result property="drname" column="drname"/>
+ <result property="nurseId" column="nurse_id"/>
+ <result property="nurseName" column="nurse_name"/>
</resultMap>
<sql id="selectPatMedOperationItemVo">
- select id, operationid, opid, opcode, opdesc, main_flag, incitypecode, incitypedesc, oplevelcode, opleveldesc, opposition, del_flag, update_by, update_time, create_by, create_time, isupload, upload_time, orgid, pguid, guid, pid, opercheck_flag, long_task_reason
+ select id, operationid, opid, opcode, opdesc, main_flag, incitypecode, incitypedesc, oplevelcode, opleveldesc, opposition, del_flag, update_by, update_time, create_by, create_time, isupload, upload_time, orgid, pguid, guid, pid, opercheck_flag, long_task_reason, inhospstate, serialnum
from pat_med_operation_item
</sql>
@@ -87,6 +104,12 @@
</if>
<if test="pid != null ">
and pid = #{pid}
+ </if>
+ <if test="inhospstate != null and inhospstate != ''">
+ and inhospstate = #{inhospstate}
+ </if>
+ <if test="serialnum != null and serialnum != ''">
+ and serialnum = #{serialnum}
</if>
</select>
@@ -145,6 +168,10 @@
</if>
<if test="longTaskReason != null">long_task_reason,
</if>
+ <if test="inhospstate != null">inhospstate,
+ </if>
+ <if test="serialnum != null">serialnum,
+ </if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="operationid != null">#{operationid},
@@ -192,6 +219,10 @@
<if test="opercheckFlag != null">#{opercheckFlag},
</if>
<if test="longTaskReason != null">#{longTaskReason},
+ </if>
+ <if test="inhospstate != null">#{inhospstate},
+ </if>
+ <if test="serialnum != null">#{serialnum},
</if>
</trim>
</insert>
@@ -268,8 +299,94 @@
<if test="longTaskReason != null">long_task_reason =
#{longTaskReason},
</if>
+ <if test="inhospstate != null">inhospstate =
+ #{inhospstate},
+ </if>
+ <if test="serialnum != null">serialnum =
+ #{serialnum},
+ </if>
</trim>
where id = #{id}
+ </update>
+
+ <update id="updatePatMedOperationItemByOperationid" parameterType="com.smartor.domain.PatMedOperationItem">
+ update pat_med_operation_item
+ <trim prefix="SET" suffixOverrides=",">
+ <if test="opid != null">opid =
+ #{opid},
+ </if>
+ <if test="opcode != null">opcode =
+ #{opcode},
+ </if>
+ <if test="opdesc != null">opdesc =
+ #{opdesc},
+ </if>
+ <if test="mainFlag != null">main_flag =
+ #{mainFlag},
+ </if>
+ <if test="incitypecode != null">incitypecode =
+ #{incitypecode},
+ </if>
+ <if test="incitypedesc != null">incitypedesc =
+ #{incitypedesc},
+ </if>
+ <if test="oplevelcode != null">oplevelcode =
+ #{oplevelcode},
+ </if>
+ <if test="opleveldesc != null">opleveldesc =
+ #{opleveldesc},
+ </if>
+ <if test="opposition != null">opposition =
+ #{opposition},
+ </if>
+ <if test="delFlag != null">del_flag =
+ #{delFlag},
+ </if>
+ <if test="updateBy != null">update_by =
+ #{updateBy},
+ </if>
+ <if test="updateTime != null">update_time =
+ #{updateTime},
+ </if>
+ <if test="createBy != null">create_by =
+ #{createBy},
+ </if>
+ <if test="createTime != null">create_time =
+ #{createTime},
+ </if>
+ <if test="isupload != null">isupload =
+ #{isupload},
+ </if>
+ <if test="uploadTime != null">upload_time =
+ #{uploadTime},
+ </if>
+ <if test="orgid != null">orgid =
+ #{orgid},
+ </if>
+ <if test="pguid != null">pguid =
+ #{pguid},
+ </if>
+ <if test="guid != null">guid =
+ #{guid},
+ </if>
+ <if test="pid != null">pid =
+ #{pid},
+ </if>
+ <if test="opercheckFlag != null">opercheck_flag =
+ #{opercheckFlag},
+ </if>
+ <if test="longTaskReason != null">long_task_reason =
+ #{longTaskReason},
+ </if>
+ <if test="inhospstate != null">inhospstate =
+ #{inhospstate},
+ </if>
+ <if test="serialnum != null">serialnum =
+ #{serialnum},
+ </if>
+ </trim>
+ where operationid = #{operationid}
+ and opcode = #{opcode}
</update>
<insert id="insertPatMedOperationItems">
@@ -321,6 +438,10 @@
</if>
<if test="longTaskReason != null">long_task_reason,
</if>
+ <if test="inhospstate != null">inhospstate,
+ </if>
+ <if test="serialnum != null">serialnum,
+ </if>
</trim>
values
<foreach item="item" index="index" collection="list" separator=",">
@@ -371,6 +492,10 @@
</if>
<if test="longTaskReason != null">#{item.longTaskReason},
</if>
+ <if test="inhospstate != null">#{item.inhospstate},
+ </if>
+ <if test="serialnum != null">#{item.serialnum},
+ </if>
</trim>
</foreach>
</insert>
@@ -397,7 +522,142 @@
<delete id="deleteHardPatMedOperationItemByOpId" parameterType="String">
delete from pat_med_operation_item
where opid = #{opid}
+ and opercheck_flag != 1
</delete>
+ <update id="deletePatMedOperationItemByOperationid" parameterType="Long">
+ update pat_med_operation_item
+ <trim prefix="SET" suffixOverrides=",">
+ del_flag =1
+ </trim>
+ where operationid = #{operationid}
+ and opercheck_flag != 1
+ </update>
+
+ <update id="deleteSoftPatMedOperationItemByOpId" parameterType="String">
+ update pat_med_operation_item
+ <trim prefix="SET" suffixOverrides=",">
+ del_flag =1
+ </trim>
+ where opid = #{opid}
+ </update>
+
+ <select id="selectOperationItemList" parameterType="com.smartor.domain.PatMedOperationItem"
+ resultMap="PatMedOperationItemResult">
+ select pmoi.id, pmoi.operationid, pmoi.opid, pmoi.opcode, pmoi.opdesc, pmoi.main_flag, pmoi.incitypecode,
+ pmoi.incitypedesc, pmoi.oplevelcode, pmoi.opleveldesc, pmoi.opposition, pmoi.del_flag, pmoi.update_by,
+ pmoi.update_time, pmoi.create_by, pmoi.create_time, pmoi.isupload, pmoi.upload_time, pmoi.orgid,
+ pmoi.pguid, pmoi.guid, pmoi.pid, pmoi.opercheck_flag, pmoi.long_task_reason,
+ pmo.deptcode, pmo.deptname, pmo.hospitaldistrictcode, pmo.hospitaldistrictname,
+ pmo.leaveldeptcode, pmo.leaveldeptname, pmo.leavehospitaldistrictcode, pmo.leavehospitaldistrictname, pmo.patid,
+ pmo.drcode, pmo.drname, pmo.nurse_id, pmo.nurse_name,
+ pmo.serialnum, pmi.inhospstate
+ from pat_med_operation pmo
+ join pat_med_operation_item pmoi
+ on pmoi.opid = pmo.opid
+ join pat_med_inhosp pmi
+ on pmo.serialnum = pmi.serialnum
+ where
+ pmo.del_flag = '0'
+ and pmoi.del_flag = '0'
+ and pmo.opid is not null
+ and pmoi.opid is not null
+ <if test="operationid != null ">
+ and pmoi.operationid = #{operationid}
+ </if>
+ <if test="opid != null ">
+ and pmoi.opid = #{opid}
+ </if>
+ <if test="opcode != null and opcode != ''">
+ and pmoi.opcode = #{opcode}
+ </if>
+ <if test="opdesc != null and opdesc != ''">
+ and pmoi.opdesc = #{opdesc}
+ </if>
+ <if test="mainFlag != null and mainFlag != ''">
+ and pmoi.main_flag = #{mainFlag}
+ </if>
+ <if test="incitypecode != null and incitypecode != ''">
+ and pmoi.incitypecode = #{incitypecode}
+ </if>
+ <if test="incitypedesc != null and incitypedesc != ''">
+ and pmoi.incitypedesc = #{incitypedesc}
+ </if>
+ <if test="oplevelcode != null and oplevelcode != ''">
+ and pmoi.oplevelcode = #{oplevelcode}
+ </if>
+ <if test="opleveldesc != null and opleveldesc != ''">
+ and pmoi.opleveldesc = #{opleveldesc}
+ </if>
+ <if test="opposition != null and opposition != ''">
+ and pmoi.opposition = #{opposition}
+ </if>
+ <if test="isupload != null ">
+ and pmoi.isupload = #{isupload}
+ </if>
+ <if test="uploadTime != null ">
+ and pmoi.upload_time = #{uploadTime}
+ </if>
+ <if test="orgid != null and orgid != ''">
+ and pmoi.orgid = #{orgid}
+ </if>
+ <if test="pguid != null and pguid != ''">
+ and pmoi.pguid = #{pguid}
+ </if>
+ <if test="guid != null and guid != ''">
+ and pmoi.guid = #{guid}
+ </if>
+ <if test="pid != null ">
+ and pmoi.pid = #{pid}
+ </if>
+ <if test="inhospstate != null and inhospstate != ''">
+ and pmi.inhospstate = #{inhospstate}
+ <if test="inhospstate == '1'">
+ and pmi.endtime is not null
+ </if>
+ </if>
+ <if test="serialnum != null and serialnum != ''">
+ and pmo.serialnum = #{serialnum}
+ </if>
+ <if test="deptcode != null and deptcode != ''">
+ and pmo.deptcode = #{deptcode}
+ </if>
+ <if test="deptname != null and deptname != ''">
+ and pmo.deptname = #{deptname}
+ </if>
+ <if test="hospitaldistrictcode != null and hospitaldistrictcode != ''">
+ and pmo.hospitaldistrictcode = #{hospitaldistrictcode}
+ </if>
+ <if test="hospitaldistrictname != null and hospitaldistrictname != ''">
+ and pmo.hospitaldistrictname = #{hospitaldistrictname}
+ </if>
+ <if test="patid != null">
+ and pmo.patid = #{patid}
+ </if>
+ <if test="deptCodes != null and deptCodes.size()>0">
+ AND pmo.deptcode IN
+ <foreach collection="deptCodes" item="deptcode" open="(" separator=","
+ close=")">
+ #{deptcode}
+ </foreach>
+ </if>
+ <if test="wardCodes != null and wardCodes.size()>0">
+ AND pmo.hospitaldistrictcode IN
+ <foreach collection="wardCodes" item="wardCode" open="(" separator=","
+ close=")">
+ #{wardCode}
+ </foreach>
+ </if>
+ <if test="opLevelCodes != null and opLevelCodes.size()>0">
+ AND pmoi.oplevelcode IN
+ <foreach collection="opLevelCodes" item="levelCode" open="(" separator=","
+ close=")">
+ #{levelCode}
+ </foreach>
+ </if>
+ <if test="opercheckFlag != null">
+ and pmoi.opercheck_flag = #{opercheckFlag}
+ </if>
+ </select>
</mapper>
--
Gitblit v1.9.3