master
zhangcl 2 years ago
parent 17d555ad6d
commit 7f173b5fd7

@ -9,7 +9,7 @@ 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,6 +26,10 @@ public class THospital extends BaseEntity
@Excel(name = "排序")
private Long num;
/** 管理员ID */
@Excel(name = "管理员ID")
private Long adminId;
public void setId(Long id)
{
this.id = id;
@ -53,6 +57,15 @@ public class THospital extends BaseEntity
{
return num;
}
public void setAdminId(Long adminId)
{
this.adminId = adminId;
}
public Long getAdminId()
{
return adminId;
}
@Override
public String toString() {
@ -60,6 +73,7 @@ public class THospital extends BaseEntity
.append("id", getId())
.append("name", getName())
.append("num", getNum())
.append("adminId", getAdminId())
.toString();
}
}

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

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

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

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

@ -1,17 +1,18 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.system.mapper.THospitalMapper">
<resultMap type="THospital" id="THospitalResult">
<result property="id" column="id" />
<result property="name" column="name" />
<result property="num" column="num" />
<result property="adminId" column="admin_id" />
</resultMap>
<sql id="selectTHospitalVo">
select id, name, num from t_hospital
select id, name, num, admin_id from t_hospital
</sql>
<select id="selectTHospitalList" parameterType="THospital" resultMap="THospitalResult">
@ -19,6 +20,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<where>
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
<if test="num != null "> and num = #{num}</if>
<if test="adminId != null "> and admin_id = #{adminId}</if>
</where>
</select>
@ -32,10 +34,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="name != null and name != ''">name,</if>
<if test="num != null">num,</if>
<if test="adminId != null">admin_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="name != null and name != ''">#{name},</if>
<if test="num != null">#{num},</if>
<if test="adminId != null">#{adminId},</if>
</trim>
</insert>
@ -44,6 +48,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<trim prefix="SET" suffixOverrides=",">
<if test="name != null and name != ''">name = #{name},</if>
<if test="num != null">num = #{num},</if>
<if test="adminId != null">admin_id = #{adminId},</if>
</trim>
where id = #{id}
</update>

@ -0,0 +1,66 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.system.mapper.TPatientHospitalDoctorMapper">
<resultMap type="TPatientHospitalDoctor" id="TPatientHospitalDoctorResult">
<result property="id" column="id" />
<result property="patientId" column="patient_id" />
<result property="hospitalId" column="hospital_id" />
<result property="doctorId" column="doctor_id" />
</resultMap>
<sql id="selectTPatientHospitalDoctorVo">
select id, patient_id, hospital_id, doctor_id from t_patient_hospital_doctor
</sql>
<select id="selectTPatientHospitalDoctorList" parameterType="TPatientHospitalDoctor" resultMap="TPatientHospitalDoctorResult">
<include refid="selectTPatientHospitalDoctorVo"/>
<where>
<if test="patientId != null "> and patient_id = #{patientId}</if>
<if test="hospitalId != null "> and hospital_id = #{hospitalId}</if>
<if test="doctorId != null "> and doctor_id = #{doctorId}</if>
</where>
</select>
<select id="selectTPatientHospitalDoctorById" parameterType="Long" resultMap="TPatientHospitalDoctorResult">
<include refid="selectTPatientHospitalDoctorVo"/>
where id = #{id}
</select>
<insert id="insertTPatientHospitalDoctor" parameterType="TPatientHospitalDoctor" useGeneratedKeys="true" keyProperty="id">
insert into t_patient_hospital_doctor
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="patientId != null">patient_id,</if>
<if test="hospitalId != null">hospital_id,</if>
<if test="doctorId != null">doctor_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="patientId != null">#{patientId},</if>
<if test="hospitalId != null">#{hospitalId},</if>
<if test="doctorId != null">#{doctorId},</if>
</trim>
</insert>
<update id="updateTPatientHospitalDoctor" parameterType="TPatientHospitalDoctor">
update t_patient_hospital_doctor
<trim prefix="SET" suffixOverrides=",">
<if test="patientId != null">patient_id = #{patientId},</if>
<if test="hospitalId != null">hospital_id = #{hospitalId},</if>
<if test="doctorId != null">doctor_id = #{doctorId},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteTPatientHospitalDoctorById" parameterType="Long">
delete from t_patient_hospital_doctor where id = #{id}
</delete>
<delete id="deleteTPatientHospitalDoctorByIds" parameterType="String">
delete from t_patient_hospital_doctor where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
Loading…
Cancel
Save