app医生信息获取接口调整

master
gongzhenkun 2 years ago
parent d0fe4d8af9
commit c654ac5b4e

@ -84,8 +84,7 @@ public class AppController extends BaseController
@GetMapping("/doctor/info")
public AjaxResult doctorInformation(Long doctorId)
{
TDoctor tDoctor = tDoctorService.selectTDoctorById(doctorId);
return AjaxResult.success(tDoctor);
return AjaxResult.success(tDoctorService.selectAppDoctorDetailById(doctorId));
}
/**

@ -0,0 +1,226 @@
package com.ruoyi.system.domain.resp;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
/**
* App
*
* @author gongzhenkun
* @date 2022/8/9 17:39
*/
@ApiModel(value = "AppDoctorResp", description = "App端医生信息反参实体")
public class AppDoctorResp implements Serializable {
private static final long serialVersionUID = 1L;
/**
* ID
*/
private Long id;
/**
* ID
*/
@ApiModelProperty("用户ID")
private Long userId;
/**
*
*/
@ApiModelProperty("编号")
private String identifier;
/**
*
*/
@ApiModelProperty("名称")
private String name;
/**
*
*/
@ApiModelProperty("电话")
private String phone;
/**
* 0 1 2
*/
@ApiModelProperty("用户性别: 0=男,1=女,2=未知")
private String sex;
/**
*
*/
@ApiModelProperty("年龄")
private Integer age;
/**
* 0 1 2
*/
@ApiModelProperty("婚姻状态: 0=未婚,1=已婚,2=未知")
private String marriage;
/**
*
*/
@ApiModelProperty("职称")
private String title;
/**
*
*/
@ApiModelProperty("专长")
private String speciality;
/**
*
*/
@ApiModelProperty("简介")
private String introduction;
/**
*
*/
@ApiModelProperty("职业医师照片路径")
private String medicalLicense;
/**
* base64
*/
@ApiModelProperty("二维码base64")
private String qrCode;
/**
*
*/
@ApiModelProperty("医院Id")
private Long hospitalId;
/**
*
*/
@ApiModelProperty("医院名称")
private String hospitalName;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public String getIdentifier() {
return identifier;
}
public void setIdentifier(String identifier) {
this.identifier = identifier;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String getSex() {
return sex;
}
public void setSex(String sex) {
this.sex = sex;
}
public Integer getAge() {
return age;
}
public void setAge(Integer age) {
this.age = age;
}
public String getMarriage() {
return marriage;
}
public void setMarriage(String marriage) {
this.marriage = marriage;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getSpeciality() {
return speciality;
}
public void setSpeciality(String speciality) {
this.speciality = speciality;
}
public String getIntroduction() {
return introduction;
}
public void setIntroduction(String introduction) {
this.introduction = introduction;
}
public String getMedicalLicense() {
return medicalLicense;
}
public void setMedicalLicense(String medicalLicense) {
this.medicalLicense = medicalLicense;
}
public String getQrCode() {
return qrCode;
}
public void setQrCode(String qrCode) {
this.qrCode = qrCode;
}
public String getHospitalName() {
return hospitalName;
}
public void setHospitalName(String hospitalName) {
this.hospitalName = hospitalName;
}
public Long getHospitalId() {
return hospitalId;
}
public void setHospitalId(Long hospitalId) {
this.hospitalId = hospitalId;
}
}

@ -3,6 +3,7 @@ package com.ruoyi.system.mapper;
import java.util.List;
import com.ruoyi.system.domain.TDoctor;
import com.ruoyi.system.domain.req.PcTDoctorQueryByPageReq;
import com.ruoyi.system.domain.resp.AppDoctorResp;
import com.ruoyi.system.domain.resp.PcTDoctorQueryByPageResp;
import org.apache.ibatis.annotations.Param;
@ -81,5 +82,12 @@ public interface TDoctorMapper
*/
int queryPatintCountByDoctor(@Param("hospitalId")Long hospitalId, @Param("doctorId")Long doctorId);
/**
*
*
* @param id
* @return
*/
public AppDoctorResp selectAppDoctorDetailById(Long id);
}

@ -3,6 +3,7 @@ package com.ruoyi.system.service;
import java.util.List;
import com.ruoyi.system.domain.TDoctor;
import com.ruoyi.system.domain.req.PcTDoctorQueryByPageReq;
import com.ruoyi.system.domain.resp.AppDoctorResp;
import com.ruoyi.system.domain.resp.PcTDoctorQueryByPageResp;
/**
@ -62,4 +63,12 @@ public interface ITDoctorService
public int deleteTDoctorById(Long id);
List<PcTDoctorQueryByPageResp> queryByPage(PcTDoctorQueryByPageReq pcTDoctorQueryByPageReq);
/**
*
*
* @param id
* @return
*/
public AppDoctorResp selectAppDoctorDetailById(Long id);
}

@ -3,6 +3,7 @@ package com.ruoyi.system.service.impl;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.req.PcTDoctorQueryByPageReq;
import com.ruoyi.system.domain.resp.AppDoctorResp;
import com.ruoyi.system.domain.resp.PcTDoctorQueryByPageResp;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -102,4 +103,15 @@ public class TDoctorServiceImpl implements ITDoctorService
pcTDoctorQueryByPageResps.stream().forEach(a -> a.setCountPatints(tDoctorMapper.queryPatintCountByDoctor(pcTDoctorQueryByPageReq.getHospitalId(),a.getId())));
return pcTDoctorQueryByPageResps;
}
/**
*
*
* @param id
* @return
*/
@Override
public AppDoctorResp selectAppDoctorDetailById(Long id) {
return tDoctorMapper.selectAppDoctorDetailById(id);
}
}

@ -179,4 +179,28 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="queryPatintCountByDoctor" resultType="int">
select COUNT(*) from t_patient_hospital_doctor where hospital_id = #{hospitalId} and doctor_id = #{doctorId}
</select>
<select id="selectAppDoctorDetailById" resultType="com.ruoyi.system.domain.resp.AppDoctorResp">
SELECT
td.id,
user_id AS userId,
identifier,
td.`name`,
th.`id` AS hospitalId,
th.`name` AS hospitalName,
phone,
sex,
age,
marriage,
title,
speciality,
introduction,
medical_license AS medicalLicense,
qr_code AS qrCode,
hospital_id AS hospitalId
FROM
t_doctor td
LEFT JOIN t_hospital th ON th.id = td.hospital_id
WHERE td.id = #{id}
</select>
</mapper>
Loading…
Cancel
Save