就诊记录列表查询

master
chenfei 2 years ago
parent 30e7d66dea
commit 35586668d0

@ -2,6 +2,9 @@ package com.ruoyi.web.controller.pc;
import java.util.List; import java.util.List;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.ruoyi.system.domain.req.TRecordResultReq;
import com.ruoyi.system.domain.resp.TRecordResp;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
@ -39,10 +42,10 @@ public class TRecordController extends BaseController
*/ */
@PreAuthorize("@ss.hasPermi('system:record:list')") @PreAuthorize("@ss.hasPermi('system:record:list')")
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo list(TRecord tRecord) public TableDataInfo list(TRecordResultReq tRecord)
{ {
startPage(); startPage();
List<TRecord> list = tRecordService.selectTRecordList(tRecord); List<TRecordResp> list = tRecordService.selectTRecordListWithoutResult(tRecord);
return getDataTable(list); return getDataTable(list);
} }

@ -0,0 +1,115 @@
package com.ruoyi.system.domain.req;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import java.util.Date;
public class TRecordResultReq
{
private String name;
private String sex;
private Integer age;
private Long doctorId;
private Long hospitalId;
@JsonFormat(pattern = "yyyy-MM-dd")
private Date createTime;
//预约时间排序
private String doctorTime;
//首诊时间排序
private String firstVisitTime;
private String status;
public String getName()
{
return name;
}
public void setName(String name)
{
this.name = name;
}
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 Long getDoctorId()
{
return doctorId;
}
public void setDoctorId(Long doctorId)
{
this.doctorId = doctorId;
}
public Long getHospitalId()
{
return hospitalId;
}
public void setHospitalId(Long hospitalId)
{
this.hospitalId = hospitalId;
}
public String getStatus()
{
return status;
}
public void setStatus(String status)
{
this.status = status;
}
public String getDoctorTime()
{
return doctorTime;
}
public void setDoctorTime(String doctorTime)
{
this.doctorTime = doctorTime;
}
public String getFirstVisitTime()
{
return firstVisitTime;
}
public void setFirstVisitTime(String firstVisitTime)
{
this.firstVisitTime = firstVisitTime;
}
public Date getCreateTime()
{
return createTime;
}
public void setCreateTime(Date createTime)
{
this.createTime = createTime;
}
}

