From b764f1d20e294c60a98175573a159b0ecd5ee150 Mon Sep 17 00:00:00 2001 From: shiyang Date: Sat, 18 Sep 2021 09:25:05 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=8F=E7=A8=8B=E5=BA=8F=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E7=AB=AF-=E7=99=BB=E5=BD=95=E5=90=8E=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E7=97=85=E5=8E=86=E6=89=80=E5=9C=A8=E5=8C=BB?= =?UTF-8?q?=E9=99=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lyms/talkonlineweb/controller/PatientController.java | 13 +++++++++++++ .../com/lyms/talkonlineweb/mapper/LymsPatientMapper.java | 14 ++++++++++++++ .../com/lyms/talkonlineweb/service/LymsPatientService.java | 3 +++ .../talkonlineweb/service/impl/LymsPatientServiceImpl.java | 9 +++++++++ 4 files changed, 39 insertions(+) diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/PatientController.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/PatientController.java index 6dc6050..0b5f5cf 100644 --- a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/PatientController.java +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/PatientController.java @@ -507,4 +507,17 @@ public class PatientController { baseResponse.setObject(list); return baseResponse; } + /** + * 小程序用户端-登录后显示用户病历所在医院 + * + * @param patientId 传入患者id + * @return 医院id和医院名称 + */ + @GetMapping("getAppPatientHospital") + public BaseResponse getAppPatientHospital(Integer patientId) { + BaseResponse baseResponse = new BaseResponse(); + Map patientMap=lymsPatientService.getAppPatientHospital(patientId); + baseResponse.setObject(patientMap); + return baseResponse; + } } diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/mapper/LymsPatientMapper.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/mapper/LymsPatientMapper.java index 06e7e5e..6fc13e6 100644 --- a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/mapper/LymsPatientMapper.java +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/mapper/LymsPatientMapper.java @@ -2,16 +2,30 @@ package com.lyms.talkonlineweb.mapper; import com.lyms.talkonlineweb.domain.LymsPatient; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Update; +import java.util.Map; + /** * @Entity com.lyms.talkonlineweb.domain.LymsPatient */ +@Mapper public interface LymsPatientMapper extends BaseMapper { @Update(" UPDATE lyms_patient SET ccnt = ccnt+#{cnt} WHERE id = #{id}") int updatePatientCcnt(@Param("cnt") Integer cnt, @Param("id") Integer id); + + @Select("select" + + " pc.hid,pc.hname \n" + + "from\n" + + " lyms_patient pa\n" + + "left join lyms_pcase pc on pc.pid=pa.id\n" + + "where pa.id=#{patientId}\n" + + "order by pc.createdtime desc") + Map getAppPatientHospital(@Param("patientId") Integer patientId); } diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/LymsPatientService.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/LymsPatientService.java index 587e400..85a3f0a 100644 --- a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/LymsPatientService.java +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/LymsPatientService.java @@ -3,9 +3,12 @@ package com.lyms.talkonlineweb.service; import com.lyms.talkonlineweb.domain.LymsPatient; import com.baomidou.mybatisplus.extension.service.IService; +import java.util.Map; + /** * */ public interface LymsPatientService extends IService { + Map getAppPatientHospital(Integer patientId); } diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/impl/LymsPatientServiceImpl.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/impl/LymsPatientServiceImpl.java index a81d21d..0ed4631 100644 --- a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/impl/LymsPatientServiceImpl.java +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/impl/LymsPatientServiceImpl.java @@ -4,8 +4,11 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.lyms.talkonlineweb.domain.LymsPatient; import com.lyms.talkonlineweb.service.LymsPatientService; import com.lyms.talkonlineweb.mapper.LymsPatientMapper; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.Map; + /** * */ @@ -13,6 +16,12 @@ import org.springframework.stereotype.Service; public class LymsPatientServiceImpl extends ServiceImpl implements LymsPatientService{ + @Autowired + private LymsPatientMapper lymsPatientMapper; + @Override + public Map getAppPatientHospital(Integer patientId) { + return lymsPatientMapper.getAppPatientHospital(patientId); + } } -- 1.8.3.1