From 5a6f20263ef584485ae3df8b6f25b4e2fb970293 Mon Sep 17 00:00:00 2001 From: liusheng <337615773@qq.com> Date: 星期三, 23 七月 2025 15:07:31 +0800 Subject: [PATCH] 代码提交 --- smartor/src/main/java/com/smartor/domain/PatArchive.java | 11 +++++++++++ smartor/src/main/java/com/smartor/mapper/HNGatherPatArchiveMapper.java | 1 + smartor/src/main/resources/mapper/smartor/PatArchiveMapper.xml | 2 -- smartor/src/main/resources/mapper/smartor/HNGatherPatArchiveMapper.xml | 5 +++++ smartor/src/main/java/com/smartor/service/impl/HNGatherPatArchiveServiceImpl.java | 31 ++++++++++++++++++++----------- 5 files changed, 37 insertions(+), 13 deletions(-) diff --git a/smartor/src/main/java/com/smartor/domain/PatArchive.java b/smartor/src/main/java/com/smartor/domain/PatArchive.java index d24b496..8a8701c 100644 --- a/smartor/src/main/java/com/smartor/domain/PatArchive.java +++ b/smartor/src/main/java/com/smartor/domain/PatArchive.java @@ -404,5 +404,16 @@ */ @ApiModelProperty("pageSize") private Integer pageSize; + /** + * pageNum + */ + @ApiModelProperty("pn") + private Integer pn; + + /** + * pageSize + */ + @ApiModelProperty("ps") + private Integer ps; } diff --git a/smartor/src/main/java/com/smartor/mapper/HNGatherPatArchiveMapper.java b/smartor/src/main/java/com/smartor/mapper/HNGatherPatArchiveMapper.java index 171fa9f..064c568 100644 --- a/smartor/src/main/java/com/smartor/mapper/HNGatherPatArchiveMapper.java +++ b/smartor/src/main/java/com/smartor/mapper/HNGatherPatArchiveMapper.java @@ -36,6 +36,7 @@ public List<PatMedInhosp> selectPatMedInhospList(PatMedInhosp patMedInhosp); public Long selectPatMedInhospListCount(PatMedInhosp patMedInhosp); + public Long selectPatArchiveCount(PatMedInhosp patMedInhosp); /** * 闂ㄦ�ヨ瘖淇℃伅 diff --git a/smartor/src/main/java/com/smartor/service/impl/HNGatherPatArchiveServiceImpl.java b/smartor/src/main/java/com/smartor/service/impl/HNGatherPatArchiveServiceImpl.java index 78f7303..06e766b 100644 --- a/smartor/src/main/java/com/smartor/service/impl/HNGatherPatArchiveServiceImpl.java +++ b/smartor/src/main/java/com/smartor/service/impl/HNGatherPatArchiveServiceImpl.java @@ -73,6 +73,22 @@ @Override public Integer selectPatMedInhospList(PatMedInhosp patMedInhosp) { + Long patArchiveCount = hnGatherPatArchiveMapper.selectPatArchiveCount(null); + Long patOffst = (patArchiveCount + 1000 - 1) / 1000; + PatArchive patArchive = new PatArchive(); + Long patSize = 0L; + for (int i = 0; i <= patOffst; i++) { + patArchive.setPs(1000); + patArchive.setPn(1000 * i); + List<PatArchive> patArchives = hnGatherPatArchiveMapper.selectPatArchiveList(patArchive); + if (patArchives != null && !patArchives.isEmpty()) { + patArchiveMapper.insertPatArchive(patArchives); + } + patSize = patSize + patArchives.size(); + } + log.info("patArchives澶勭悊缁撴潫涓�鍏�:{}", patSize); + + Long count = hnGatherPatArchiveMapper.selectPatMedInhospListCount(null); Long aa = (count + 1000 - 1) / 1000; //杩涜鍒嗛〉鏌ヨ @@ -82,18 +98,12 @@ List<PatMedInhosp> patMedInhospList = hnGatherPatArchiveMapper.selectPatMedInhospList(patMedInhosp); for (PatMedInhosp pm : patMedInhospList) { String patno = pm.getPatno(); - PatArchive patArchive = new PatArchive(); + PatArchive pa = new PatArchive(); //鍏堝幓鎴戜滑鑷繁鐨勮〃閲岄�氳繃patno鏌ヨ璇ユ偅鑰呮槸鍚﹀瓨鍦� - patArchive.setPatientno(patno); - List<PatArchive> patArchives = patArchiveMapper.selectPatArchiveList(patArchive); + pa.setPatientno(patno); + List<PatArchive> patArchives = patArchiveMapper.selectPatArchiveList(pa); if (CollectionUtils.isEmpty(patArchives)) { - //涓嶅瓨鍦紝鍒欓�氳繃patno鍘籋IS琛╤zjbxx鏌ヨ - List<PatArchive> patArchives1 = hnGatherPatArchiveMapper.selectPatArchiveList(patArchive); - //鎶婃煡璇㈠嚭鏉ョ殑鏁版嵁瀛樺埌pat_archive琛� - PatArchive pa = patArchives1.get(0); - pa.setId(null); - patArchiveMapper.insertPatArchiveSingle(pa); - pm.setPatid(pa.getId()); + continue; } else { //鐩存帴灏唒atid鏀惧埌鍑哄叆闄㈣〃涓� pm.setPatid(patArchives.get(0).getId()); @@ -103,7 +113,6 @@ patMedInhospMapper.insertPatMedInhospBatch(patMedInhospList); } } - return null; } diff --git a/smartor/src/main/resources/mapper/smartor/HNGatherPatArchiveMapper.xml b/smartor/src/main/resources/mapper/smartor/HNGatherPatArchiveMapper.xml index 69a0f90..5592a9f 100644 --- a/smartor/src/main/resources/mapper/smartor/HNGatherPatArchiveMapper.xml +++ b/smartor/src/main/resources/mapper/smartor/HNGatherPatArchiveMapper.xml @@ -389,6 +389,7 @@ <if test="filterDrname != null ">and filter_drname = #{filterDrname}</if> <if test="filterDrcode != null ">and filter_drcode = #{filterDrcode}</if> </where> + limit #{ps} OFFSET #{pn} </select> @@ -396,6 +397,10 @@ select count(*) FROM cryxx </select> + <select id="selectPatArchiveCount" parameterType="com.smartor.domain.PatMedInhosp" resultType="Long"> + select count(*) + FROM hzjbxx + </select> <select id="selectPatMedInhospList" parameterType="com.smartor.domain.PatMedInhosp" resultMap="PatMedInhospResult"> diff --git a/smartor/src/main/resources/mapper/smartor/PatArchiveMapper.xml b/smartor/src/main/resources/mapper/smartor/PatArchiveMapper.xml index 2b6dc92..d26ad2d 100644 --- a/smartor/src/main/resources/mapper/smartor/PatArchiveMapper.xml +++ b/smartor/src/main/resources/mapper/smartor/PatArchiveMapper.xml @@ -996,8 +996,6 @@ a.place_of_residence, a.birthplace, a.birthdate, - -- a.icd10code as leaveicd10code, - -- a.diagname as leavediagname, a.age, a.age2, a.viptype, -- Gitblit v1.9.3