master
zhangcl 2 years ago
parent 17d555ad6d
commit 7f173b5fd7

@ -7,9 +7,9 @@ import com.ruoyi.common.core.domain.BaseEntity;
/** /**
* t_hospital * t_hospital
* *
* @author ruoyi * @author ruoyi
* @date 2022-08-03 * @date 2022-08-04
*/ */
public class THospital extends BaseEntity public class THospital extends BaseEntity
{ {
@ -26,40 +26,54 @@ public class THospital extends BaseEntity
@Excel(name = "排序") @Excel(name = "排序")
private Long num; private Long num;
public void setId(Long id) /** 管理员ID */
@Excel(name = "管理员ID")
private Long adminId;
public void setId(Long id)
{ {
this.id = id; this.id = id;
} }
public Long getId() public Long getId()
{ {
return id; return id;
} }
public void setName(String name) public void setName(String name)
{ {
this.name = name; this.name = name;
} }
public String getName() public String getName()
{ {
return name; return name;
} }
public void setNum(Long num) public void setNum(Long num)
{ {
this.num = num; this.num = num;
} }
public Long getNum() public Long getNum()
{ {
return num; return num;
} }
public void setAdminId(Long adminId)
{
this.adminId = adminId;
}
public Long getAdminId()
{
return adminId;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId()) .append("id", getId())
.append("name", getName()) .append("name", getName())
.append("num", getNum()) .append("num", getNum())
.toString(); .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,42 +1,46 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.system.mapper.THospitalMapper"> <mapper namespace="com.ruoyi.system.mapper.THospitalMapper">
<resultMap type="THospital" id="THospitalResult"> <resultMap type="THospital" id="THospitalResult">
<result property="id" column="id" /> <result property="id" column="id" />
<result property="name" column="name" /> <result property="name" column="name" />
<result property="num" column="num" /> <result property="num" column="num" />
<result property="adminId" column="admin_id" />
</resultMap> </resultMap>
<sql id="selectTHospitalVo"> <sql id="selectTHospitalVo">
select id, name, num from t_hospital select id, name, num, admin_id from t_hospital
</sql> </sql>
<select id="selectTHospitalList" parameterType="THospital" resultMap="THospitalResult"> <select id="selectTHospitalList" parameterType="THospital" resultMap="THospitalResult">
<include refid="selectTHospitalVo"/> <include refid="selectTHospitalVo"/>
<where> <where>
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if> <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
<if test="num != null "> and num = #{num}</if> <if test="num != null "> and num = #{num}</if>
<if test="adminId != null "> and admin_id = #{adminId}</if>
</where> </where>
</select> </select>
<select id="selectTHospitalById" parameterType="Long" resultMap="THospitalResult"> <select id="selectTHospitalById" parameterType="Long" resultMap="THospitalResult">
<include refid="selectTHospitalVo"/> <include refid="selectTHospitalVo"/>
where id = #{id} where id = #{id}
</select> </select>
<insert id="insertTHospital" parameterType="THospital" useGeneratedKeys="true" keyProperty="id"> <insert id="insertTHospital" parameterType="THospital" useGeneratedKeys="true" keyProperty="id">
insert into t_hospital insert into t_hospital
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="name != null and name != ''">name,</if> <if test="name != null and name != ''">name,</if>
<if test="num != null">num,</if> <if test="num != null">num,</if>
</trim> <if test="adminId != null">admin_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="name != null and name != ''">#{name},</if> <if test="name != null and name != ''">#{name},</if>
<if test="num != null">#{num},</if> <if test="num != null">#{num},</if>
</trim> <if test="adminId != null">#{adminId},</if>
</trim>
</insert> </insert>
<update id="updateTHospital" parameterType="THospital"> <update id="updateTHospital" parameterType="THospital">
@ -44,6 +48,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<trim prefix="SET" suffixOverrides=","> <trim prefix="SET" suffixOverrides=",">
<if test="name != null and name != ''">name = #{name},</if> <if test="name != null and name != ''">name = #{name},</if>
<if test="num != null">num = #{num},</if> <if test="num != null">num = #{num},</if>
<if test="adminId != null">admin_id = #{adminId},</if>
</trim> </trim>
where id = #{id} where id = #{id}
</update> </update>
@ -53,7 +58,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete> </delete>
<delete id="deleteTHospitalByIds" parameterType="String"> <delete id="deleteTHospitalByIds" parameterType="String">
delete from t_hospital where id in delete from t_hospital where id in
<foreach item="id" collection="array" open="(" separator="," close=")"> <foreach item="id" collection="array" open="(" separator="," close=")">
#{id} #{id}
</foreach> </foreach>

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