From 358ca956bcaf02cdfd6ec1af447b966316b83c4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=87=E5=AE=99=E7=9A=AE=E7=9A=AE=E5=A8=83?= <2964346877@qq.com> Date: Tue, 10 Feb 2026 16:41:24 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=87=BA=E9=99=A2=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E4=B8=BA=E7=A9=BA=E7=9A=84=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/docus/server/archive/mapper/TBasicMapper.java | 2 ++ .../service/impl/MzsyPatientInfoSyncServiceImpl.java | 10 +++++++++- .../resources/mapper/MzsyPatientInfoViewMapper.xml | 1 + src/main/resources/mapper/TBasicMapper.xml | 7 +++++++ 4 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/docus/server/archive/mapper/TBasicMapper.java b/src/main/java/com/docus/server/archive/mapper/TBasicMapper.java index ddb8069..84ebf91 100644 --- a/src/main/java/com/docus/server/archive/mapper/TBasicMapper.java +++ b/src/main/java/com/docus/server/archive/mapper/TBasicMapper.java @@ -21,6 +21,8 @@ public interface TBasicMapper { int insertBatch(@Param("basicList") List basicList); + int deleteBatch(@Param("jzhs") List jzhs); + int updateBatch(@Param("basicList") List updateList); int updateExtend(@Param("basicList") List basicList); diff --git a/src/main/java/com/docus/server/archive/service/impl/MzsyPatientInfoSyncServiceImpl.java b/src/main/java/com/docus/server/archive/service/impl/MzsyPatientInfoSyncServiceImpl.java index 42a2a67..be90b22 100644 --- a/src/main/java/com/docus/server/archive/service/impl/MzsyPatientInfoSyncServiceImpl.java +++ b/src/main/java/com/docus/server/archive/service/impl/MzsyPatientInfoSyncServiceImpl.java @@ -96,9 +96,14 @@ public class MzsyPatientInfoSyncServiceImpl implements PatientInfoSyncService { Map existsJzhBasicMap = existsBasicList.stream().collect(Collectors.toMap(TBasic::getJzh, Function.identity())); List insertBasicList = new ArrayList<>(); List updateBasicList = new ArrayList<>(); + List deleteList = new ArrayList<>(); List leaveMethodList = new ArrayList<>(); for (TBasic iuBasic : iuBasicList) { if (existsJzhBasicMap.containsKey(iuBasic.getJzh())) { + if (ObjectUtil.isEmpty(iuBasic.getDisDate())) { + deleteList.add(iuBasic.getJzh()); + continue; + } TBasic tBasic = existsJzhBasicMap.get(iuBasic.getJzh()); tBasic.setName(iuBasic.getName()); tBasic.setInpatientNo(iuBasic.getInpatientNo()); @@ -142,7 +147,10 @@ public class MzsyPatientInfoSyncServiceImpl implements PatientInfoSyncService { } insertBasicList.add(iuBasic); } - + if (Func.isNotEmpty(deleteList)) { + tBasicMapper.deleteBatch(deleteList); + syncZkInfo(insertBasicList); + } if (Func.isNotEmpty(insertBasicList)) { tBasicMapper.insertBatch(insertBasicList); syncZkInfo(insertBasicList); diff --git a/src/main/resources/mapper/MzsyPatientInfoViewMapper.xml b/src/main/resources/mapper/MzsyPatientInfoViewMapper.xml index f459d71..b18c794 100644 --- a/src/main/resources/mapper/MzsyPatientInfoViewMapper.xml +++ b/src/main/resources/mapper/MzsyPatientInfoViewMapper.xml @@ -9,6 +9,7 @@ FROM (select ROW_NUMBER()over(order by jzh) as ROWNUMBER,* from dbo.V_JSWZH_BASE_ZL where CONVERT(DATETIME, cyrq) > #{cyrqStart} + or CONVERT(DATETIME, updated_time) > #{cyrqStart} ) AS v WHERE v.ROWNUMBER BETWEEN ${(pageNum-1)*pageSize+1} AND ${pageNum*pageSize} diff --git a/src/main/resources/mapper/TBasicMapper.xml b/src/main/resources/mapper/TBasicMapper.xml index 43d3e20..dab32cb 100644 --- a/src/main/resources/mapper/TBasicMapper.xml +++ b/src/main/resources/mapper/TBasicMapper.xml @@ -64,6 +64,13 @@ delete from docus_medicalrecord.t_basic_zk_info where patient_id = #{patientId} + + delete from docus_medicalrecord.t_basic + where jzh in + + #{jzh} + +