From a6c72f23fc049ccfee326c81d8e3725309bc73d9 Mon Sep 17 00:00:00 2001 From: gongzhenkun <1658878546@qq.com> Date: Wed, 22 Feb 2023 18:11:02 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=B1=E8=AF=8A=E8=AE=B0=E5=BD=95=E5=92=8C?= =?UTF-8?q?=E6=82=A3=E8=80=85=E6=95=B0=E6=8D=AE=E4=B8=8D=E7=AC=A6=E5=90=88?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ruoyi/system/domain/TRecord.java | 22 +++++++++++++++++++ .../ruoyi/system/mapper/TRecordMapper.java | 7 ++++++ .../service/impl/TPatientServiceImpl.java | 5 ++++- .../mapper/system/THospitalMapper.xml | 1 + .../resources/mapper/system/TRecordMapper.xml | 22 +++++++++++++++++++ 5 files changed, 56 insertions(+), 1 deletion(-) diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/TRecord.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/TRecord.java index 95db218..ab99ad7 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain/TRecord.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/TRecord.java @@ -94,6 +94,28 @@ public class TRecord extends BaseEntity */ private int appDealTime; + //医院名称 + private String hospitalName; + + //医生姓名 + private String doctorName; + + public void setHospitalName(String hospitalName) { + this.hospitalName = hospitalName; + } + + public void setDoctorName(String doctorName) { + this.doctorName = doctorName; + } + + public String getHospitalName() { + return hospitalName; + } + + public String getDoctorName() { + return doctorName; + } + public int getAppDealTime() { return appDealTime; } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TRecordMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TRecordMapper.java index 02ae4fb..6b75642 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TRecordMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TRecordMapper.java @@ -167,4 +167,11 @@ public interface TRecordMapper int queryDoctorNumberOfDiagnosis(Long doctorId); List queryPatientHistoryRecord(TRecord tRecord); + + /** + * 此医生最近一次就诊时间 + * @param tRecord + * @return + */ + List selectTRecordDoctorHospitalFirst(TRecord tRecord); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TPatientServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TPatientServiceImpl.java index f03804a..216f1e2 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TPatientServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TPatientServiceImpl.java @@ -112,11 +112,14 @@ public class TPatientServiceImpl implements ITPatientService List pcTPatientQueryByPageResps = tPatientMapper.queryByPage(pcTPatintQueryByPageReq); pcTPatientQueryByPageResps.stream().forEach(a ->{ record.setPatientId(a.getId()); - List tRecords = tRecordMapper.selectTRecordDoctorPatientFirst(record); + List tRecords = tRecordMapper.selectTRecordDoctorHospitalFirst(record); //最后一次/初次就诊时间 if (!ObjectUtils.isEmpty(tRecords)){ a.setLatestTime(tRecords.get(0).getCreateTime()); a.setFirstTime(tRecords.get(tRecords.size()-1).getCreateTime()); + a.setHospitalName(tRecords.get(0).getHospitalName()); + a.setHospitalId(tRecords.get(0).getHospitalId()); + a.setDoctorName(tRecords.get(0).getDoctorName()); } //诊断次数 a.setCountRecords(tRecords.size()); diff --git a/ruoyi-system/src/main/resources/mapper/system/THospitalMapper.xml b/ruoyi-system/src/main/resources/mapper/system/THospitalMapper.xml index 0813ccd..472134f 100644 --- a/ruoyi-system/src/main/resources/mapper/system/THospitalMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/THospitalMapper.xml @@ -22,6 +22,7 @@ and num = #{num} and admin_id = #{adminId} + order by num asc + +