diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/pc/TRecordController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/pc/TRecordController.java index e24ad9f..be9d8d0 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/pc/TRecordController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/pc/TRecordController.java @@ -2,6 +2,9 @@ package com.ruoyi.web.controller.pc; import java.util.List; 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.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; @@ -23,7 +26,7 @@ import com.ruoyi.common.core.page.TableDataInfo; /** * 诊断记录信息Controller - * + * * @author ruoyi * @date 2022-08-03 */ @@ -39,10 +42,10 @@ public class TRecordController extends BaseController */ @PreAuthorize("@ss.hasPermi('system:record:list')") @GetMapping("/list") - public TableDataInfo list(TRecord tRecord) + public TableDataInfo list(TRecordResultReq tRecord) { startPage(); - List list = tRecordService.selectTRecordList(tRecord); + List list = tRecordService.selectTRecordListWithoutResult(tRecord); return getDataTable(list); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/req/TRecordResultReq.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/req/TRecordResultReq.java new file mode 100644 index 0000000..b0becb8 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/req/TRecordResultReq.java @@ -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; + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/resp/TRecordResp.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/resp/TRecordResp.java new file mode 100644 index 0000000..08ea033 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/resp/TRecordResp.java @@ -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; + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TRecordMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TRecordMapper.java index 711cb3b..bc1b81d 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TRecordMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TRecordMapper.java @@ -2,18 +2,22 @@ package com.ruoyi.system.mapper; import java.util.List; 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接口 - * + * * @author ruoyi * @date 2022-08-03 */ -public interface TRecordMapper +@Mapper +public interface TRecordMapper { /** * 查询诊断记录信息 - * + * * @param id 诊断记录信息主键 * @return 诊断记录信息 */ @@ -21,7 +25,7 @@ public interface TRecordMapper /** * 查询诊断记录信息列表 - * + * * @param tRecord 诊断记录信息 * @return 诊断记录信息集合 */ @@ -29,7 +33,7 @@ public interface TRecordMapper /** * 新增诊断记录信息 - * + * * @param tRecord 诊断记录信息 * @return 结果 */ @@ -37,7 +41,7 @@ public interface TRecordMapper /** * 修改诊断记录信息 - * + * * @param tRecord 诊断记录信息 * @return 结果 */ @@ -45,7 +49,7 @@ public interface TRecordMapper /** * 删除诊断记录信息 - * + * * @param id 诊断记录信息主键 * @return 结果 */ @@ -53,9 +57,11 @@ public interface TRecordMapper /** * 批量删除诊断记录信息 - * + * * @param ids 需要删除的数据主键集合 * @return 结果 */ public int deleteTRecordByIds(Long[] ids); + + List selectTRecordListWithoutResult(TRecordResultReq tRecord); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ITRecordService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ITRecordService.java index be8b8da..123a898 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/ITRecordService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ITRecordService.java @@ -2,18 +2,20 @@ package com.ruoyi.system.service; import java.util.List; import com.ruoyi.system.domain.TRecord; +import com.ruoyi.system.domain.req.TRecordResultReq; +import com.ruoyi.system.domain.resp.TRecordResp; /** * 诊断记录信息Service接口 - * + * * @author ruoyi * @date 2022-08-03 */ -public interface ITRecordService +public interface ITRecordService { /** * 查询诊断记录信息 - * + * * @param id 诊断记录信息主键 * @return 诊断记录信息 */ @@ -21,7 +23,7 @@ public interface ITRecordService /** * 查询诊断记录信息列表 - * + * * @param tRecord 诊断记录信息 * @return 诊断记录信息集合 */ @@ -29,7 +31,7 @@ public interface ITRecordService /** * 新增诊断记录信息 - * + * * @param tRecord 诊断记录信息 * @return 结果 */ @@ -37,7 +39,7 @@ public interface ITRecordService /** * 修改诊断记录信息 - * + * * @param tRecord 诊断记录信息 * @return 结果 */ @@ -45,7 +47,7 @@ public interface ITRecordService /** * 批量删除诊断记录信息 - * + * * @param ids 需要删除的诊断记录信息主键集合 * @return 结果 */ @@ -53,9 +55,11 @@ public interface ITRecordService /** * 删除诊断记录信息信息 - * + * * @param id 诊断记录信息主键 * @return 结果 */ public int deleteTRecordById(Long id); + + List selectTRecordListWithoutResult(TRecordResultReq tRecord); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TRecordServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TRecordServiceImpl.java index 148e538..40ef61f 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TRecordServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TRecordServiceImpl.java @@ -2,6 +2,8 @@ package com.ruoyi.system.service.impl; import java.util.List; 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.stereotype.Service; import com.ruoyi.system.mapper.TRecordMapper; @@ -10,19 +12,19 @@ import com.ruoyi.system.service.ITRecordService; /** * 诊断记录信息Service业务层处理 - * + * * @author ruoyi * @date 2022-08-03 */ @Service -public class TRecordServiceImpl implements ITRecordService +public class TRecordServiceImpl implements ITRecordService { @Autowired private TRecordMapper tRecordMapper; /** * 查询诊断记录信息 - * + * * @param id 诊断记录信息主键 * @return 诊断记录信息 */ @@ -34,7 +36,7 @@ public class TRecordServiceImpl implements ITRecordService /** * 查询诊断记录信息列表 - * + * * @param tRecord 诊断记录信息 * @return 诊断记录信息 */ @@ -46,7 +48,7 @@ public class TRecordServiceImpl implements ITRecordService /** * 新增诊断记录信息 - * + * * @param tRecord 诊断记录信息 * @return 结果 */ @@ -59,7 +61,7 @@ public class TRecordServiceImpl implements ITRecordService /** * 修改诊断记录信息 - * + * * @param tRecord 诊断记录信息 * @return 结果 */ @@ -72,7 +74,7 @@ public class TRecordServiceImpl implements ITRecordService /** * 批量删除诊断记录信息 - * + * * @param ids 需要删除的诊断记录信息主键 * @return 结果 */ @@ -84,7 +86,7 @@ public class TRecordServiceImpl implements ITRecordService /** * 删除诊断记录信息信息 - * + * * @param id 诊断记录信息主键 * @return 结果 */ @@ -93,4 +95,10 @@ public class TRecordServiceImpl implements ITRecordService { return tRecordMapper.deleteTRecordById(id); } + + @Override + public List selectTRecordListWithoutResult(TRecordResultReq tRecord) + { + return tRecordMapper.selectTRecordListWithoutResult(tRecord); + } } diff --git a/ruoyi-system/src/main/resources/mapper/system/TRecordMapper.xml b/ruoyi-system/src/main/resources/mapper/system/TRecordMapper.xml index e5ab34f..d567099 100644 --- a/ruoyi-system/src/main/resources/mapper/system/TRecordMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/TRecordMapper.xml @@ -3,7 +3,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + @@ -23,12 +23,60 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - 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 + + + + 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 - + + + - + insert into t_record @@ -111,9 +173,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - delete from t_record where id in + delete from t_record where id in #{id} - \ No newline at end of file +