TDoctor + patient

master
zhuqing 2 years ago
parent 1b5b46a7e0
commit 25b547b695

@ -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<TDoctor> list = tDoctorService.selectTDoctorList(tDoctor);
List<PcTDoctorQueryByPageResp> 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));
}
}

@ -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<TPatient> list = tPatientService.selectTPatientList(tPatient);
List<PcTPatientQueryByPageResp> 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));
}
}

@ -34,6 +34,12 @@
<artifactId>mysql-connector-java</artifactId>
<version>5.1.44</version>
</dependency>
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-models</artifactId>
<version>1.6.2</version>
</dependency>
</dependencies>
<build>

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

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

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

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

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

@ -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<PcTDoctorQueryByPageResp> queryByPage(PcTDoctorQueryByPageReq pcTDoctorQueryByPageReq);
/**
*
* @param hospitalId
* @param doctorId
* @return
*/
int queryPatintCountByDoctor(@Param("hospitalId")Long hospitalId, @Param("doctorId")Long doctorId);
}

@ -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<PcTPatientQueryByPageResp> queryByPage(PcTPatintQueryByPageReq pcTPatintQueryByPageReq);
}

@ -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<PcTDoctorQueryByPageResp> queryByPage(PcTDoctorQueryByPageReq pcTDoctorQueryByPageReq);
}

@ -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<PcTPatientQueryByPageResp> queryByPage(PcTPatintQueryByPageReq pcTPatintQueryByPageReq);
}

@ -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<PcTDoctorQueryByPageResp> queryByPage(PcTDoctorQueryByPageReq pcTDoctorQueryByPageReq) {
List<PcTDoctorQueryByPageResp> pcTDoctorQueryByPageResps = tDoctorMapper.queryByPage(pcTDoctorQueryByPageReq);
pcTDoctorQueryByPageResps.stream().forEach(a -> a.setCountPatints(tDoctorMapper.queryPatintCountByDoctor(pcTDoctorQueryByPageReq.getHospitalId(),a.getId())));
return pcTDoctorQueryByPageResps;
}
}

@ -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<PcTPatientQueryByPageResp> queryByPage(PcTPatintQueryByPageReq pcTPatintQueryByPageReq) {
return tPatientMapper.queryByPage(pcTPatintQueryByPageReq);
}
}

@ -121,7 +121,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</update>
<delete id="deleteTDoctorById" parameterType="Long">
delete from t_doctor where id = #{id}
update t_doctor set del_flag = '2' where id = #{id}
</delete>
<delete id="deleteTDoctorByIds" parameterType="String">
@ -130,4 +130,43 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{id}
</foreach>
</delete>
<select id="queryByPage" resultType="com.ruoyi.system.domain.resp.PcTDoctorQueryByPageResp">
select
id,
user_id as userId,
identifier,
name,
phone,
sex,
age,
marriage,
title,
speciality,
introduction,
medical_license as medicalLicense,
qr_code as qrCode,
hospital_id as hospitalId,
create_time as createTime,
update_time as updateTime
from
t_doctor
<where>
del_flag = '0' and hospital_id = #{hospitalId}
<if test="startTime != null and endTime != null">
AND create_time between DATE_FORMAT(#{startTime},'%Y-%m-%d %H:%i:%s') and DATE_FORMAT(#{endTime},'%Y-%m-%d %H:%i:%s')
</if>
<if test="name != null and name != ''">
AND name like concat('%', #{name}, '%')
</if>
<if test="identifier != null and identifier != ''">
AND identifier like concat('%', #{identifier}, '%')
</if>
</where>
order by create_time desc
</select>
<select id="queryPatintCountByDoctor" resultType="int">
select COUNT(*) from t_patient_hospital_doctor where hospital_id = #{hospitalId} and doctor_id = #{doctorId}
</select>
</mapper>

@ -101,7 +101,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</update>
<delete id="deleteTPatientById" parameterType="Long">
delete from t_patient where id = #{id}
update t_patient set del_flag = '2' where id = #{id}
</delete>
<delete id="deleteTPatientByIds" parameterType="String">
@ -119,4 +119,37 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</if>
</where>
</select>
<select id="queryByPage" resultType="com.ruoyi.system.domain.resp.PcTPatientQueryByPageResp">
select
a.id,
a.identifier,
a.name,
a.phone,
a.sex,
a.age,
a.height,
a.weight,
a.marriage,
a.disease,
a.create_time as createTime,
a.update_time as updateTime
from t_patient a left join t_patient_hospital_doctor b on a.id = b.patient_id
<where>
a.del_flag = '0'
<if test="startTime != null and endTime != null">
AND a.create_time between DATE_FORMAT(#{startTime},'%Y-%m-%d %H:%i:%s') and DATE_FORMAT(#{endTime},'%Y-%m-%d %H:%i:%s')
</if>
<if test="identifier != null and identifier != ''"> and a.identifier like concat('%', #{identifier}, '%')</if>
<if test="name != null and name != ''"> and a.name like concat('%', #{name}, '%')</if>
<if test="hospitalId != null">
and b.hospital_id = #{hospitalId}
</if>
<if test="doctorId != null">
and b.doctor_d = #{doctorId}
</if>
</where>
order by a.create_time desc
</select>
</mapper>
Loading…
Cancel
Save