From 25b547b695f43ddb4beecf8abd13561da76f7bcd Mon Sep 17 00:00:00 2001 From: zhuqing Date: Thu, 4 Aug 2022 17:50:27 +0800 Subject: [PATCH] TDoctor + patient --- .../web/controller/pc/TDoctorController.java | 47 ++-- .../web/controller/pc/TPatientController.java | 43 ++- ruoyi-system/pom.xml | 6 + .../domain/req/PcTDoctorQueryByPageReq.java | 79 ++++++ .../system/domain/req/PcTDoctorUpdateReq.java | 203 +++++++++++++++ .../domain/req/PcTPatintQueryByPageReq.java | 87 +++++++ .../domain/resp/PcTDoctorQueryByPageResp.java | 245 ++++++++++++++++++ .../resp/PcTPatientQueryByPageResp.java | 205 +++++++++++++++ .../ruoyi/system/mapper/TDoctorMapper.java | 20 ++ .../ruoyi/system/mapper/TPatientMapper.java | 4 + .../ruoyi/system/service/ITDoctorService.java | 4 + .../system/service/ITPatientService.java | 4 + .../service/impl/TDoctorServiceImpl.java | 9 + .../service/impl/TPatientServiceImpl.java | 7 + .../resources/mapper/system/TDoctorMapper.xml | 41 ++- .../mapper/system/TPatientMapper.xml | 35 ++- 16 files changed, 989 insertions(+), 50 deletions(-) create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/domain/req/PcTDoctorQueryByPageReq.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/domain/req/PcTDoctorUpdateReq.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/domain/req/PcTPatintQueryByPageReq.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/domain/resp/PcTDoctorQueryByPageResp.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/domain/resp/PcTPatientQueryByPageResp.java diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/pc/TDoctorController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/pc/TDoctorController.java index 26fdd3c..091e945 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/pc/TDoctorController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/pc/TDoctorController.java @@ -3,10 +3,15 @@ package com.ruoyi.web.controller.pc; import java.util.List; import javax.servlet.http.HttpServletResponse; +import com.ruoyi.system.domain.req.PcTDoctorQueryByPageReq; +import com.ruoyi.system.domain.req.PcTDoctorUpdateReq; +import com.ruoyi.system.domain.resp.PcTDoctorQueryByPageResp; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; +import org.springframework.beans.BeanUtils; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PutMapping; @@ -32,7 +37,7 @@ import com.ruoyi.common.core.page.TableDataInfo; */ @Api("pc-医生列表") @RestController -@RequestMapping("/system/doctor") +@RequestMapping("/system/doctorpc") public class TDoctorController extends BaseController { @Autowired @@ -41,18 +46,19 @@ public class TDoctorController extends BaseController /** * 查询医生信息列表 */ - @GetMapping("/list") - public TableDataInfo list(TDoctor tDoctor) + @ApiOperation("查询医生信息列表") + @PostMapping("/queryByPage") + public TableDataInfo queryByPage(@RequestBody @Validated PcTDoctorQueryByPageReq pcTDoctorQueryByPageReq) { startPage(); - List list = tDoctorService.selectTDoctorList(tDoctor); + List list = tDoctorService.queryByPage(pcTDoctorQueryByPageReq); return getDataTable(list); } /** * 导出医生信息列表 */ - @PreAuthorize("@ss.hasPermi('system:doctor:export')") + @ApiOperation("导出医生信息列表") @Log(title = "医生信息", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, TDoctor tDoctor) @@ -65,43 +71,34 @@ public class TDoctorController extends BaseController /** * 获取医生信息详细信息 */ - @PreAuthorize("@ss.hasPermi('system:doctor:query')") - @GetMapping(value = "/{id}") + @ApiOperation("获取医生信息详细信息") + @GetMapping(value = "/queryById/{id}") public AjaxResult getInfo(@PathVariable("id") Long id) { return AjaxResult.success(tDoctorService.selectTDoctorById(id)); } - /** - * 新增医生信息 - */ - @PreAuthorize("@ss.hasPermi('system:doctor:add')") - @Log(title = "医生信息", businessType = BusinessType.INSERT) - @PostMapping - public AjaxResult add(@RequestBody TDoctor tDoctor) - { - return toAjax(tDoctorService.insertTDoctor(tDoctor)); - } - /** * 修改医生信息 */ - @PreAuthorize("@ss.hasPermi('system:doctor:edit')") - @Log(title = "医生信息", businessType = BusinessType.UPDATE) + @ApiOperation("修改医生信息") + @Log(title = "修改医生信息", businessType = BusinessType.UPDATE) @PutMapping - public AjaxResult edit(@RequestBody TDoctor tDoctor) + public AjaxResult edit(@RequestBody @Validated PcTDoctorUpdateReq pcTDoctorUpdateReq) { + TDoctor tDoctor = new TDoctor(); + BeanUtils.copyProperties(pcTDoctorUpdateReq,tDoctor); return toAjax(tDoctorService.updateTDoctor(tDoctor)); } /** * 删除医生信息 */ - @PreAuthorize("@ss.hasPermi('system:doctor:remove')") + @ApiOperation("删除医生信息") @Log(title = "医生信息", businessType = BusinessType.DELETE) - @DeleteMapping("/{ids}") - public AjaxResult remove(@PathVariable Long[] ids) + @DeleteMapping("/deleteById/{id}") + public AjaxResult remove(@PathVariable("id") Long id) { - return toAjax(tDoctorService.deleteTDoctorByIds(ids)); + return toAjax(tDoctorService.deleteTDoctorById(id)); } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/pc/TPatientController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/pc/TPatientController.java index 4a80fcc..3c0f3b5 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/pc/TPatientController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/pc/TPatientController.java @@ -2,8 +2,15 @@ package com.ruoyi.web.controller.pc; import java.util.List; import javax.servlet.http.HttpServletResponse; + +import com.ruoyi.system.domain.req.PcTDoctorQueryByPageReq; +import com.ruoyi.system.domain.req.PcTPatintQueryByPageReq; +import com.ruoyi.system.domain.resp.PcTPatientQueryByPageResp; +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.validation.annotation.Validated; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PutMapping; @@ -27,6 +34,7 @@ import com.ruoyi.common.core.page.TableDataInfo; * @author ruoyi * @date 2022-08-03 */ +@Api("pc-患者列表") @RestController @RequestMapping("/system/patient") public class TPatientController extends BaseController @@ -37,19 +45,19 @@ public class TPatientController extends BaseController /** * 查询患者信息列表 */ - @PreAuthorize("@ss.hasPermi('system:patient:list')") - @GetMapping("/list") - public TableDataInfo list(TPatient tPatient) + @ApiOperation("查询患者信息列表") + @PostMapping("/queryByPage") + public TableDataInfo queryByPage(@RequestBody @Validated PcTPatintQueryByPageReq pcTPatintQueryByPageReq) { startPage(); - List list = tPatientService.selectTPatientList(tPatient); + List list = tPatientService.queryByPage(pcTPatintQueryByPageReq); return getDataTable(list); } /** * 导出患者信息列表 */ - @PreAuthorize("@ss.hasPermi('system:patient:export')") + @ApiOperation("导出患者信息列表") @Log(title = "患者信息", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, TPatient tPatient) @@ -62,28 +70,17 @@ public class TPatientController extends BaseController /** * 获取患者信息详细信息 */ - @PreAuthorize("@ss.hasPermi('system:patient:query')") - @GetMapping(value = "/{id}") + @ApiOperation("获取患者信息详细信息") + @GetMapping(value = "/queryById/{id}") public AjaxResult getInfo(@PathVariable("id") Long id) { return AjaxResult.success(tPatientService.selectTPatientById(id)); } - /** - * 新增患者信息 - */ - @PreAuthorize("@ss.hasPermi('system:patient:add')") - @Log(title = "患者信息", businessType = BusinessType.INSERT) - @PostMapping - public AjaxResult add(@RequestBody TPatient tPatient) - { - return toAjax(tPatientService.insertTPatient(tPatient)); - } - /** * 修改患者信息 */ - @PreAuthorize("@ss.hasPermi('system:patient:edit')") + @ApiOperation("修改患者信息") @Log(title = "患者信息", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody TPatient tPatient) @@ -94,11 +91,11 @@ public class TPatientController extends BaseController /** * 删除患者信息 */ - @PreAuthorize("@ss.hasPermi('system:patient:remove')") + @ApiOperation("删除患者信息") @Log(title = "患者信息", businessType = BusinessType.DELETE) - @DeleteMapping("/{ids}") - public AjaxResult remove(@PathVariable Long[] ids) + @DeleteMapping("/deleteById/{id}") + public AjaxResult remove(@PathVariable("id") Long id) { - return toAjax(tPatientService.deleteTPatientByIds(ids)); + return toAjax(tPatientService.deleteTPatientById(id)); } } diff --git a/ruoyi-system/pom.xml b/ruoyi-system/pom.xml index f6d547c..0b0bba9 100644 --- a/ruoyi-system/pom.xml +++ b/ruoyi-system/pom.xml @@ -34,6 +34,12 @@ mysql-connector-java 5.1.44 + + + io.swagger + swagger-models + 1.6.2 + diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/req/PcTDoctorQueryByPageReq.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/req/PcTDoctorQueryByPageReq.java new file mode 100644 index 0000000..6118b19 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/req/PcTDoctorQueryByPageReq.java @@ -0,0 +1,79 @@ +package com.ruoyi.system.domain.req; + +import com.ruoyi.common.annotation.Excel; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import javax.validation.constraints.NotNull; +import java.util.Date; + +/** + * @Author zhuqing + * @Date 2022/8/4 + */ +@ApiModel(value = "PcTDoctorQueryByPageReq", description = "PC端分页医生入参实体") +public class PcTDoctorQueryByPageReq { + + @ApiModelProperty("医院id") + private Long hospitalId; + + /** + * startTime + */ + @ApiModelProperty("开始时间") + private Date startTime; + + /** + * endTime + */ + @ApiModelProperty("结束时间") + private Date endTime; + + /** 编号 */ + @ApiModelProperty("编号") + private String identifier; + + /** 名称 */ + @ApiModelProperty("名称") + private String name; + + public String getIdentifier() { + return identifier; + } + + public void setIdentifier(String identifier) { + this.identifier = identifier; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Long getHospitalId() { + return hospitalId; + } + + public void setHospitalId(Long hospitalId) { + this.hospitalId = hospitalId; + } + + 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/req/PcTDoctorUpdateReq.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/req/PcTDoctorUpdateReq.java new file mode 100644 index 0000000..53997a2 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/req/PcTDoctorUpdateReq.java @@ -0,0 +1,203 @@ +package com.ruoyi.system.domain.req; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import javax.validation.constraints.NotNull; + +/** + * @Author zhuqing + * @Date 2022/8/4 + */ +@ApiModel(value = "PcTDoctorUpdateReq", description = "PC端医生修改入参实体") +public class PcTDoctorUpdateReq { + + /** ID */ + @NotNull(message = "id不为空") + @ApiModelProperty("id") + private Long id; + + /** 用户ID */ + @ApiModelProperty("用户ID") + private Long userId; + + /** 编号 */ + @ApiModelProperty("编号") + private String identifier; + + /** 名称 */ + @ApiModelProperty("名称") + private String name; + + /** 电话 */ + @ApiModelProperty("电话") + private String phone; + + /** 用户性别(0男 1女 2未知) */ + @ApiModelProperty("用户性别(0男 1女 2未知) ") + private String sex; + + /** 年龄 */ + @ApiModelProperty("年龄") + private Integer age; + + /** 婚姻状态(0未婚 1已婚 2未知) */ + @ApiModelProperty("婚姻状态(0未婚 1已婚 2未知) ") + private String marriage; + + /** 职称 */ + @ApiModelProperty("职称") + private String title; + + /** 专长 */ + @ApiModelProperty("专长") + private String speciality; + + /** 简介 */ + @ApiModelProperty("简介") + private String introduction; + + /** 职业医师照片路径 */ + @ApiModelProperty("职业医师照片路径") + private String medicalLicense; + + /** 二维码base64 */ + @ApiModelProperty("二维码base64") + private String qrCode; + + /** 医院 */ + @ApiModelProperty("医院") + private Long hospitalId; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getUserId() { + return userId; + } + + public void setUserId(Long userId) { + this.userId = userId; + } + + public String getIdentifier() { + return identifier; + } + + public void setIdentifier(String identifier) { + this.identifier = identifier; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getPhone() { + return phone; + } + + public void setPhone(String phone) { + this.phone = phone; + } + + 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 getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getSpeciality() { + return speciality; + } + + public void setSpeciality(String speciality) { + this.speciality = speciality; + } + + public String getIntroduction() { + return introduction; + } + + public void setIntroduction(String introduction) { + this.introduction = introduction; + } + + public String getMedicalLicense() { + return medicalLicense; + } + + public void setMedicalLicense(String medicalLicense) { + this.medicalLicense = medicalLicense; + } + + public String getQrCode() { + return qrCode; + } + + public void setQrCode(String qrCode) { + this.qrCode = qrCode; + } + + public Long getHospitalId() { + return hospitalId; + } + + public void setHospitalId(Long hospitalId) { + this.hospitalId = hospitalId; + } + + @Override + public String toString() { + return "PcTDoctorUpdateReq{" + + "id=" + id + + ", userId=" + userId + + ", identifier='" + identifier + '\'' + + ", name='" + name + '\'' + + ", phone='" + phone + '\'' + + ", sex='" + sex + '\'' + + ", age=" + age + + ", marriage='" + marriage + '\'' + + ", title='" + title + '\'' + + ", speciality='" + speciality + '\'' + + ", introduction='" + introduction + '\'' + + ", medicalLicense='" + medicalLicense + '\'' + + ", qrCode='" + qrCode + '\'' + + ", hospitalId=" + hospitalId + + '}'; + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/req/PcTPatintQueryByPageReq.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/req/PcTPatintQueryByPageReq.java new file mode 100644 index 0000000..b1040f3 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/req/PcTPatintQueryByPageReq.java @@ -0,0 +1,87 @@ +package com.ruoyi.system.domain.req; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import java.util.Date; + +/** + * @Author zhuqing + * @Date 2022/8/4 + */ +@ApiModel(value = "PcTPatintQueryByPageReq", description = "PC端分页患者入参实体") +public class PcTPatintQueryByPageReq { + + @ApiModelProperty("医院id") + private Long hospitalId; + + @ApiModelProperty("医生id") + private Long doctorId; + /** + * startTime + */ + @ApiModelProperty("开始时间") + private Date startTime; + + /** + * endTime + */ + @ApiModelProperty("结束时间") + private Date endTime; + + /** 编号 */ + @ApiModelProperty("编号") + private String identifier; + + /** 名称 */ + @ApiModelProperty("名称") + private String name; + + 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; + } + + 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; + } + + public String getIdentifier() { + return identifier; + } + + public void setIdentifier(String identifier) { + this.identifier = identifier; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/resp/PcTDoctorQueryByPageResp.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/resp/PcTDoctorQueryByPageResp.java new file mode 100644 index 0000000..1d1f980 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/resp/PcTDoctorQueryByPageResp.java @@ -0,0 +1,245 @@ +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; + +/** + * @Author zhuqing + * @Date 2022/8/4 + */ +@ApiModel(value = "PcTDoctorQueryByPageResp", description = "医生分页查询反参实体") +public class PcTDoctorQueryByPageResp { + + /** ID */ + @ApiModelProperty("id") + private Long id; + + /** 用户ID */ + @ApiModelProperty("用户ID") + private Long userId; + + /** 编号 */ + @ApiModelProperty("编号") + private String identifier; + + /** 名称 */ + @ApiModelProperty("名称") + private String name; + + /** 电话 */ + @ApiModelProperty("电话") + private String phone; + + /** 用户性别(0男 1女 2未知) */ + @ApiModelProperty("用户性别(0男 1女 2未知) ") + private String sex; + + /** 年龄 */ + @ApiModelProperty("年龄") + private Integer age; + + /** 婚姻状态(0未婚 1已婚 2未知) */ + @ApiModelProperty("婚姻状态(0未婚 1已婚 2未知)") + private String marriage; + + /** 职称 */ + @ApiModelProperty("职称") + private String title; + + /** 专长 */ + @ApiModelProperty("专长") + private String speciality; + + /** 简介 */ + @ApiModelProperty("简介") + private String introduction; + + /** 职业医师照片路径 */ + @ApiModelProperty("职业医师照片路径base64") + private String medicalLicense; + + /** 二维码base64 */ + @ApiModelProperty("二维码base64") + private String qrCode; + + /** 医院 */ + @ApiModelProperty("医院id") + private Long hospitalId; + + + /** 创建时间 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty("创建时间") + private Date createTime; + + /** 更新时间 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty("更新时间") + private Date updateTime; + + @ApiModelProperty("患者个数") + private int countPatints; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getUserId() { + return userId; + } + + public void setUserId(Long userId) { + this.userId = userId; + } + + public String getIdentifier() { + return identifier; + } + + public void setIdentifier(String identifier) { + this.identifier = identifier; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getPhone() { + return phone; + } + + public void setPhone(String phone) { + this.phone = phone; + } + + 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 getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getSpeciality() { + return speciality; + } + + public void setSpeciality(String speciality) { + this.speciality = speciality; + } + + public String getIntroduction() { + return introduction; + } + + public void setIntroduction(String introduction) { + this.introduction = introduction; + } + + public String getMedicalLicense() { + return medicalLicense; + } + + public void setMedicalLicense(String medicalLicense) { + this.medicalLicense = medicalLicense; + } + + public String getQrCode() { + return qrCode; + } + + public void setQrCode(String qrCode) { + this.qrCode = qrCode; + } + + public Long getHospitalId() { + return hospitalId; + } + + public void setHospitalId(Long hospitalId) { + this.hospitalId = hospitalId; + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public Date getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(Date updateTime) { + this.updateTime = updateTime; + } + + public int getCountPatints() { + return countPatints; + } + + public void setCountPatints(int countPatints) { + this.countPatints = countPatints; + } + + @Override + public String toString() { + return "PcTDoctorQueryByPageResp{" + + "id=" + id + + ", userId=" + userId + + ", identifier='" + identifier + '\'' + + ", name='" + name + '\'' + + ", phone='" + phone + '\'' + + ", sex='" + sex + '\'' + + ", age=" + age + + ", marriage='" + marriage + '\'' + + ", title='" + title + '\'' + + ", speciality='" + speciality + '\'' + + ", introduction='" + introduction + '\'' + + ", medicalLicense='" + medicalLicense + '\'' + + ", qrCode='" + qrCode + '\'' + + ", hospitalId=" + hospitalId + + ", createTime=" + createTime + + ", updateTime=" + updateTime + + ", countPatints=" + countPatints + + '}'; + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/resp/PcTPatientQueryByPageResp.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/resp/PcTPatientQueryByPageResp.java new file mode 100644 index 0000000..5838bc9 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/resp/PcTPatientQueryByPageResp.java @@ -0,0 +1,205 @@ +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/4 + */ +@ApiModel(value = "PcTPatientQueryByPageResp", description = "患者分页查询反参实体") +public class PcTPatientQueryByPageResp { + + /** ID */ + @ApiModelProperty("id") + private Long id; + + /** 腾讯openid */ + @ApiModelProperty("腾讯openid") + private String openId; + + /** 编号 */ + @ApiModelProperty("编号") + private String identifier; + + /** 名称 */ + @ApiModelProperty("名称") + private String name; + + /** 电话 */ + @ApiModelProperty("电话") + private String phone; + + /** 用户性别(0男 1女 2未知) */ + @ApiModelProperty("用户性别(0男 1女 2未知)") + private String sex; + + /** 年龄 */ + @ApiModelProperty("年龄") + private Integer age; + + /** 身高 */ + @ApiModelProperty("身高") + private Integer height; + + /** 体重 */ + @ApiModelProperty("体重") + private Integer weight; + + /** 婚姻状态(0未婚 1已婚 2未知) */ + @ApiModelProperty("婚姻状态(0未婚 1已婚 2未知)") + private String marriage; + + /** 基础疾病 */ + @ApiModelProperty("基础疾病") + private String disease; + + /** 删除标志(0代表存在 2代表删除) */ + @ApiModelProperty("删除标志(0代表存在 2代表删除) ") + private String delFlag; + + /** 创建时间 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty("创建时间") + private Date createTime; + + /** 更新时间 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty("更新时间") + private Date updateTime; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getOpenId() { + return openId; + } + + public void setOpenId(String openId) { + this.openId = openId; + } + + public String getIdentifier() { + return identifier; + } + + public void setIdentifier(String identifier) { + this.identifier = identifier; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getPhone() { + return phone; + } + + public void setPhone(String phone) { + this.phone = phone; + } + + 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 Integer getHeight() { + return height; + } + + public void setHeight(Integer height) { + this.height = height; + } + + public Integer getWeight() { + return weight; + } + + public void setWeight(Integer weight) { + this.weight = weight; + } + + 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 String getDelFlag() { + return delFlag; + } + + public void setDelFlag(String delFlag) { + this.delFlag = delFlag; + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public Date getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(Date updateTime) { + this.updateTime = updateTime; + } + + @Override + public String toString() { + return "PcTPatientQueryByPageResp{" + + "id=" + id + + ", openId='" + openId + '\'' + + ", identifier='" + identifier + '\'' + + ", name='" + name + '\'' + + ", phone='" + phone + '\'' + + ", sex='" + sex + '\'' + + ", age=" + age + + ", height=" + height + + ", weight=" + weight + + ", marriage='" + marriage + '\'' + + ", disease='" + disease + '\'' + + ", delFlag='" + delFlag + '\'' + + ", createTime=" + createTime + + ", updateTime=" + updateTime + + '}'; + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TDoctorMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TDoctorMapper.java index 1154d14..46204ca 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TDoctorMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TDoctorMapper.java @@ -2,6 +2,9 @@ package com.ruoyi.system.mapper; import java.util.List; import com.ruoyi.system.domain.TDoctor; +import com.ruoyi.system.domain.req.PcTDoctorQueryByPageReq; +import com.ruoyi.system.domain.resp.PcTDoctorQueryByPageResp; +import org.apache.ibatis.annotations.Param; /** * 医生信息Mapper接口 @@ -58,4 +61,21 @@ public interface TDoctorMapper * @return 结果 */ public int deleteTDoctorByIds(Long[] ids); + + /** + * 分页查询 + * @param pcTDoctorQueryByPageReq + * @return + */ + List queryByPage(PcTDoctorQueryByPageReq pcTDoctorQueryByPageReq); + + /** + * 查询此医生下病人数量 + * @param hospitalId + * @param doctorId + * @return + */ + int queryPatintCountByDoctor(@Param("hospitalId")Long hospitalId, @Param("doctorId")Long doctorId); + + } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TPatientMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TPatientMapper.java index 22fa56f..8988b0d 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TPatientMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TPatientMapper.java @@ -2,6 +2,8 @@ package com.ruoyi.system.mapper; import java.util.List; import com.ruoyi.system.domain.TPatient; +import com.ruoyi.system.domain.req.PcTPatintQueryByPageReq; +import com.ruoyi.system.domain.resp.PcTPatientQueryByPageResp; import tk.mybatis.mapper.common.Mapper; /** @@ -61,4 +63,6 @@ public interface TPatientMapper public int deleteTPatientByIds(Long[] ids); public TPatient queryTPatient(TPatient tPatient); + + List queryByPage(PcTPatintQueryByPageReq pcTPatintQueryByPageReq); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ITDoctorService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ITDoctorService.java index e74a19f..055d95a 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/ITDoctorService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ITDoctorService.java @@ -2,6 +2,8 @@ package com.ruoyi.system.service; import java.util.List; import com.ruoyi.system.domain.TDoctor; +import com.ruoyi.system.domain.req.PcTDoctorQueryByPageReq; +import com.ruoyi.system.domain.resp.PcTDoctorQueryByPageResp; /** * 医生信息Service接口 @@ -58,4 +60,6 @@ public interface ITDoctorService * @return 结果 */ public int deleteTDoctorById(Long id); + + List queryByPage(PcTDoctorQueryByPageReq pcTDoctorQueryByPageReq); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ITPatientService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ITPatientService.java index 854ec35..9ef1d4c 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/ITPatientService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ITPatientService.java @@ -2,6 +2,8 @@ package com.ruoyi.system.service; import java.util.List; import com.ruoyi.system.domain.TPatient; +import com.ruoyi.system.domain.req.PcTPatintQueryByPageReq; +import com.ruoyi.system.domain.resp.PcTPatientQueryByPageResp; /** * 患者信息Service接口 @@ -58,4 +60,6 @@ public interface ITPatientService * @return 结果 */ public int deleteTPatientById(Long id); + + List queryByPage(PcTPatintQueryByPageReq pcTPatintQueryByPageReq); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TDoctorServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TDoctorServiceImpl.java index c9d8584..2959d9d 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TDoctorServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TDoctorServiceImpl.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.PcTDoctorQueryByPageReq; +import com.ruoyi.system.domain.resp.PcTDoctorQueryByPageResp; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.ruoyi.system.mapper.TDoctorMapper; @@ -93,4 +95,11 @@ public class TDoctorServiceImpl implements ITDoctorService { return tDoctorMapper.deleteTDoctorById(id); } + + @Override + public List queryByPage(PcTDoctorQueryByPageReq pcTDoctorQueryByPageReq) { + List pcTDoctorQueryByPageResps = tDoctorMapper.queryByPage(pcTDoctorQueryByPageReq); + pcTDoctorQueryByPageResps.stream().forEach(a -> a.setCountPatints(tDoctorMapper.queryPatintCountByDoctor(pcTDoctorQueryByPageReq.getHospitalId(),a.getId()))); + return pcTDoctorQueryByPageResps; + } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TPatientServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TPatientServiceImpl.java index d0f7455..f5483a9 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TPatientServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TPatientServiceImpl.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.PcTPatintQueryByPageReq; +import com.ruoyi.system.domain.resp.PcTPatientQueryByPageResp; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.ruoyi.system.mapper.TPatientMapper; @@ -93,4 +95,9 @@ public class TPatientServiceImpl implements ITPatientService { return tPatientMapper.deleteTPatientById(id); } + + @Override + public List queryByPage(PcTPatintQueryByPageReq pcTPatintQueryByPageReq) { + return tPatientMapper.queryByPage(pcTPatintQueryByPageReq); + } } diff --git a/ruoyi-system/src/main/resources/mapper/system/TDoctorMapper.xml b/ruoyi-system/src/main/resources/mapper/system/TDoctorMapper.xml index 03259e9..5af1c83 100644 --- a/ruoyi-system/src/main/resources/mapper/system/TDoctorMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/TDoctorMapper.xml @@ -121,7 +121,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - delete from t_doctor where id = #{id} + update t_doctor set del_flag = '2' where id = #{id} @@ -130,4 +130,43 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{id} + + + + \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/system/TPatientMapper.xml b/ruoyi-system/src/main/resources/mapper/system/TPatientMapper.xml index 598cf21..5b35117 100644 --- a/ruoyi-system/src/main/resources/mapper/system/TPatientMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/TPatientMapper.xml @@ -101,7 +101,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - delete from t_patient where id = #{id} + update t_patient set del_flag = '2' where id = #{id} @@ -119,4 +119,37 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + \ No newline at end of file