From 7f173b5fd7df540b848536c96885487d93a3dfef Mon Sep 17 00:00:00 2001 From: zhangcl Date: Thu, 4 Aug 2022 15:31:47 +0800 Subject: [PATCH] hospital --- .../com/ruoyi/system/domain/THospital.java | 38 +++++--- .../system/domain/TPatientHospitalDoctor.java | 79 ++++++++++++++++ .../mapper/TPatientHospitalDoctorMapper.java | 61 ++++++++++++ .../ITPatientHospitalDoctorService.java | 61 ++++++++++++ .../TPatientHospitalDoctorServiceImpl.java | 93 +++++++++++++++++++ .../mapper/system/THospitalMapper.xml | 25 +++-- .../system/TPatientHospitalDoctorMapper.xml | 66 +++++++++++++ 7 files changed, 401 insertions(+), 22 deletions(-) create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/domain/TPatientHospitalDoctor.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/mapper/TPatientHospitalDoctorMapper.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/service/ITPatientHospitalDoctorService.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TPatientHospitalDoctorServiceImpl.java create mode 100644 ruoyi-system/src/main/resources/mapper/system/TPatientHospitalDoctorMapper.xml 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 e59a11e..1cb1aaa 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 @@ -7,9 +7,9 @@ import com.ruoyi.common.core.domain.BaseEntity; /** * 医院信息对象 t_hospital - * + * * @author ruoyi - * @date 2022-08-03 + * @date 2022-08-04 */ public class THospital extends BaseEntity { @@ -26,40 +26,54 @@ public class THospital extends BaseEntity @Excel(name = "排序") private Long num; - public void setId(Long id) + /** 管理员ID */ + @Excel(name = "管理员ID") + private Long adminId; + + public void setId(Long id) { this.id = id; } - public Long getId() + public Long getId() { return id; } - public void setName(String name) + public void setName(String name) { this.name = name; } - public String getName() + public String getName() { return name; } - public void setNum(Long num) + public void setNum(Long num) { this.num = num; } - public Long getNum() + public Long getNum() { return num; } + public void setAdminId(Long adminId) + { + this.adminId = adminId; + } + + public Long getAdminId() + { + return adminId; + } @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("id", getId()) - .append("name", getName()) - .append("num", getNum()) - .toString(); + .append("id", getId()) + .append("name", getName()) + .append("num", getNum()) + .append("adminId", getAdminId()) + .toString(); } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/TPatientHospitalDoctor.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/TPatientHospitalDoctor.java new file mode 100644 index 0000000..8867068 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/TPatientHospitalDoctor.java @@ -0,0 +1,79 @@ +package com.ruoyi.system.domain; + +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; + +/** + * 【请填写功能名称】对象 t_patient_hospital_doctor + * + * @author ruoyi + * @date 2022-08-04 + */ +public class TPatientHospitalDoctor extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** $column.columnComment */ + private Long id; + + /** 患者ID */ + @Excel(name = "患者ID") + private Long patientId; + + /** 医院ID */ + @Excel(name = "医院ID") + private Long hospitalId; + + /** 医生ID */ + @Excel(name = "医生ID") + private Long doctorId; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setPatientId(Long patientId) + { + this.patientId = patientId; + } + + public Long getPatientId() + { + return patientId; + } + public void setHospitalId(Long hospitalId) + { + this.hospitalId = hospitalId; + } + + public Long getHospitalId() + { + return hospitalId; + } + public void setDoctorId(Long doctorId) + { + this.doctorId = doctorId; + } + + public Long getDoctorId() + { + return doctorId; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("patientId", getPatientId()) + .append("hospitalId", getHospitalId()) + .append("doctorId", getDoctorId()) + .toString(); + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TPatientHospitalDoctorMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TPatientHospitalDoctorMapper.java new file mode 100644 index 0000000..1cfeeba --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TPatientHospitalDoctorMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.system.mapper; + +import java.util.List; +import com.ruoyi.system.domain.TPatientHospitalDoctor; + +/** + * 【请填写功能名称】Mapper接口 + * + * @author ruoyi + * @date 2022-08-04 + */ +public interface TPatientHospitalDoctorMapper +{ + /** + * 查询【请填写功能名称】 + * + * @param id 【请填写功能名称】主键 + * @return 【请填写功能名称】 + */ + public TPatientHospitalDoctor selectTPatientHospitalDoctorById(Long id); + + /** + * 查询【请填写功能名称】列表 + * + * @param tPatientHospitalDoctor 【请填写功能名称】 + * @return 【请填写功能名称】集合 + */ + public List selectTPatientHospitalDoctorList(TPatientHospitalDoctor tPatientHospitalDoctor); + + /** + * 新增【请填写功能名称】 + * + * @param tPatientHospitalDoctor 【请填写功能名称】 + * @return 结果 + */ + public int insertTPatientHospitalDoctor(TPatientHospitalDoctor tPatientHospitalDoctor); + + /** + * 修改【请填写功能名称】 + * + * @param tPatientHospitalDoctor 【请填写功能名称】 + * @return 结果 + */ + public int updateTPatientHospitalDoctor(TPatientHospitalDoctor tPatientHospitalDoctor); + + /** + * 删除【请填写功能名称】 + * + * @param id 【请填写功能名称】主键 + * @return 结果 + */ + public int deleteTPatientHospitalDoctorById(Long id); + + /** + * 批量删除【请填写功能名称】 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteTPatientHospitalDoctorByIds(Long[] ids); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ITPatientHospitalDoctorService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ITPatientHospitalDoctorService.java new file mode 100644 index 0000000..5322b31 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ITPatientHospitalDoctorService.java @@ -0,0 +1,61 @@ +package com.ruoyi.system.service; + +import java.util.List; +import com.ruoyi.system.domain.TPatientHospitalDoctor; + +/** + * 【请填写功能名称】Service接口 + * + * @author ruoyi + * @date 2022-08-04 + */ +public interface ITPatientHospitalDoctorService +{ + /** + * 查询【请填写功能名称】 + * + * @param id 【请填写功能名称】主键 + * @return 【请填写功能名称】 + */ + public TPatientHospitalDoctor selectTPatientHospitalDoctorById(Long id); + + /** + * 查询【请填写功能名称】列表 + * + * @param tPatientHospitalDoctor 【请填写功能名称】 + * @return 【请填写功能名称】集合 + */ + public List selectTPatientHospitalDoctorList(TPatientHospitalDoctor tPatientHospitalDoctor); + + /** + * 新增【请填写功能名称】 + * + * @param tPatientHospitalDoctor 【请填写功能名称】 + * @return 结果 + */ + public int insertTPatientHospitalDoctor(TPatientHospitalDoctor tPatientHospitalDoctor); + + /** + * 修改【请填写功能名称】 + * + * @param tPatientHospitalDoctor 【请填写功能名称】 + * @return 结果 + */ + public int updateTPatientHospitalDoctor(TPatientHospitalDoctor tPatientHospitalDoctor); + + /** + * 批量删除【请填写功能名称】 + * + * @param ids 需要删除的【请填写功能名称】主键集合 + * @return 结果 + */ + public int deleteTPatientHospitalDoctorByIds(Long[] ids); + + /** + * 删除【请填写功能名称】信息 + * + * @param id 【请填写功能名称】主键 + * @return 结果 + */ + public int deleteTPatientHospitalDoctorById(Long id); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TPatientHospitalDoctorServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TPatientHospitalDoctorServiceImpl.java new file mode 100644 index 0000000..8a75445 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TPatientHospitalDoctorServiceImpl.java @@ -0,0 +1,93 @@ +package com.ruoyi.system.service.impl; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.system.mapper.TPatientHospitalDoctorMapper; +import com.ruoyi.system.domain.TPatientHospitalDoctor; +import com.ruoyi.system.service.ITPatientHospitalDoctorService; + +/** + * 【请填写功能名称】Service业务层处理 + * + * @author ruoyi + * @date 2022-08-04 + */ +@Service +public class TPatientHospitalDoctorServiceImpl implements ITPatientHospitalDoctorService +{ + @Autowired + private TPatientHospitalDoctorMapper tPatientHospitalDoctorMapper; + + /** + * 查询【请填写功能名称】 + * + * @param id 【请填写功能名称】主键 + * @return 【请填写功能名称】 + */ + @Override + public TPatientHospitalDoctor selectTPatientHospitalDoctorById(Long id) + { + return tPatientHospitalDoctorMapper.selectTPatientHospitalDoctorById(id); + } + + /** + * 查询【请填写功能名称】列表 + * + * @param tPatientHospitalDoctor 【请填写功能名称】 + * @return 【请填写功能名称】 + */ + @Override + public List selectTPatientHospitalDoctorList(TPatientHospitalDoctor tPatientHospitalDoctor) + { + return tPatientHospitalDoctorMapper.selectTPatientHospitalDoctorList(tPatientHospitalDoctor); + } + + /** + * 新增【请填写功能名称】 + * + * @param tPatientHospitalDoctor 【请填写功能名称】 + * @return 结果 + */ + @Override + public int insertTPatientHospitalDoctor(TPatientHospitalDoctor tPatientHospitalDoctor) + { + return tPatientHospitalDoctorMapper.insertTPatientHospitalDoctor(tPatientHospitalDoctor); + } + + /** + * 修改【请填写功能名称】 + * + * @param tPatientHospitalDoctor 【请填写功能名称】 + * @return 结果 + */ + @Override + public int updateTPatientHospitalDoctor(TPatientHospitalDoctor tPatientHospitalDoctor) + { + return tPatientHospitalDoctorMapper.updateTPatientHospitalDoctor(tPatientHospitalDoctor); + } + + /** + * 批量删除【请填写功能名称】 + * + * @param ids 需要删除的【请填写功能名称】主键 + * @return 结果 + */ + @Override + public int deleteTPatientHospitalDoctorByIds(Long[] ids) + { + return tPatientHospitalDoctorMapper.deleteTPatientHospitalDoctorByIds(ids); + } + + /** + * 删除【请填写功能名称】信息 + * + * @param id 【请填写功能名称】主键 + * @return 结果 + */ + @Override + public int deleteTPatientHospitalDoctorById(Long id) + { + return tPatientHospitalDoctorMapper.deleteTPatientHospitalDoctorById(id); + } +} diff --git a/ruoyi-system/src/main/resources/mapper/system/THospitalMapper.xml b/ruoyi-system/src/main/resources/mapper/system/THospitalMapper.xml index 6b6a22c..19e5709 100644 --- a/ruoyi-system/src/main/resources/mapper/system/THospitalMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/THospitalMapper.xml @@ -1,42 +1,46 @@ + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + + - select id, name, num from t_hospital + select id, name, num, admin_id from t_hospital - + - + insert into t_hospital name, num, - + admin_id, + #{name}, #{num}, - + #{adminId}, + @@ -44,6 +48,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" name = #{name}, num = #{num}, + admin_id = #{adminId}, where id = #{id} @@ -53,7 +58,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - delete from t_hospital where id in + delete from t_hospital where id in #{id} diff --git a/ruoyi-system/src/main/resources/mapper/system/TPatientHospitalDoctorMapper.xml b/ruoyi-system/src/main/resources/mapper/system/TPatientHospitalDoctorMapper.xml new file mode 100644 index 0000000..6f35058 --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/system/TPatientHospitalDoctorMapper.xml @@ -0,0 +1,66 @@ + + + + + + + + + + + + + select id, patient_id, hospital_id, doctor_id from t_patient_hospital_doctor + + + + + + + + insert into t_patient_hospital_doctor + + patient_id, + hospital_id, + doctor_id, + + + #{patientId}, + #{hospitalId}, + #{doctorId}, + + + + + update t_patient_hospital_doctor + + patient_id = #{patientId}, + hospital_id = #{hospitalId}, + doctor_id = #{doctorId}, + + where id = #{id} + + + + delete from t_patient_hospital_doctor where id = #{id} + + + + delete from t_patient_hospital_doctor where id in + + #{id} + + + \ No newline at end of file