diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/AppController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/AppController.java index c3641d5..82ddfc3 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/AppController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/AppController.java @@ -1,20 +1,20 @@ package com.ruoyi.web.controller.api; +import com.ruoyi.common.annotation.Log; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; -import com.ruoyi.common.core.page.TableDataInfo; -import com.ruoyi.system.domain.THospital; -import com.ruoyi.system.domain.TRecord; -import com.ruoyi.system.service.ITHospitalService; -import com.ruoyi.system.service.ITRecordService; +import com.ruoyi.system.domain.*; +import com.ruoyi.system.domain.req.AppPatientHospitalDoctor; +import com.ruoyi.system.domain.req.AppPatientReq; +import com.ruoyi.system.domain.req.TRecordResultReq; +import com.ruoyi.system.service.*; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; +import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; +import javax.annotation.Resource; import java.util.List; /** @@ -32,6 +32,18 @@ public class AppController extends BaseController @Autowired private ITHospitalService tHospitalService; + @Resource + private ITDoctorService tDoctorService; + + @Resource + private ITPatientService tPatientService; + + @Resource + private ITPatientHospitalDoctorService itPatientHospitalDoctorService; + + @Resource + private ISysConfigService configService; + /** * 完成AI诊断 @@ -40,8 +52,8 @@ public class AppController extends BaseController @GetMapping("/ai/finish") public AjaxResult finish(Long id) { - TRecord record= tRecordService.selectTRecordById(id); - if(record!=null) + TRecord record = tRecordService.selectTRecordById(id); + if (record != null) { record.setStatus("1"); } @@ -49,9 +61,166 @@ public class AppController extends BaseController } + /** + * 医院列表 + */ + @ApiOperation("医院列表") @GetMapping("/hospital/list") public AjaxResult hospitalList() { List tHospitals = tHospitalService.selectTHospitalList(new THospital()); return AjaxResult.success(tHospitals); } + + + /** + * 医生信息获取 + * + * @param doctorId 医生id + * @return {@code AjaxResult} + */ + @ApiOperation("医生信息获取") + @GetMapping("/doctor/info") + public AjaxResult doctorInformation(Long doctorId) + { + TDoctor tDoctor = tDoctorService.selectTDoctorById(doctorId); + return AjaxResult.success(tDoctor); + } + + /** + * 患者预约 + * + * @param appPatientHospitalDoctor 应用病人医院医生 + * @return {@code AjaxResult} + */ + @ApiOperation("患者预约") + @GetMapping("/patient/makeAnAppointment") + public AjaxResult patientsToMakeAnAppointment(AppPatientHospitalDoctor appPatientHospitalDoctor) + { + // 患者预约,新增t_record中的一条记录;判断关联表是否存在当前关系 + TPatientHospitalDoctor tPatientHospitalDoctor = new TPatientHospitalDoctor(); + BeanUtils.copyProperties(appPatientHospitalDoctor, tPatientHospitalDoctor); + TRecord tRecord = new TRecord(); + tRecord.setHospitalId(tPatientHospitalDoctor.getHospitalId()); + tRecord.setPatientId(tPatientHospitalDoctor.getPatientId()); + tRecord.setDoctorId(tPatientHospitalDoctor.getDoctorId()); + tRecord.setStatus("0"); + tRecord.setCreateBy(getUsername()); + tRecordService.insertTRecord(tRecord); + List tPHDs = itPatientHospitalDoctorService.selectTPatientHospitalDoctorList(tPatientHospitalDoctor); + if (tPHDs.isEmpty()) + { + itPatientHospitalDoctorService.insertTPatientHospitalDoctor(tPatientHospitalDoctor); + } + return AjaxResult.success(); + } + + @PutMapping("/record/ai/finish/{id}") + @Log(title = "修改患者记录至已诊状态") + public AjaxResult updateStatus(@PathVariable("id") Long id){ + if(id == null){ + return AjaxResult.error("未获取到记录id"); + } + TRecord tRecord = new TRecord(); + tRecord.setId(id); + tRecord.setStatus("1"); + tRecordService.updateTRecord(tRecord); + return AjaxResult.success("更新状态成功",null); + } + + @GetMapping(value = "/config/ai/refreshtime") + @Log(title = "获取AI结果刷新时间接口") + public AjaxResult getConfigKey() + { + String configKey="t.ai.refreshtime"; + return AjaxResult.success(configService.selectConfigByKey(configKey)); + } + + /** + * 诊断记录上传 + * + * @return {@code AjaxResult} + */ + @ApiOperation("诊断记录上传") + @PostMapping("/record/diagnostic/upload") + public AjaxResult diagnosticRecordsUploaded(TRecord tRecord) { + return AjaxResult.success(tRecordService.updateTRecord(tRecord)); + } + + /** + * 添加病人 + * + * @param tPatient t病人 + * @return {@code AjaxResult} + */ + @ApiOperation("添加患者") + @PostMapping("/patient/add") + public AjaxResult addPatient(AppPatientReq tPatient) + { + tPatientService.insertTPatient(tPatient); + TPatientHospitalDoctor tPatientHospitalDoctor = new TPatientHospitalDoctor(); + tPatientHospitalDoctor.setHospitalId(tPatient.getHospitalId()); + tPatientHospitalDoctor.setDoctorId(tPatient.getDoctorId()); + tPatientHospitalDoctor.setPatientId(tPatient.getId()); + List tPatientHospitalDoctors = itPatientHospitalDoctorService.selectTPatientHospitalDoctorList(tPatientHospitalDoctor); + if (tPatientHospitalDoctors.isEmpty()) + { + itPatientHospitalDoctorService.insertTPatientHospitalDoctor(tPatientHospitalDoctor); + } + return AjaxResult.success(); + } + + /** + * 诊断记录列表 + * + * @param appPatientHospitalDoctor 应用病人医院医生 + * @return {@code AjaxResult} + */ + @ApiOperation("诊断记录列表") + @GetMapping("/record/list") + public AjaxResult diagnosisOfRecordList(AppPatientHospitalDoctor appPatientHospitalDoctor) { + TPatientHospitalDoctor tPatientHospitalDoctor = new TPatientHospitalDoctor(); + BeanUtils.copyProperties(appPatientHospitalDoctor, tPatientHospitalDoctor); + List tRecords = tRecordService.queryRecordListByPHDids(tPatientHospitalDoctor); + return AjaxResult.success(tRecords); + } + + /** + * 患者诊断记录信息细节 + * + * @param id id + * @return {@code AjaxResult} + */ + @ApiOperation("患者诊断记录信息详情") + @GetMapping("/record/info") + public AjaxResult patientsWithDiagnosisOfRecordInformationDetails(Long id) { + return AjaxResult.success(tRecordService.selectById(id)); + } + + + /** + * 患者已诊列表 + * + * @param recordResultReq 记录结果要求 + * @return {@code AjaxResult} + */ + @ApiOperation("患者已诊列表") + @GetMapping("/record/diagnosedList") + public AjaxResult patientsDiagnosedList(TRecordResultReq recordResultReq) { + recordResultReq.setStatus("0"); + return AjaxResult.success(tRecordService.selectTRecordListWithoutResult(recordResultReq)); + } + + + /** + * 病人等待名单 + * + * @param recordResultReq 记录结果要求 + * @return {@code AjaxResult} + */ + @ApiOperation("患者候诊列表") + @GetMapping("/record/waitingList") + public AjaxResult patientsWaitingList(TRecordResultReq recordResultReq) { + recordResultReq.setStatus("2"); + return AjaxResult.success(tRecordService.selectTRecordListWithoutResult(recordResultReq)); + } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/pc/PlatformController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/pc/PlatformController.java new file mode 100644 index 0000000..92696ff --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/pc/PlatformController.java @@ -0,0 +1,68 @@ +package com.ruoyi.web.controller.pc; + +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.system.domain.TPatient; +import com.ruoyi.system.domain.resp.PlatformDayPlanResp; +import com.ruoyi.system.domain.resp.WeekMonthPersonCountResp; +import com.ruoyi.system.service.ITRecordService; +import com.ruoyi.system.service.impl.PlatformService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; +import java.util.Map; + + +/** + * @Author zhuqing + * @Date 2022/8/9 + * 工作台 + */ +@RestController +@RequestMapping("/platform") +@Api("工作台") +public class PlatformController { + + @Autowired + private PlatformService platformService; + + @ApiOperation("工作台-设备统计") + @PostMapping("/equCount") + public AjaxResult equCount( + @ApiParam(name = "hospitalId",value = "医院id",required = false) @RequestParam(required = false) Long hospitalId, + @ApiParam(name = "doctorId",value = "医生id",required = false) @RequestParam(required = false) Long doctorId){ + Map stringIntegerMap = platformService.equCount(hospitalId, doctorId); + return AjaxResult.success(stringIntegerMap); + } + + @ApiOperation("工作台-今日就诊计划") + @PostMapping("/dayPlan") + public AjaxResult dayPlan( + @ApiParam(name = "hospitalId",value = "医院id",required = false) @RequestParam(required = false) Long hospitalId, + @ApiParam(name = "doctorId",value = "医生id",required = false) @RequestParam(required = false) Long doctorId){ + List platformDayPlanResps = platformService.dayPlan(hospitalId, doctorId); + return AjaxResult.success(platformDayPlanResps); + } + + @ApiOperation("工作台-就诊人数统计") + @PostMapping("/weekMonthPersonCount") + public AjaxResult weekMonthPersonCount( + @ApiParam(name = "hospitalId",value = "医院id",required = false) @RequestParam(required = false) Long hospitalId, + @ApiParam(name = "doctorId",value = "医生id",required = false) @RequestParam(required = false) Long doctorId, + @ApiParam(name = "weekMonth",value = "周月的区分 1-周 2-月",required = false) @RequestParam(required = false) Long weekMonth){ + List weekMonthPersonCountResps = platformService.weekMonthPersonCount(hospitalId, doctorId,weekMonth); + return AjaxResult.success(weekMonthPersonCountResps); + } + + @ApiOperation("工作台-患者年龄统计") + @PostMapping("/ageCount") + public AjaxResult ageCount( + @ApiParam(name = "hospitalId",value = "医院id",required = false) @RequestParam(required = false) Long hospitalId, + @ApiParam(name = "doctorId",value = "医生id",required = false) @RequestParam(required = false) Long doctorId){ + List tPatients = platformService.ageCount(hospitalId,doctorId); + return AjaxResult.success(tPatients); + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/pc/THospitalController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/pc/THospitalController.java index 5410b2c..4bffa50 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/pc/THospitalController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/pc/THospitalController.java @@ -2,7 +2,9 @@ package com.ruoyi.web.controller.pc; import java.util.List; import javax.servlet.http.HttpServletResponse; -import org.springframework.security.access.prepost.PreAuthorize; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; @@ -27,6 +29,7 @@ import com.ruoyi.common.core.page.TableDataInfo; * @author ruoyi * @date 2022-08-03 */ +@Api("pc-医院列表") @RestController @RequestMapping("/system/hospital") public class THospitalController extends BaseController @@ -37,6 +40,7 @@ public class THospitalController extends BaseController /** * 查询医院信息列表 */ + @ApiOperation("查询医院信息列表") @GetMapping("/list") public TableDataInfo list(THospital tHospital) { @@ -60,6 +64,7 @@ public class THospitalController extends BaseController /** * 获取医院信息详细信息 */ + @ApiOperation("获取医院信息详细信息") @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") Long id) { @@ -69,6 +74,7 @@ public class THospitalController extends BaseController /** * 新增医院信息 */ + @ApiOperation("新增医院信息") @Log(title = "医院信息", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody THospital tHospital) @@ -79,6 +85,7 @@ public class THospitalController extends BaseController /** * 修改医院信息 */ + @ApiOperation("修改医院信息") @Log(title = "医院信息", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody THospital tHospital) @@ -89,6 +96,7 @@ public class THospitalController extends BaseController /** * 删除医院信息 */ + @ApiOperation("删除医院信息") @Log(title = "医院信息", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable Long[] ids) 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..e2b6e98 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,12 @@ package com.ruoyi.web.controller.pc; import java.util.List; import javax.servlet.http.HttpServletResponse; + +import com.ruoyi.system.domain.TPatientHospitalDoctor; +import com.ruoyi.system.domain.req.TRecordResultReq; +import com.ruoyi.system.domain.resp.TRecordResp; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; @@ -23,10 +29,11 @@ import com.ruoyi.common.core.page.TableDataInfo; /** * 诊断记录信息Controller - * + * * @author ruoyi * @date 2022-08-03 */ +@Api("pc-就诊记录") @RestController @RequestMapping("/system/record") public class TRecordController extends BaseController @@ -37,12 +44,12 @@ public class TRecordController extends BaseController /** * 查询诊断记录信息列表 */ - @PreAuthorize("@ss.hasPermi('system:record:list')") + @ApiOperation("查询就诊记录列表") @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); } @@ -101,4 +108,19 @@ public class TRecordController extends BaseController { return toAjax(tRecordService.deleteTRecordByIds(ids)); } + + @GetMapping("getInfo/{id}") + @ApiOperation("查询患者诊断记录信息") + public AjaxResult getInfoById(@PathVariable("id") Long id){ + if(id == null){ + return AjaxResult.error("未获取到id"); + } + return AjaxResult.success(tRecordService.selectById(id)); + } + + @GetMapping("getHistoryList") + @ApiOperation("查询患者历史数据图表") + public AjaxResult getHistoryList(TRecord tRecord){ + return null; + } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java index 7f9f138..9ea21fc 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java @@ -5,7 +5,12 @@ import java.util.Set; import com.ruoyi.system.domain.req.AppRegisterReq; import io.swagger.annotations.ApiOperation; +import com.ruoyi.system.domain.TDoctor; +import com.ruoyi.system.domain.THospital; +import com.ruoyi.system.service.ITDoctorService; +import com.ruoyi.system.service.ITHospitalService; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.ObjectUtils; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; @@ -38,6 +43,12 @@ public class SysLoginController @Autowired private SysPermissionService permissionService; + @Autowired + private ITHospitalService itHospitalService; + + @Autowired + private ITDoctorService itDoctorService; + /** * 登录方法 * @@ -84,6 +95,19 @@ public class SysLoginController ajax.put("user", user); ajax.put("roles", roles); ajax.put("permissions", permissions); + //添加医生和医院标识返回 + THospital tHospital = new THospital(); + tHospital.setAdminId(user.getUserId()); + List tHospitals = itHospitalService.selectTHospitalList(tHospital); + if (!ObjectUtils.isEmpty(tHospitals)){ + ajax.put("hospitalId", tHospitals.get(0).getId()); + } + TDoctor tDoctor = new TDoctor(); + tDoctor.setUserId(user.getUserId()); + List selectTDoctorList = itDoctorService.selectTDoctorList(tDoctor); + if (!ObjectUtils.isEmpty(selectTDoctorList)){ + ajax.put("doctorId", selectTDoctorList.get(0).getId()); + } return ajax; } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/THospital.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/THospital.java index 1cb1aaa..13ea616 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain/THospital.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/THospital.java @@ -1,32 +1,41 @@ package com.ruoyi.system.domain; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; import com.ruoyi.common.annotation.Excel; import com.ruoyi.common.core.domain.BaseEntity; +import javax.validation.constraints.NotNull; + /** * 医院信息对象 t_hospital * * @author ruoyi * @date 2022-08-04 */ +@ApiModel(value = "THospital", description = "PC端医院实体") public class THospital extends BaseEntity { private static final long serialVersionUID = 1L; /** ID */ + @ApiModelProperty("id") private Long id; /** 名称 */ + @ApiModelProperty("名称") @Excel(name = "名称") private String name; /** 排序 */ + @ApiModelProperty("排序") @Excel(name = "排序") private Long num; /** 管理员ID */ + @ApiModelProperty("管理员ID") @Excel(name = "管理员ID") private Long adminId; diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/TRecord.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/TRecord.java index 71e5324..70009e2 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain/TRecord.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/TRecord.java @@ -69,6 +69,14 @@ public class TRecord extends BaseEntity @Excel(name = "响应时长") private Long responseTime; + /** 响应时长 */ + @Excel(name = "ai结果返回时间") + private Date aiResultReturnTime; + + /** 响应时长 */ + @Excel(name = "ai结果修改时间") + private Date aiResultModifyTime; + public void setId(Long id) { this.id = id; @@ -187,6 +195,26 @@ public class TRecord extends BaseEntity return responseTime; } + public Date getAiResultReturnTime() + { + return aiResultReturnTime; + } + + public void setAiResultReturnTime(Date aiResultReturnTime) + { + this.aiResultReturnTime = aiResultReturnTime; + } + + public Date getAiResultModifyTime() + { + return aiResultModifyTime; + } + + public void setAiResultModifyTime(Date aiResultModifyTime) + { + this.aiResultModifyTime = aiResultModifyTime; + } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) @@ -205,6 +233,8 @@ public class TRecord extends BaseEntity .append("imgSx", getImgSx()) .append("imgSm", getImgSm()) .append("responseTime", getResponseTime()) + .append("aiResultReturnTime", getAiResultReturnTime()) + .append("aiResultModifyTime", getAiResultModifyTime()) .toString(); } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/req/AppPatientHospitalDoctor.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/req/AppPatientHospitalDoctor.java new file mode 100644 index 0000000..b966230 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/req/AppPatientHospitalDoctor.java @@ -0,0 +1,64 @@ +package com.ruoyi.system.domain.req; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import javax.validation.constraints.NotNull; +import java.io.Serializable; + +/** + * App端患者预约入参实体 + * + * @author gongzhenkun + * @date 2022/8/9 14:48 + */ +@ApiModel(value = "AppPatientHospitalDoctor", description = "App端患者预约入参实体") +public class AppPatientHospitalDoctor implements Serializable +{ + private static final long serialVersionUID = 1L; + + /** 患者ID */ + @NotNull(message = "patientId不为空") + @ApiModelProperty("patientId") + private Long patientId; + + /** 医院ID */ + @NotNull(message = "hospitalId不为空") + @ApiModelProperty("hospitalId") + private Long hospitalId; + + /** 医生ID */ + @NotNull(message = "doctorId不为空") + @ApiModelProperty("doctorId") + private Long doctorId; + + public Long getPatientId() + { + return patientId; + } + + public void setPatientId(Long patientId) + { + this.patientId = patientId; + } + + public Long getHospitalId() + { + return hospitalId; + } + + public void setHospitalId(Long hospitalId) + { + this.hospitalId = hospitalId; + } + + public Long getDoctorId() + { + return doctorId; + } + + public void setDoctorId(Long doctorId) + { + this.doctorId = doctorId; + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/req/AppPatientReq.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/req/AppPatientReq.java new file mode 100644 index 0000000..4152214 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/req/AppPatientReq.java @@ -0,0 +1,45 @@ +package com.ruoyi.system.domain.req; + +import com.ruoyi.system.domain.TPatient; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import javax.validation.constraints.NotNull; + +/** + * App端添加患者入参实体 + * + * @author gongzhenkun + * @date 2022/8/9 14:32 + */ +@ApiModel(value = "AppPatientReq", description = "App端添加患者入参实体") +public class AppPatientReq extends TPatient +{ + @NotNull(message = "doctorId不为空") + @ApiModelProperty("doctorId") + private Long doctorId; + + @NotNull(message = "hospitalId不为空") + @ApiModelProperty("hospitalId") + private Long hospitalId; + + 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; + } +} 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..82413eb --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/req/TRecordResultReq.java @@ -0,0 +1,156 @@ +package com.ruoyi.system.domain.req; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.common.annotation.Excel; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import java.util.Date; + + + +@ApiModel(value = "TRecordResultReq", description = "就诊分页查询入参实体") +public class TRecordResultReq +{ + + @ApiModelProperty("患者姓名") + private String name; + @ApiModelProperty("患者性别") + private String sex; + @ApiModelProperty("患者年龄") + private Integer age; + @ApiModelProperty("医生id") + private Long doctorId; + @ApiModelProperty("医院id") + private Long hospitalId; + + @JsonFormat(pattern = "yyyy-MM-dd") + private Date createTime; + + @ApiModelProperty("注册日期排序:asc 正序,desc 倒序") + //预约时间排序 + private String doctorOder; + //首诊时间排序 + @ApiModelProperty("首诊时间排序:asc 正序,desc 倒序") + private String firstVisitOder; + @ApiModelProperty("状态") + private String status; + + @ApiModelProperty("初诊日期开始时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date startTime; + @ApiModelProperty("初诊日期结束时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date endTime; + + 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 getDoctorOder() + { + return doctorOder; + } + + public void setDoctorOder(String doctorOder) + { + this.doctorOder = doctorOder; + } + + public String getFirstVisitOder() + { + return firstVisitOder; + } + + public void setFirstVisitOder(String firstVisitOder) + { + this.firstVisitOder = firstVisitOder; + } + + public Date getCreateTime() + { + return createTime; + } + + public void setCreateTime(Date createTime) + { + this.createTime = createTime; + } + + public Date getStartTime() + { + return startTime; + } + + public void setStartTime(Date startTime) + { + this.startTime = startTime; + } + + public Date getEndTime() + { + return endTime; + } + + public void setEndTime(Date endTime) + { + this.endTime = endTime; + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/resp/PlatformDayPlanResp.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/resp/PlatformDayPlanResp.java new file mode 100644 index 0000000..bcc88f4 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/resp/PlatformDayPlanResp.java @@ -0,0 +1,52 @@ +package com.ruoyi.system.domain.resp; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import java.util.Date; + +/** + * @Author zhuqing + * @Date 2022/8/9 + */ +@ApiModel(value = "PlatformDayPlanResp", description = "工作台今日就诊计划反参实体") +public class PlatformDayPlanResp { + + /** 医院 */ + @ApiModelProperty("name") + private String name; + + /** 状态(0预约 1就诊) */ + @ApiModelProperty("状态(0预约 1就诊)") + private String status; + + /** 创建时间 */ + @JsonFormat(pattern = "HH:mm") + @ApiModelProperty("创建时间") + private Date createTime; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + 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..7d813ec --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/resp/TRecordResp.java @@ -0,0 +1,349 @@ +package com.ruoyi.system.domain.resp; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.common.annotation.Excel; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import java.util.Date; + + +@ApiModel(value = "TRecordResp", description = "就诊记录分页查询反参实体") +public class TRecordResp +{ + /** ID */ + @ApiModelProperty("患者就诊记录id") + private Long id; + + /** 患者 */ + @Excel(name = "患者") + @ApiModelProperty("患者id") + private Long patientId; + + /** 医生 */ + @Excel(name = "医生") + @ApiModelProperty("医生id") + private Long doctorId; + + /** 医院 */ + @ApiModelProperty("医院id") + @Excel(name = "医院") + private Long hospitalId; + + /** 状态(0预约 1就诊) */ + @Excel(name = "状态", readConverterExp = "0=预约,1=就诊") + @ApiModelProperty("状态(0预约 1就诊)") + private String status; + + /** ai诊断结果 */ + @Excel(name = "ai诊断结果") + @ApiModelProperty("ai诊断结果") + private String aiResult; + + /** ai诊断结果,无图片 */ + @Excel(name = "ai诊断结果,无图片") + @ApiModelProperty("ai诊断结果,无图片") + private String aiResult2; + + /** 医生诊断结果 */ + @Excel(name = "医生诊断结果") + @ApiModelProperty("医生诊断结果") + private String updateResult; + + /** 医生诊断结果,无图片 */ + @Excel(name = "医生诊断结果,无图片") + @ApiModelProperty("医生诊断结果,无图片") + private String updateResult2; + + /** 上传时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "上传时间", width = 30, dateFormat = "yyyy-MM-dd") + @ApiModelProperty("上传时间") + private Date uploadTime; + + @JsonFormat(pattern = "yyyy-MM-dd") + @ApiModelProperty("待诊时间") + private Date waitingTime; + + /** 舌下 */ + @Excel(name = "舌下") + @ApiModelProperty("舌下") + private String imgSx; + + /** 舌上 */ + @Excel(name = "舌上") + @ApiModelProperty("舌上") + private String imgSm; + + /** 响应时长 */ + @Excel(name = "响应时长") + @ApiModelProperty("响应时长") + private Long responseTime; + + @Excel(name = "编号") + @ApiModelProperty("编号") + private String identifier; + + /** 名称 */ + @Excel(name = "名称") + @ApiModelProperty("患者名称") + private String patientName; + @ApiModelProperty("医生名称") + private String doctorName; + + @Excel(name = "用户性别", readConverterExp = "0=男,1=女,2=未知") + @ApiModelProperty("用户性别") + private String sex; + + /** 年龄 */ + @Excel(name = "年龄") + @ApiModelProperty("患者年龄") + private Integer age; + + /** 基础疾病 */ + @Excel(name = "基础疾病") + @ApiModelProperty("基础疾病") + private String disease; + + @JsonFormat(pattern = "yyyy-MM-dd") + @ApiModelProperty("初诊时间") + private Date firstTime; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty("ai结果返回时间") + private Date aiResultReturnTime; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty("ai结果修改时间") + private Date aiResultModifyTime; + + 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 getDisease() + { + return disease; + } + + public void setDisease(String disease) + { + this.disease = disease; + } + + public Date getFirstTime() + { + return firstTime; + } + + public void setFirstTime(Date firstTime) + { + this.firstTime = firstTime; + } + + public Date getAiResultReturnTime() + { + return aiResultReturnTime; + } + + public void setAiResultReturnTime(Date aiResultReturnTime) + { + this.aiResultReturnTime = aiResultReturnTime; + } + + public Date getAiResultModifyTime() + { + return aiResultModifyTime; + } + + public void setAiResultModifyTime(Date aiResultModifyTime) + { + this.aiResultModifyTime = aiResultModifyTime; + } + + public Date getWaitingTime() + { + return waitingTime; + } + + public void setWaitingTime(Date waitingTime) + { + this.waitingTime = waitingTime; + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/resp/WeekMonthPersonCountResp.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/resp/WeekMonthPersonCountResp.java new file mode 100644 index 0000000..1ec0fc8 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/resp/WeekMonthPersonCountResp.java @@ -0,0 +1,40 @@ +package com.ruoyi.system.domain.resp; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import java.util.Date; + +/** + * @Author zhuqing + * @Date 2022/8/9 + */ +@ApiModel(value = "WeekMonthPersonCountResp", description = "工作台今日就诊计划反参实体") +public class WeekMonthPersonCountResp { + + /** 医院 */ + @ApiModelProperty("count") + private int count; + + /** 创建时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @ApiModelProperty("创建时间") + private Date createTime; + + public int getCount() { + return count; + } + + public void setCount(int count) { + this.count = count; + } + + 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..20b4152 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 @@ -1,19 +1,70 @@ package com.ruoyi.system.mapper; import java.util.List; + +import com.ruoyi.system.domain.TPatientHospitalDoctor; + +import com.ruoyi.system.domain.TPatient; import com.ruoyi.system.domain.TRecord; +import com.ruoyi.system.domain.req.TRecordResultReq; +import com.ruoyi.system.domain.resp.PlatformDayPlanResp; +import com.ruoyi.system.domain.resp.TRecordResp; +import com.ruoyi.system.domain.resp.WeekMonthPersonCountResp; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; /** * 诊断记录信息Mapper接口 - * + * * @author ruoyi * @date 2022-08-03 */ -public interface TRecordMapper +@Mapper +public interface TRecordMapper { + /** + * --------------------------工作台相关接口------------------------------------------ + */ + /** + * 设备统计各个个数查询 + * @param hospitalId + * @param doctorId + * @return + */ + int selectEquCount(@Param("hospitalId") Long hospitalId, + @Param("doctorId")Long doctorId, + @Param("status")String status, + @Param("month")Long month, + @Param("week")Long week, + @Param("day")Long day); + + /** + * 今日就诊计划 + * @param hospitalId + * @param doctorId + * @return + */ + List dayPlan(@Param("hospitalId") Long hospitalId, + @Param("doctorId")Long doctorId); + + /** + * 就诊人数统计 1-周 2-月 + * @param hospitalId + * @param doctorId + * @param weekMonth + * @return + */ + List weekMonthPersonCount(@Param("hospitalId")Long hospitalId, + @Param("doctorId")Long doctorId, + @Param("weekMonth")Long weekMonth); + + + List ageCount(@Param("hospitalId")Long hospitalId, + @Param("doctorId")Long doctorId); + /** * 查询诊断记录信息 - * + * * @param id 诊断记录信息主键 * @return 诊断记录信息 */ @@ -21,7 +72,7 @@ public interface TRecordMapper /** * 查询诊断记录信息列表 - * + * * @param tRecord 诊断记录信息 * @return 诊断记录信息集合 */ @@ -29,7 +80,7 @@ public interface TRecordMapper /** * 新增诊断记录信息 - * + * * @param tRecord 诊断记录信息 * @return 结果 */ @@ -37,7 +88,7 @@ public interface TRecordMapper /** * 修改诊断记录信息 - * + * * @param tRecord 诊断记录信息 * @return 结果 */ @@ -45,7 +96,7 @@ public interface TRecordMapper /** * 删除诊断记录信息 - * + * * @param id 诊断记录信息主键 * @return 结果 */ @@ -53,9 +104,21 @@ public interface TRecordMapper /** * 批量删除诊断记录信息 - * + * * @param ids 需要删除的数据主键集合 * @return 结果 */ public int deleteTRecordByIds(Long[] ids); + + List selectTRecordListWithoutResult(TRecordResultReq tRecord); + + TRecordResp selectById(Long id); + + /** + * 通过病人医院医生id查询记录列表 + * + * @param tPatientHospitalDoctor t病人医院医生 + * @return {@code List} + */ + public List queryRecordListByPHDids(TPatientHospitalDoctor tPatientHospitalDoctor); } 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..8512ded 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 @@ -1,19 +1,23 @@ package com.ruoyi.system.service; import java.util.List; + +import com.ruoyi.system.domain.TPatientHospitalDoctor; 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 +25,7 @@ public interface ITRecordService /** * 查询诊断记录信息列表 - * + * * @param tRecord 诊断记录信息 * @return 诊断记录信息集合 */ @@ -29,7 +33,7 @@ public interface ITRecordService /** * 新增诊断记录信息 - * + * * @param tRecord 诊断记录信息 * @return 结果 */ @@ -37,7 +41,7 @@ public interface ITRecordService /** * 修改诊断记录信息 - * + * * @param tRecord 诊断记录信息 * @return 结果 */ @@ -45,7 +49,7 @@ public interface ITRecordService /** * 批量删除诊断记录信息 - * + * * @param ids 需要删除的诊断记录信息主键集合 * @return 结果 */ @@ -53,9 +57,33 @@ public interface ITRecordService /** * 删除诊断记录信息信息 - * + * * @param id 诊断记录信息主键 * @return 结果 */ public int deleteTRecordById(Long id); + + /** + * 查询就诊记录信息列表 + * + * @param tRecord 查询参数 + * @return 结果 + */ + List selectTRecordListWithoutResult(TRecordResultReq tRecord); + + /** + * 根据患者记录id查询就诊记录详情 + * + * @param id 查询参数 + * @return 结果 + */ + TRecordResp selectById(Long id); + + /** + * 通过病人医院医生id查询记录列表 + * + * @param tPatientHospitalDoctor t病人医院医生 + * @return {@code List} + */ + public List queryRecordListByPHDids(TPatientHospitalDoctor tPatientHospitalDoctor); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/PlatformService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/PlatformService.java new file mode 100644 index 0000000..e01cc65 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/PlatformService.java @@ -0,0 +1,72 @@ +package com.ruoyi.system.service.impl; + +import com.ruoyi.system.domain.TPatient; +import com.ruoyi.system.domain.resp.PlatformDayPlanResp; +import com.ruoyi.system.domain.resp.WeekMonthPersonCountResp; +import com.ruoyi.system.mapper.TRecordMapper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @Author zhuqing + * @Date 2022/8/9 + */ +@Component +public class PlatformService { + + @Autowired + private TRecordMapper tRecordMapper; + + /** + * 设备统计各个个数查询 + * @param hospitalId + * @param doctorId + * @return + */ + public Map equCount(Long hospitalId, Long doctorId) { + //就诊总数 + int all = tRecordMapper.selectEquCount(hospitalId, doctorId, "1", null, null,null); + //本月总数 + int month = tRecordMapper.selectEquCount(hospitalId, doctorId, "1", 1L, null,null); + //本周总数 + int week = tRecordMapper.selectEquCount(hospitalId, doctorId, "1", null, 1L,null); + //今日预约 + int day = tRecordMapper.selectEquCount(hospitalId, doctorId, "0", null, null,1L); + Map map = new HashMap(){{ + put("all",all); + put("month",month); + put("week",week); + put("day",day); + }}; + return map; + } + + /** + * 今日就诊计划 + * @param hospitalId + * @param doctorId + * @return + */ + public List dayPlan(Long hospitalId, Long doctorId) { + return tRecordMapper.dayPlan(hospitalId, doctorId); + } + + /** + * 周/月就诊人数统计 + * @param hospitalId + * @param doctorId + * @param weekMonth + * @return + */ + public List weekMonthPersonCount(Long hospitalId, Long doctorId,Long weekMonth) { + return tRecordMapper.weekMonthPersonCount(hospitalId, doctorId,weekMonth); + } + + public List ageCount(Long hospitalId, Long doctorId) { + return tRecordMapper.ageCount(hospitalId, doctorId); + } +} 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..658960d 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,9 @@ package com.ruoyi.system.service.impl; import java.util.List; import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.system.domain.TPatientHospitalDoctor; +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 +13,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 +37,7 @@ public class TRecordServiceImpl implements ITRecordService /** * 查询诊断记录信息列表 - * + * * @param tRecord 诊断记录信息 * @return 诊断记录信息 */ @@ -46,7 +49,7 @@ public class TRecordServiceImpl implements ITRecordService /** * 新增诊断记录信息 - * + * * @param tRecord 诊断记录信息 * @return 结果 */ @@ -59,7 +62,7 @@ public class TRecordServiceImpl implements ITRecordService /** * 修改诊断记录信息 - * + * * @param tRecord 诊断记录信息 * @return 结果 */ @@ -72,7 +75,7 @@ public class TRecordServiceImpl implements ITRecordService /** * 批量删除诊断记录信息 - * + * * @param ids 需要删除的诊断记录信息主键 * @return 结果 */ @@ -84,7 +87,7 @@ public class TRecordServiceImpl implements ITRecordService /** * 删除诊断记录信息信息 - * + * * @param id 诊断记录信息主键 * @return 结果 */ @@ -93,4 +96,22 @@ public class TRecordServiceImpl implements ITRecordService { return tRecordMapper.deleteTRecordById(id); } + + @Override + public List selectTRecordListWithoutResult(TRecordResultReq tRecord) + { + return tRecordMapper.selectTRecordListWithoutResult(tRecord); + } + + @Override + public TRecordResp selectById(Long id) + { + return tRecordMapper.selectById(id); + } + + @Override + public List queryRecordListByPHDids(TPatientHospitalDoctor tPatientHospitalDoctor) + { + return tRecordMapper.queryRecordListByPHDids(tPatientHospitalDoctor); + } } diff --git a/ruoyi-system/src/main/resources/mapper/system/TRecordMapper.xml b/ruoyi-system/src/main/resources/mapper/system/TRecordMapper.xml index e5ab34f..a27682c 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"> - + @@ -20,15 +20,128 @@ 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, + tr.create_time AS waitingTime, + tr.ai_result_return_time AS aiResultReturnTime, + tr.ai_result_modify_time AS aiResultModifyTime, + td.NAME AS doctorName, + tp.identifier, + tp.NAME AS patientName, + tp.sex, + tp.age, + tp.disease, + tp.img_sx AS imgSx, + tp.img_sm AS imgSm, + tp.create_time AS firstTime + 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, + tr.create_time AS waitingTime, + tr.ai_result_return_time AS aiResultReturnTime, + tr.ai_result_modify_time AS aiResultModifyTime, + td.NAME AS doctorName, + tp.identifier, + tp.NAME AS patientName, + tp.sex, + tp.age, + tp.disease, + tp.create_time AS firstTime + 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 @@ -66,6 +195,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" img_sx, img_sm, response_time, + ai_result_return_time, + ai_result_modify_time, #{patientId}, @@ -82,6 +213,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{imgSx}, #{imgSm}, #{responseTime}, + #{aiResultReturnTime}, + #{aiResultModifyTime}, @@ -102,6 +235,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" img_sx = #{imgSx}, img_sm = #{imgSm}, response_time = #{responseTime}, + ai_result_return_time = #{aiResultReturnTime}, + ai_result_modify_time = #{aiResultModifyTime}, where id = #{id} @@ -111,9 +246,23 @@ 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 + + + + +