@ -0,0 +1,298 @@
package com.ruoyi.system.domain.resp;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import java.util.Date;
public class TRecordResp
{
/** ID */
private Long id;
/** 患者 */
@Excel(name = "患者")
private Long patientId;
/** 医生 */
@Excel(name = "医生")
private Long doctorId;
/** 医院 */
@Excel(name = "医院")
private Long hospitalId;
/** 状态0预约 1就诊 */
@Excel(name = "状态", readConverterExp = "0=预约,1=就诊")
private String status;
/** ai诊断结果 */
@Excel(name = "ai诊断结果")
private String aiResult;
/** ai诊断结果无图片 */
@Excel(name = "ai诊断结果无图片")
private String aiResult2;
/** 医生诊断结果 */
@Excel(name = "医生诊断结果")
private String updateResult;
/** 医生诊断结果,无图片 */
@Excel(name = "医生诊断结果,无图片")
private String updateResult2;
/** 上传时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "上传时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date uploadTime;
/** 舌下 */
@Excel(name = "舌下")
private String imgSx;
/** 舌上 */
@Excel(name = "舌上")
private String imgSm;
/** 响应时长 */
@Excel(name = "响应时长")
private Long responseTime;
@Excel(name = "编号")
private String identifier;
/** 名称 */
@Excel(name = "名称")
private String patientName;
private String doctorName;
@Excel(name = "用户性别", readConverterExp = "0=男,1=女,2=未知")
private String sex;
/** 年龄 */
@Excel(name = "年龄")
private Integer age;
@Excel(name = "婚姻状态", readConverterExp = "0=未婚,1=已婚,2=未知")
private String marriage;
/** 基础疾病 */
@Excel(name = "基础疾病")
private String disease;
@JsonFormat(pattern = "yyyy-MM-dd")
private Date createTime;
public Long getId()
{
return id;
}
public void setId(Long id)
{
this.id = id;
}
public Long getPatientId()
{
return patientId;
}
public void setPatientId(Long patientId)
{
this.patientId = patientId;
}
public Long getDoctorId()
{
return doctorId;
}
public void setDoctorId(Long doctorId)
{
this.doctorId = doctorId;
}
public Long getHospitalId()
{
return hospitalId;
}
public void setHospitalId(Long hospitalId)
{
this.hospitalId = hospitalId;
}
public String getStatus()
{
return status;
}
public void setStatus(String status)
{
this.status = status;
}
public String getAiResult()
{
return aiResult;
}
public void setAiResult(String aiResult)
{
this.aiResult = aiResult;
}
public String getAiResult2()
{
return aiResult2;
}
public void setAiResult2(String aiResult2)
{
this.aiResult2 = aiResult2;
}
public String getUpdateResult()
{
return updateResult;
}
public void setUpdateResult(String updateResult)
{
this.updateResult = updateResult;
}
public String getUpdateResult2()
{
return updateResult2;
}
public void setUpdateResult2(String updateResult2)
{
this.updateResult2 = updateResult2;
}
public Date getUploadTime()
{
return uploadTime;
}
public void setUploadTime(Date uploadTime)
{
this.uploadTime = uploadTime;
}
public String getImgSx()
{
return imgSx;
}
public void setImgSx(String imgSx)
{
this.imgSx = imgSx;
}
public String getImgSm()
{
return imgSm;
}
public void setImgSm(String imgSm)
{
this.imgSm = imgSm;
}
public Long getResponseTime()
{
return responseTime;
}
public void setResponseTime(Long responseTime)
{
this.responseTime = responseTime;
}
public String getIdentifier()
{
return identifier;
}
public void setIdentifier(String identifier)
{
this.identifier = identifier;
}
public String getPatientName()
{
return patientName;
}
public void setPatientName(String patientName)
{
this.patientName = patientName;
}
public String getDoctorName()
{
return doctorName;
}
public void setDoctorName(String doctorName)
{
this.doctorName = doctorName;
}
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 getDisease()
{
return disease;
}
public void setDisease(String disease)
{
this.disease = disease;
}
public Date getCreateTime()
{
return createTime;
}
public void setCreateTime(Date createTime)
{
this.createTime = createTime;
}
}

@ -2,6 +2,9 @@ package com.ruoyi.system.mapper;
import java.util.List; import java.util.List;
import com.ruoyi.system.domain.TRecord; import com.ruoyi.system.domain.TRecord;
import com.ruoyi.system.domain.req.TRecordResultReq;
import com.ruoyi.system.domain.resp.TRecordResp;
import org.apache.ibatis.annotations.Mapper;
/** /**
* Mapper * Mapper
@ -9,6 +12,7 @@ import com.ruoyi.system.domain.TRecord;
* @author ruoyi * @author ruoyi
* @date 2022-08-03 * @date 2022-08-03
*/ */
@Mapper
public interface TRecordMapper public interface TRecordMapper
{ {
/** /**
@ -58,4 +62,6 @@ public interface TRecordMapper
* @return * @return
*/ */
public int deleteTRecordByIds(Long[] ids); public int deleteTRecordByIds(Long[] ids);
List<TRecordResp> selectTRecordListWithoutResult(TRecordResultReq tRecord);
} }

@ -2,6 +2,8 @@ package com.ruoyi.system.service;
import java.util.List; import java.util.List;
import com.ruoyi.system.domain.TRecord; import com.ruoyi.system.domain.TRecord;
import com.ruoyi.system.domain.req.TRecordResultReq;
import com.ruoyi.system.domain.resp.TRecordResp;
/** /**
* Service * Service
@ -58,4 +60,6 @@ public interface ITRecordService
* @return * @return
*/ */
public int deleteTRecordById(Long id); public int deleteTRecordById(Long id);
List<TRecordResp> selectTRecordListWithoutResult(TRecordResultReq tRecord);
} }

