Commit b764f1d20e294c60a98175573a159b0ecd5ee150
1 parent
0dbad0de75
Exists in
master
小程序用户端-登录后显示用户病历所在医院
Showing 4 changed files with 39 additions and 0 deletions
- talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/PatientController.java
- talkonlineweb/src/main/java/com/lyms/talkonlineweb/mapper/LymsPatientMapper.java
- talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/LymsPatientService.java
- talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/impl/LymsPatientServiceImpl.java
talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/PatientController.java
View file @
b764f1d
... | ... | @@ -507,5 +507,18 @@ |
507 | 507 | baseResponse.setObject(list); |
508 | 508 | return baseResponse; |
509 | 509 | } |
510 | + /** | |
511 | + * 小程序用户端-登录后显示用户病历所在医院 | |
512 | + * | |
513 | + * @param patientId 传入患者id | |
514 | + * @return 医院id和医院名称 | |
515 | + */ | |
516 | + @GetMapping("getAppPatientHospital") | |
517 | + public BaseResponse getAppPatientHospital(Integer patientId) { | |
518 | + BaseResponse baseResponse = new BaseResponse(); | |
519 | + Map<String,String> patientMap=lymsPatientService.getAppPatientHospital(patientId); | |
520 | + baseResponse.setObject(patientMap); | |
521 | + return baseResponse; | |
522 | + } | |
510 | 523 | } |
talkonlineweb/src/main/java/com/lyms/talkonlineweb/mapper/LymsPatientMapper.java
View file @
b764f1d
... | ... | @@ -2,15 +2,29 @@ |
2 | 2 | |
3 | 3 | import com.lyms.talkonlineweb.domain.LymsPatient; |
4 | 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
5 | +import org.apache.ibatis.annotations.Mapper; | |
5 | 6 | import org.apache.ibatis.annotations.Param; |
7 | +import org.apache.ibatis.annotations.Select; | |
6 | 8 | import org.apache.ibatis.annotations.Update; |
7 | 9 | |
10 | +import java.util.Map; | |
11 | + | |
8 | 12 | /** |
9 | 13 | * @Entity com.lyms.talkonlineweb.domain.LymsPatient |
10 | 14 | */ |
15 | +@Mapper | |
11 | 16 | public interface LymsPatientMapper extends BaseMapper<LymsPatient> { |
12 | 17 | |
13 | 18 | @Update(" UPDATE lyms_patient SET ccnt = ccnt+#{cnt} WHERE id = #{id}") |
14 | 19 | int updatePatientCcnt(@Param("cnt") Integer cnt, @Param("id") Integer id); |
20 | + | |
21 | + @Select("select" + | |
22 | + " pc.hid,pc.hname \n" + | |
23 | + "from\n" + | |
24 | + " lyms_patient pa\n" + | |
25 | + "left join lyms_pcase pc on pc.pid=pa.id\n" + | |
26 | + "where pa.id=#{patientId}\n" + | |
27 | + "order by pc.createdtime desc") | |
28 | + Map<String,String> getAppPatientHospital(@Param("patientId") Integer patientId); | |
15 | 29 | } |
talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/LymsPatientService.java
View file @
b764f1d
... | ... | @@ -3,10 +3,13 @@ |
3 | 3 | import com.lyms.talkonlineweb.domain.LymsPatient; |
4 | 4 | import com.baomidou.mybatisplus.extension.service.IService; |
5 | 5 | |
6 | +import java.util.Map; | |
7 | + | |
6 | 8 | /** |
7 | 9 | * |
8 | 10 | */ |
9 | 11 | public interface LymsPatientService extends IService<LymsPatient> { |
10 | 12 | |
13 | + Map<String,String> getAppPatientHospital(Integer patientId); | |
11 | 14 | } |
talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/impl/LymsPatientServiceImpl.java
View file @
b764f1d
... | ... | @@ -4,8 +4,11 @@ |
4 | 4 | import com.lyms.talkonlineweb.domain.LymsPatient; |
5 | 5 | import com.lyms.talkonlineweb.service.LymsPatientService; |
6 | 6 | import com.lyms.talkonlineweb.mapper.LymsPatientMapper; |
7 | +import org.springframework.beans.factory.annotation.Autowired; | |
7 | 8 | import org.springframework.stereotype.Service; |
8 | 9 | |
10 | +import java.util.Map; | |
11 | + | |
9 | 12 | /** |
10 | 13 | * |
11 | 14 | */ |
... | ... | @@ -13,5 +16,11 @@ |
13 | 16 | public class LymsPatientServiceImpl extends ServiceImpl<LymsPatientMapper, LymsPatient> |
14 | 17 | implements LymsPatientService{ |
15 | 18 | |
19 | + @Autowired | |
20 | + private LymsPatientMapper lymsPatientMapper; | |
21 | + @Override | |
22 | + public Map<String,String> getAppPatientHospital(Integer patientId) { | |
23 | + return lymsPatientMapper.getAppPatientHospital(patientId); | |
24 | + } | |
16 | 25 | } |