就诊记录和患者数据不符合问题修改

master
gongzhenkun 2 years ago
parent 1f784e3b51
commit a6c72f23fc

@ -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;
}

@ -167,4 +167,11 @@ public interface TRecordMapper
int queryDoctorNumberOfDiagnosis(Long doctorId);
List<PatientHistoryRecordResp> queryPatientHistoryRecord(TRecord tRecord);
/**
*
* @param tRecord
* @return
*/
List<TRecord> selectTRecordDoctorHospitalFirst(TRecord tRecord);
}

@ -112,11 +112,14 @@ public class TPatientServiceImpl implements ITPatientService
List<PcTPatientQueryByPageResp> pcTPatientQueryByPageResps = tPatientMapper.queryByPage(pcTPatintQueryByPageReq);
pcTPatientQueryByPageResps.stream().forEach(a ->{
record.setPatientId(a.getId());
List<TRecord> tRecords = tRecordMapper.selectTRecordDoctorPatientFirst(record);
List<TRecord> 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());

@ -22,6 +22,7 @@
<if test="num != null "> and num = #{num}</if>
<if test="adminId != null "> and admin_id = #{adminId}</if>
</where>
order by num asc
</select>
<select id="selectTHospitalById" parameterType="Long" resultMap="THospitalResult">

@ -22,6 +22,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="responseTime" column="response_time" />
<result property="aiResultReturnTime" column="ai_result_return_time" />
<result property="aiResultModifyTime" column="ai_result_modify_time" />
<result property="hospitalName" column="hospital_name" />
<result property="doctorName" column="doctor_name"/>
</resultMap>
<sql id="selectTRecordVo">
@ -253,6 +255,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
order by create_time desc
</select>
<select id="selectTRecordDoctorHospitalFirst" parameterType="TRecord" resultMap="TRecordResult">
select
t.id,
t.create_time,
t.doctor_id,
t.hospital_id,
c.`name` as hospital_name,
d.`name` as doctor_name
from t_record t
left join t_hospital c on c.id = t.hospital_id
left join t_doctor d on d.id = t.doctor_id
<where>
<if test="patientId != null "> and t.patient_id = #{patientId}</if>
<if test="doctorId != null "> and t.doctor_id = #{doctorId}</if>
<if test="hospitalId != null "> and t.hospital_id = #{hospitalId}</if>
<if test="status != null and status != ''"> and t.status = #{status}</if>
</where>
order by t.create_time desc
</select>
<select id="selectTRecordList" parameterType="TRecord" resultMap="TRecordResult">
<include refid="selectTRecordVo"/>
where tr.del_flag = '0'

Loading…
Cancel
Save