@ -2,6 +2,8 @@ package com.ruoyi.system.service.impl;
import java.util.List; import java.util.List;
import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.req.TRecordResultReq;
import com.ruoyi.system.domain.resp.TRecordResp;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.TRecordMapper; import com.ruoyi.system.mapper.TRecordMapper;
@ -93,4 +95,10 @@ public class TRecordServiceImpl implements ITRecordService
{ {
return tRecordMapper.deleteTRecordById(id); return tRecordMapper.deleteTRecordById(id);
} }
@Override
public List<TRecordResp> selectTRecordListWithoutResult(TRecordResultReq tRecord)
{
return tRecordMapper.selectTRecordListWithoutResult(tRecord);
}
} }

@ -23,7 +23,55 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectTRecordVo"> <sql id="selectTRecordVo">
select id, patient_id, doctor_id, hospital_id, status, ai_result, ai_result2, update_result, update_result2, create_time, update_time, upload_time, img_sx, img_sm, response_time from t_record SELECT
tr.id,
tr.patient_id AS patientId,
tr.doctor_id AS doctorId,
tr.hospital_id AS hospitalId,
tr.STATUS,
tr.ai_result AS aiResult,
tr.ai_result2 AS aiResult2,
tr.update_result AS update_result,
tr.update_result2 AS updateResult2,
tr.update_time AS updateTime,
tr.upload_time AS uploadTime,
td.NAME AS doctorName,
tp.identifier,
tp.NAME AS patientName,
tp.sex,
tp.age,
tp.marriage,
tp.disease,
tp.create_time AS createTime
FROM
t_record tr
LEFT JOIN t_doctor td ON tr.doctor_id = td.id
LEFT JOIN t_patient tp ON tr.patient_id = tp.id
</sql>
<sql id="selectTRecordWithOutResult">
SELECT
tr.id,
tr.patient_id AS patientId,
tr.doctor_id AS doctorId,
tr.hospital_id AS hospitalId,
tr.STATUS,
tr.ai_result2 AS aiResult2,
tr.update_result2 AS updateResult2,
tr.update_time AS updateTime,
tr.upload_time AS uploadTime,
td.NAME AS doctorName,
tp.identifier,
tp.NAME AS patientName,
tp.sex,
tp.age,
tp.marriage,
tp.disease,
tp.create_time AS createTime
FROM
t_record tr
LEFT JOIN t_doctor td ON tr.doctor_id = td.id
LEFT JOIN t_patient tp ON tr.patient_id = tp.id
</sql> </sql>
<select id="selectTRecordList" parameterType="TRecord" resultMap="TRecordResult"> <select id="selectTRecordList" parameterType="TRecord" resultMap="TRecordResult">
@ -44,6 +92,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where> </where>
</select> </select>
<select id="selectTRecordListWithoutResult" parameterType="TRecordResultReq" resultType="TRecordResp">
<include refid="selectTRecordWithOutResult"/>
<where>
<if test="name != null and name != ''"> and tp.name like concat('%', #{name}, '%')</if>
<if test="doctorId != null "> and tr.doctor_id = #{doctorId}</if>
<if test="hospitalId != null "> and tr.hospital_id = #{hospitalId}</if>
<if test="status != null and status != ''"> and tr.status = #{status}</if>
<if test="age !=null">and tp.age = #{age} </if>
<if test="sex !=null">and tp.sex = #{sex} </if>
<if test="createTime !=null">and DATE_FORMAT(tp.create_time,'%Y-%m-%d') = #{createTime} </if>
<if test="doctorTime !=null and firstVisitTime!=null" >order by tr.create_time ${doctorTime}, tp.create_time ${firstVisitTime}</if>
</where>
</select>
<select id="selectTRecordById" parameterType="Long" resultMap="TRecordResult"> <select id="selectTRecordById" parameterType="Long" resultMap="TRecordResult">
<include refid="selectTRecordVo"/> <include refid="selectTRecordVo"/>
where id = #{id} where id = #{id}

Loading…
Cancel
Save