master
zhuqing 2 years ago
parent 517678a29d
commit fd51f938c3

@ -42,7 +42,7 @@ public class THospitalController extends BaseController
*
*/
@ApiOperation("查询医院信息列表")
@GetMapping("/list")
@PostMapping("/list")
public TableDataInfo list(@RequestBody THospital tHospital)
{
startPage();

@ -37,6 +37,10 @@ public class PcTDoctorQueryByPageReq {
@ApiModelProperty("名称")
private String name;
/** 删除标志0代表存在 2代表删除 */
@ApiModelProperty("删除标志0代表存在 2代表删除")
private String delFlag;
public String getIdentifier() {
return identifier;
}
@ -76,4 +80,12 @@ public class PcTDoctorQueryByPageReq {
public void setEndTime(Date endTime) {
this.endTime = endTime;
}
public String getDelFlag() {
return delFlag;
}
public void setDelFlag(String delFlag) {
this.delFlag = delFlag;
}
}

@ -17,10 +17,6 @@ public class PcTDoctorUpdateReq {
@ApiModelProperty("id")
private Long id;
/** 编号 */
@ApiModelProperty("工作证号")
private String identifier;
/** 名称 */
@ApiModelProperty("名称")
private String name;
@ -45,10 +41,6 @@ public class PcTDoctorUpdateReq {
@ApiModelProperty("二维码base64")
private String qrCode;
/** 医院 */
@ApiModelProperty("医院")
private Long hospitalId;
public Long getId() {
return id;
}
@ -57,14 +49,6 @@ public class PcTDoctorUpdateReq {
this.id = id;
}
public String getIdentifier() {
return identifier;
}
public void setIdentifier(String identifier) {
this.identifier = identifier;
}
public String getName() {
return name;
}
@ -113,26 +97,16 @@ public class PcTDoctorUpdateReq {
this.qrCode = qrCode;
}
public Long getHospitalId() {
return hospitalId;
}
public void setHospitalId(Long hospitalId) {
this.hospitalId = hospitalId;
}
@Override
public String toString() {
return "PcTDoctorUpdateReq{" +
"id=" + id +
", identifier='" + identifier + '\'' +
", name='" + name + '\'' +
", phone='" + phone + '\'' +
", title='" + title + '\'' +
", speciality='" + speciality + '\'' +
", medicalLicense='" + medicalLicense + '\'' +
", qrCode='" + qrCode + '\'' +
", hospitalId=" + hospitalId +
'}';
}
}

@ -89,6 +89,17 @@ public class PcTDoctorQueryByPageResp {
@ApiModelProperty("最近一次就诊时间")
private Date latestTime;
@ApiModelProperty("诊断次数")
private int countRecords;
public int getCountRecords() {
return countRecords;
}
public void setCountRecords(int countRecords) {
this.countRecords = countRecords;
}
public Date getLatestTime() {
return latestTime;
}
@ -253,6 +264,8 @@ public class PcTDoctorQueryByPageResp {
", createTime=" + createTime +
", updateTime=" + updateTime +
", countPatints=" + countPatints +
", latestTime=" + latestTime +
", countRecords=" + countRecords +
'}';
}
}

@ -80,6 +80,17 @@ public interface TRecordMapper
@Param("doctorId")Long doctorId,
@Param("weekMonth")Long weekMonth);
/**
* --------------------------------------------------------------------
*/
/**
*
* @param tRecord
* @return
*/
public List<TRecord> selectTRecordDoctorFirst(TRecord tRecord);
/**
*
*

@ -2,14 +2,17 @@ package com.ruoyi.system.service.impl;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.TRecord;
import com.ruoyi.system.domain.req.PcTDoctorQueryByPageReq;
import com.ruoyi.system.domain.resp.AppDoctorResp;
import com.ruoyi.system.domain.resp.PcTDoctorQueryByPageResp;
import com.ruoyi.system.mapper.TRecordMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.TDoctorMapper;
import com.ruoyi.system.domain.TDoctor;
import com.ruoyi.system.service.ITDoctorService;
import org.springframework.util.ObjectUtils;
/**
* Service
@ -23,6 +26,8 @@ public class TDoctorServiceImpl implements ITDoctorService
@Autowired
private TDoctorMapper tDoctorMapper;
@Autowired
private TRecordMapper tRecordMapper;
/**
*
*
@ -99,8 +104,23 @@ public class TDoctorServiceImpl implements ITDoctorService
@Override
public List<PcTDoctorQueryByPageResp> queryByPage(PcTDoctorQueryByPageReq pcTDoctorQueryByPageReq) {
Long hospitalId = pcTDoctorQueryByPageReq.getHospitalId();
TRecord record = new TRecord();
record.setStatus("1");
record.setHospitalId(hospitalId);
List<PcTDoctorQueryByPageResp> pcTDoctorQueryByPageResps = tDoctorMapper.queryByPage(pcTDoctorQueryByPageReq);
pcTDoctorQueryByPageResps.stream().forEach(a -> a.setCountPatints(tDoctorMapper.queryPatintCountByDoctor(pcTDoctorQueryByPageReq.getHospitalId(),a.getId())));
pcTDoctorQueryByPageResps.stream().forEach(a ->{
record.setDoctorId(a.getId());
List<TRecord> tRecords = tRecordMapper.selectTRecordDoctorFirst(record);
//最近一次就诊时间
if (!ObjectUtils.isEmpty(tRecords)){
a.setLatestTime(tRecords.get(0).getCreateTime());
}
//患者个数
a.setCountPatints(tDoctorMapper.queryPatintCountByDoctor(hospitalId,a.getId()));
//诊断次数
a.setCountRecords(tRecords.size());
});
return pcTDoctorQueryByPageResps;
}

@ -162,7 +162,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
from
t_doctor
<where>
del_flag = '0' and hospital_id = #{hospitalId}
<if test="startTime != null and endTime != null">
AND create_time between DATE_FORMAT(#{startTime},'%Y-%m-%d %H:%i:%s') and DATE_FORMAT(#{endTime},'%Y-%m-%d %H:%i:%s')
</if>
@ -172,6 +171,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="identifier != null and identifier != ''">
AND identifier like concat('%', #{identifier}, '%')
</if>
<if test="hospitalId != null">
and hospital_id = #{hospitalId}
</if>
<if test="delFlag != null">
and del_flag = #{delFlag}
</if>
</where>
order by create_time desc
</select>

@ -159,6 +159,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<!--====================工作台相关接口=====================-->
<select id="selectTRecordDoctorFirst" parameterType="TRecord" resultMap="TRecordResult">
<include refid="selectTRecordVo"/>
<where>
<if test="doctorId != null "> and doctor_id = #{doctorId}</if>
<if test="hospitalId != null "> and hospital_id = #{hospitalId}</if>
<if test="status != null and status != ''"> and status = #{status}</if>
</where>
order by create_time desc
</select>
<select id="selectTRecordList" parameterType="TRecord" resultMap="TRecordResult">
<include refid="selectTRecordVo"/>

Loading…
Cancel
Save