格式化代码

This commit is contained in:
纪寒 2024-04-01 10:26:15 +08:00
parent 1a99ff2754
commit 6560540c4a
4 changed files with 628 additions and 543 deletions

View File

@ -194,25 +194,25 @@ public class Constants {
*/ */
public static final String TASK_STATUS_CODE = "TSC"; public static final String TASK_STATUS_CODE = "TSC";
/** /**
* 门诊患者 * 门诊患者
*/ */
public static final String OUTPATIENT = "outpatient"; public static final String OUTPATIENT = "outpatient";
/** /**
* 预住院 * 预住院
*/ */
public static final String PRE_HOSPITALIZED = "prehospitalized"; public static final String PRE_HOSPITALIZED = "prehospitalized";
/** /**
* 在院 * 在院
*/ */
public static final String IN_HOSPITAL = "inhospital"; public static final String IN_HOSPITAL = "inhospital";
/** /**
* 出院 * 出院
*/ */
public static final String DISCHARGED = "discharged"; public static final String DISCHARGED = "discharged";
/** /**
* 字段信息编码前缀 * 字段信息编码前缀

View File

@ -5,13 +5,14 @@ import com.xinelu.common.annotation.Excel;
import com.xinelu.common.core.domain.BaseEntity; import com.xinelu.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import java.time.LocalDate;
import java.time.LocalDateTime;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import java.time.LocalDate;
import java.time.LocalDateTime;
/** /**
* 患者信息对象 patient_info * 患者信息对象 patient_info
* *
@ -25,187 +26,261 @@ import lombok.NoArgsConstructor;
@ApiModel(value = "患者信息对象", description = "patient_info") @ApiModel(value = "患者信息对象", description = "patient_info")
public class PatientInfo extends BaseEntity { public class PatientInfo extends BaseEntity {
private static final long serialVersionUID=1L; private static final long serialVersionUID = 1L;
/** 主键id */ /**
* 主键id
*/
private Long id; private Long id;
/** 居民信息表id */ /**
@ApiModelProperty(value = "居民信息表id") * 居民信息表id
private Long residentId; */
@ApiModelProperty(value = "居民信息表id")
private Long residentId;
/** 患者姓名 */ /**
* 患者姓名
*/
@ApiModelProperty(value = "患者姓名") @ApiModelProperty(value = "患者姓名")
@Excel(name = "患者姓名") @Excel(name = "患者姓名")
private String patientName; private String patientName;
/** 患者电话 */ /**
* 患者电话
*/
@ApiModelProperty(value = "患者电话") @ApiModelProperty(value = "患者电话")
@Excel(name = "患者电话") @Excel(name = "患者电话")
private String patientPhone; private String patientPhone;
/** 家属电话 */ /**
* 家属电话
*/
@ApiModelProperty(value = "家属电话") @ApiModelProperty(value = "家属电话")
private String familyMemberPhone; private String familyMemberPhone;
/** 出生日期格式yyyy-MM-dd */ /**
* 出生日期格式yyyy-MM-dd
*/
@ApiModelProperty(value = "出生日期格式yyyy-MM-dd") @ApiModelProperty(value = "出生日期格式yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd")
private LocalDate birthDate; private LocalDate birthDate;
/** 身份证号 */ /**
* 身份证号
*/
@ApiModelProperty(value = "身份证号") @ApiModelProperty(value = "身份证号")
private String cardNo; private String cardNo;
/** 性别MALEFEMALE */ /**
* 性别MALEFEMALE
*/
@ApiModelProperty(value = "性别MALEFEMALE") @ApiModelProperty(value = "性别MALEFEMALE")
@Excel(name = "性别MALEFEMALE") @Excel(name = "性别MALEFEMALE")
private String sex; private String sex;
/** 住址 */ /**
* 住址
*/
@ApiModelProperty(value = "住址") @ApiModelProperty(value = "住址")
@Excel(name = "住址") @Excel(name = "住址")
private String address; private String address;
/** 患者类型预住院患者PRE_HOSPITALIZED_PATIENT在院患者IN_HOSPITAL_PATIENT门诊患者OUTPATIENT出院患者DISCHARGED_PATIENT /**
签约患者CONTRACTED_PATIENT */ * 患者类型预住院患者PRE_HOSPITALIZED_PATIENT在院患者IN_HOSPITAL_PATIENT门诊患者OUTPATIENT出院患者DISCHARGED_PATIENT
* 签约患者CONTRACTED_PATIENT
*/
@ApiModelProperty(value = "患者类型预住院患者PRE_HOSPITALIZED_PATIENT在院患者IN_HOSPITAL_PATIENT门诊患者OUTPATIENT出院患者DISCHARGED_PATIENT签约患者CONTRACTED_PATIENT") @ApiModelProperty(value = "患者类型预住院患者PRE_HOSPITALIZED_PATIENT在院患者IN_HOSPITAL_PATIENT门诊患者OUTPATIENT出院患者DISCHARGED_PATIENT签约患者CONTRACTED_PATIENT")
private String patientType; private String patientType;
/** /**
* 签约状态未签约UN_SIGN,在签IN_SIGN,解约SEPARATE_SIGN, 服务到期EXPIRE_SIGN * 签约状态未签约UN_SIGN,在签IN_SIGN,解约SEPARATE_SIGN, 服务到期EXPIRE_SIGN
*/ */
@ApiModelProperty(value = "签约状态未签约UN_SIGN,在签IN_SIGN,解约SEPARATE_SIGN, 过期EXPIRE_SIGN") @ApiModelProperty(value = "签约状态未签约UN_SIGN,在签IN_SIGN,解约SEPARATE_SIGN, 过期EXPIRE_SIGN")
private String signStatus; private String signStatus;
@ApiModelProperty(value = "签约记录表id") @ApiModelProperty(value = "签约记录表id")
private Long signPatientRecordId; private Long signPatientRecordId;
/** /**
* 服务状态意向签约INTENTIONAL_SIGNING服务中SERVICE_CENTER服务结束SERVICE_END * 服务状态意向签约INTENTIONAL_SIGNING服务中SERVICE_CENTER服务结束SERVICE_END
*/ */
@ApiModelProperty(value = "服务状态意向签约INTENTIONAL_SIGNING服务中SERVICE_CENTER服务结束SERVICE_END") @ApiModelProperty(value = "服务状态意向签约INTENTIONAL_SIGNING服务中SERVICE_CENTER服务结束SERVICE_END")
private String serviceStatus; private String serviceStatus;
/** 签约时间格式yyyy-MM-dd HH:mm:ss */ /**
* 签约时间格式yyyy-MM-dd HH:mm:ss
*/
@ApiModelProperty(value = "签约时间格式yyyy-MM-dd HH:mm:ss") @ApiModelProperty(value = "签约时间格式yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "签约时间格式yyyy-MM-dd HH:mm:ss", width = 30, dateFormat = "yyyy-MM-dd") @Excel(name = "签约时间格式yyyy-MM-dd HH:mm:ss", width = 30, dateFormat = "yyyy-MM-dd")
private LocalDateTime signTime; private LocalDateTime signTime;
/** 就诊方式门诊OUTPATIENT_SERVICE住院BE_IN_HOSPITAL */ /**
* 就诊方式门诊OUTPATIENT_SERVICE住院BE_IN_HOSPITAL
*/
@ApiModelProperty(value = "就诊方式门诊OUTPATIENT_SERVICE住院BE_IN_HOSPITAL") @ApiModelProperty(value = "就诊方式门诊OUTPATIENT_SERVICE住院BE_IN_HOSPITAL")
@Excel(name = "就诊方式门诊OUTPATIENT_SERVICE住院BE_IN_HOSPITAL") @Excel(name = "就诊方式门诊OUTPATIENT_SERVICE住院BE_IN_HOSPITAL")
private String visitMethod; private String visitMethod;
/** 主治医生id */ /**
@ApiModelProperty(value = "主治医生id") * 主治医生id
@Excel(name = "主治医生id") */
private Long attendingPhysicianId; @ApiModelProperty(value = "主治医生id")
@Excel(name = "主治医生id")
private Long attendingPhysicianId;
/** 主治医生姓名 */ /**
@ApiModelProperty(value = "主治医生姓名") * 主治医生姓名
@Excel(name = "主治医生姓名") */
private String attendingPhysicianName; @ApiModelProperty(value = "主治医生姓名")
@Excel(name = "主治医生姓名")
private String attendingPhysicianName;
/** 主要诊断 */ /**
* 主要诊断
*/
@ApiModelProperty(value = "主要诊断") @ApiModelProperty(value = "主要诊断")
private String mainDiagnosis; private String mainDiagnosis;
/** 所属医院id */ /**
* 所属医院id
*/
@ApiModelProperty(value = "所属医院id") @ApiModelProperty(value = "所属医院id")
private Long hospitalAgencyId; private Long hospitalAgencyId;
/** 所属医院名称 */ /**
* 所属医院名称
*/
@ApiModelProperty(value = "所属医院名称") @ApiModelProperty(value = "所属医院名称")
@Excel(name = "所属医院名称") @Excel(name = "所属医院名称")
private String hospitalAgencyName; private String hospitalAgencyName;
/** 所属院区id */ /**
* 所属院区id
*/
@ApiModelProperty(value = "所属院区id") @ApiModelProperty(value = "所属院区id")
private Long campusAgencyId; private Long campusAgencyId;
/** 所属院区名称 */ /**
* 所属院区名称
*/
@ApiModelProperty(value = "所属院区名称") @ApiModelProperty(value = "所属院区名称")
@Excel(name = "所属院区名称") @Excel(name = "所属院区名称")
private String campusAgencyName; private String campusAgencyName;
/** 所属科室id */ /**
* 所属科室id
*/
@ApiModelProperty(value = "所属科室id") @ApiModelProperty(value = "所属科室id")
private Long departmentId; private Long departmentId;
/** 所属科室名称 */ /**
* 所属科室名称
*/
@ApiModelProperty(value = "所属科室名称") @ApiModelProperty(value = "所属科室名称")
@Excel(name = "所属科室名称") @Excel(name = "所属科室名称")
private String departmentName; private String departmentName;
/** 所属病区id */ /**
* 所属病区id
*/
@ApiModelProperty(value = "所属病区id") @ApiModelProperty(value = "所属病区id")
private Long wardId; private Long wardId;
/** 所属病区名称 */ /**
* 所属病区名称
*/
@ApiModelProperty(value = "所属病区名称") @ApiModelProperty(value = "所属病区名称")
@Excel(name = "所属病区名称") @Excel(name = "所属病区名称")
private String wardName; private String wardName;
/** 责任护士 */ /**
* 责任护士
*/
@ApiModelProperty(value = "责任护士") @ApiModelProperty(value = "责任护士")
private String responsibleNurse; private String responsibleNurse;
/** 最新一条就诊记录id */ /**
@ApiModelProperty(value = "最新一条就诊记录id") * 最新一条就诊记录id
private Long patientVisitRecordId; */
@ApiModelProperty(value = "最新一条就诊记录id")
private Long patientVisitRecordId;
/** 就诊流水号 */ /**
* 就诊流水号
*/
@ApiModelProperty(value = "就诊流水号") @ApiModelProperty(value = "就诊流水号")
private String visitSerialNumber; private String visitSerialNumber;
/** 入院时间时间格式yyyy-MM-dd */ /**
* 入院时间时间格式yyyy-MM-dd
*/
@ApiModelProperty(value = "入院时间") @ApiModelProperty(value = "入院时间")
private LocalDateTime admissionTime; private LocalDateTime admissionTime;
/** 出院时间出院患者时间格式yyyy-MM-dd */ /**
* 出院时间出院患者时间格式yyyy-MM-dd
*/
@ApiModelProperty(value = "出院时间(出院患者)") @ApiModelProperty(value = "出院时间(出院患者)")
private LocalDateTime dischargeTime; private LocalDateTime dischargeTime;
/** 预约治疗组(取值以及枚举未知?) */ /**
* 预约治疗组取值以及枚举未知
*/
@ApiModelProperty(value = "预约治疗组(取值以及枚举未知?)") @ApiModelProperty(value = "预约治疗组(取值以及枚举未知?)")
private String appointmentTreatmentGroup; private String appointmentTreatmentGroup;
/** 登记号(预住院患者) */ /**
* 登记号预住院患者
*/
@ApiModelProperty(value = "登记号(预住院患者)") @ApiModelProperty(value = "登记号(预住院患者)")
private String registrationNo; private String registrationNo;
/** 登记日期预住院患者时间格式yyyy-MM-dd */ /**
* 登记日期预住院患者时间格式yyyy-MM-dd
*/
@ApiModelProperty(value = "登记日期预住院患者时间格式yyyy-MM-dd") @ApiModelProperty(value = "登记日期预住院患者时间格式yyyy-MM-dd")
private LocalDate registrationDate; private LocalDate registrationDate;
/** 预约时间预住院患者时间格式yyyy-MM-dd */ /**
* 预约时间预住院患者时间格式yyyy-MM-dd
*/
@ApiModelProperty(value = "预约时间预住院患者时间格式yyyy-MM-dd") @ApiModelProperty(value = "预约时间预住院患者时间格式yyyy-MM-dd")
private LocalDate appointmentDate; private LocalDate appointmentDate;
/** 门诊/住院号 */ /**
* 门诊/住院号
*/
@ApiModelProperty(value = "门诊/住院号 ") @ApiModelProperty(value = "门诊/住院号 ")
@Excel(name = "门诊/住院号 ", readConverterExp = "门诊/住院号 ") @Excel(name = "门诊/住院号 ", readConverterExp = "门诊/住院号 ")
private String inHospitalNumber; private String inHospitalNumber;
/** 就诊时间格式yyyy-MM-dd HH:mm:ss */ /**
@ApiModelProperty(value = "就诊时间格式yyyy-MM-dd HH:mm:ss") * 就诊时间格式yyyy-MM-dd HH:mm:ss
@JsonFormat(pattern = "yyyy-MM-dd") */
@Excel(name = "就诊时间格式yyyy-MM-dd HH:mm:ss", width = 30, dateFormat = "yyyy-MM-dd") @ApiModelProperty(value = "就诊时间格式yyyy-MM-dd HH:mm:ss")
private LocalDateTime visitDate; @JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "就诊时间格式yyyy-MM-dd HH:mm:ss", width = 30, dateFormat = "yyyy-MM-dd")
private LocalDateTime visitDate;
/** 出院方式(出院患者) */ /**
* 出院方式出院患者
*/
@ApiModelProperty(value = "出院方式") @ApiModelProperty(value = "出院方式")
@Excel(name = "出院方式", readConverterExp = "出=院患者") @Excel(name = "出院方式", readConverterExp = "出=院患者")
private String dischargeMethod; private String dischargeMethod;
/** 患者来源微信小程序WE_CHAT_APPLET微信公众号WE_CHAT_OFFICIAL_ACCOUNT管理端MANAGE_END */ /**
* 患者来源微信小程序WE_CHAT_APPLET微信公众号WE_CHAT_OFFICIAL_ACCOUNT管理端MANAGE_END
*/
@ApiModelProperty(value = "患者来源微信小程序WE_CHAT_APPLET微信公众号WE_CHAT_OFFICIAL_ACCOUNT管理端MANAGE_END") @ApiModelProperty(value = "患者来源微信小程序WE_CHAT_APPLET微信公众号WE_CHAT_OFFICIAL_ACCOUNT管理端MANAGE_END")
@Excel(name = "患者来源微信小程序WE_CHAT_APPLET微信公众号WE_CHAT_OFFICIAL_ACCOUNT管理端MANAGE_END") @Excel(name = "患者来源微信小程序WE_CHAT_APPLET微信公众号WE_CHAT_OFFICIAL_ACCOUNT管理端MANAGE_END")
private String patientSource; private String patientSource;
/** 删除标识0未删除1已删除 */ /**
* 删除标识0未删除1已删除
*/
private Integer delFlag; private Integer delFlag;
} }

View File

@ -3,6 +3,7 @@ package com.xinelu.manage.mapper.patientinfo;
import com.xinelu.manage.domain.patientinfo.PatientInfo; import com.xinelu.manage.domain.patientinfo.PatientInfo;
import com.xinelu.manage.dto.patientinfo.PatientInfoDto; import com.xinelu.manage.dto.patientinfo.PatientInfoDto;
import com.xinelu.manage.vo.patientinfo.PatientBaseInfoVo; import com.xinelu.manage.vo.patientinfo.PatientBaseInfoVo;
import java.util.List; import java.util.List;
/** /**
@ -20,7 +21,13 @@ public interface PatientInfoMapper {
*/ */
public PatientInfo selectPatientInfoById(Long id); public PatientInfo selectPatientInfoById(Long id);
public PatientBaseInfoVo getPatientBaseInfo(Long id); /**
* 查询患者信息
*
* @param id 主键id
* @return 患者信息
*/
public PatientBaseInfoVo getPatientBaseInfo(Long id);
/** /**
* 查询患者信息列表 * 查询患者信息列表

View File

@ -1,56 +1,56 @@
<?xml version="1.0" encoding="UTF-8" ?><!DOCTYPE mapper <?xml version="1.0" encoding="UTF-8" ?><!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.xinelu.manage.mapper.patientinfo.PatientInfoMapper"> <mapper namespace="com.xinelu.manage.mapper.patientinfo.PatientInfoMapper">
<resultMap type="com.xinelu.manage.domain.patientinfo.PatientInfo" id="PatientInfoResult"> <resultMap type="com.xinelu.manage.domain.patientinfo.PatientInfo" id="PatientInfoResult">
<result property="id" column="id" /> <result property="id" column="id"/>
<result property="residentId" column="resident_id" /> <result property="residentId" column="resident_id"/>
<result property="patientName" column="patient_name" /> <result property="patientName" column="patient_name"/>
<result property="patientPhone" column="patient_phone" /> <result property="patientPhone" column="patient_phone"/>
<result property="familyMemberPhone" column="family_member_phone" /> <result property="familyMemberPhone" column="family_member_phone"/>
<result property="birthDate" column="birth_date" /> <result property="birthDate" column="birth_date"/>
<result property="cardNo" column="card_no" /> <result property="cardNo" column="card_no"/>
<result property="sex" column="sex" /> <result property="sex" column="sex"/>
<result property="address" column="address" /> <result property="address" column="address"/>
<result property="patientType" column="patient_type" /> <result property="patientType" column="patient_type"/>
<result property="signStatus" column="sign_status" /> <result property="signStatus" column="sign_status"/>
<result property="signPatientRecordId" column="sign_patient_record_id" /> <result property="signPatientRecordId" column="sign_patient_record_id"/>
<result property="serviceStatus" column="service_status" /> <result property="serviceStatus" column="service_status"/>
<result property="signTime" column="sign_time" /> <result property="signTime" column="sign_time"/>
<result property="visitMethod" column="visit_method" /> <result property="visitMethod" column="visit_method"/>
<result property="attendingPhysicianId" column="attending_physician_id" /> <result property="attendingPhysicianId" column="attending_physician_id"/>
<result property="attendingPhysicianName" column="attending_physician_name" /> <result property="attendingPhysicianName" column="attending_physician_name"/>
<result property="mainDiagnosis" column="main_diagnosis" /> <result property="mainDiagnosis" column="main_diagnosis"/>
<result property="hospitalAgencyId" column="hospital_agency_id" /> <result property="hospitalAgencyId" column="hospital_agency_id"/>
<result property="hospitalAgencyName" column="hospital_agency_name" /> <result property="hospitalAgencyName" column="hospital_agency_name"/>
<result property="campusAgencyId" column="campus_agency_id" /> <result property="campusAgencyId" column="campus_agency_id"/>
<result property="campusAgencyName" column="campus_agency_name" /> <result property="campusAgencyName" column="campus_agency_name"/>
<result property="departmentId" column="department_id" /> <result property="departmentId" column="department_id"/>
<result property="departmentName" column="department_name" /> <result property="departmentName" column="department_name"/>
<result property="wardId" column="ward_id" /> <result property="wardId" column="ward_id"/>
<result property="wardName" column="ward_name" /> <result property="wardName" column="ward_name"/>
<result property="responsibleNurse" column="responsible_nurse" /> <result property="responsibleNurse" column="responsible_nurse"/>
<result property="patientVisitRecordId" column="patient_visit_record_id" /> <result property="patientVisitRecordId" column="patient_visit_record_id"/>
<result property="visitSerialNumber" column="visit_serial_number" /> <result property="visitSerialNumber" column="visit_serial_number"/>
<result property="admissionTime" column="admission_time" /> <result property="admissionTime" column="admission_time"/>
<result property="dischargeTime" column="discharge_time" /> <result property="dischargeTime" column="discharge_time"/>
<result property="appointmentTreatmentGroup" column="appointment_treatment_group" /> <result property="appointmentTreatmentGroup" column="appointment_treatment_group"/>
<result property="registrationNo" column="registration_no" /> <result property="registrationNo" column="registration_no"/>
<result property="registrationDate" column="registration_date" /> <result property="registrationDate" column="registration_date"/>
<result property="appointmentDate" column="appointment_date" /> <result property="appointmentDate" column="appointment_date"/>
<result property="inHospitalNumber" column="in_hospital_number" /> <result property="inHospitalNumber" column="in_hospital_number"/>
<result property="visitDate" column="visit_date" /> <result property="visitDate" column="visit_date"/>
<result property="dischargeMethod" column="discharge_method" /> <result property="dischargeMethod" column="discharge_method"/>
<result property="patientSource" column="patient_source" /> <result property="patientSource" column="patient_source"/>
<result property="delFlag" column="del_flag" /> <result property="delFlag" column="del_flag"/>
<result property="createBy" column="create_by" /> <result property="createBy" column="create_by"/>
<result property="createTime" column="create_time" /> <result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by" /> <result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time" /> <result property="updateTime" column="update_time"/>
</resultMap> </resultMap>
<sql id="selectPatientInfoVo"> <sql id="selectPatientInfoVo">
select id,resident_id, select id,resident_id,
patient_name, patient_name,
patient_phone, patient_phone,
@ -71,428 +71,431 @@
from patient_info from patient_info
</sql> </sql>
<select id="selectPatientInfoList" parameterType="com.xinelu.manage.dto.patientinfo.PatientInfoDto" resultMap="PatientInfoResult"> <select id="selectPatientInfoList" parameterType="com.xinelu.manage.dto.patientinfo.PatientInfoDto"
<include refid="selectPatientInfoVo" /> resultMap="PatientInfoResult">
<where> <include refid="selectPatientInfoVo"/>
del_flag = 0 <where>
<if test="patientName != null and patientName != ''"> del_flag = 0
and patient_name = #{patientName} <if test="patientName != null and patientName != ''">
</if> and patient_name = #{patientName}
<if test="patientPhone != null and patientPhone != ''"> </if>
and patient_phone like concat('%', #{patientPhone}, '%') <if test="patientPhone != null and patientPhone != ''">
</if> and patient_phone like concat('%', #{patientPhone}, '%')
<if test="cardNo != null and cardNo != ''"> </if>
and card_no = #{cardNo} <if test="cardNo != null and cardNo != ''">
</if> and card_no = #{cardNo}
<if test="patientType != null and patientType != ''"> </if>
<choose> <if test="patientType != null and patientType != ''">
<when test="patientType == 'OUTPATIENT_DISCHARGE'.toString()"> <choose>
and (patient_type = 'OUTPATIENT' or patient_type = 'DISCHARGED_PATIENT') <when test="patientType == 'OUTPATIENT_DISCHARGE'.toString()">
</when> and (patient_type = 'OUTPATIENT' or patient_type = 'DISCHARGED_PATIENT')
<otherwise> </when>
and patient_type = #{patientType} <otherwise>
</otherwise> and patient_type = #{patientType}
</choose> </otherwise>
</if> </choose>
<if test="attendingPhysicianId != null"> </if>
and attending_physician_id = #{attendingPhysicianId} <if test="attendingPhysicianId != null">
</if> and attending_physician_id = #{attendingPhysicianId}
<if test="mainDiagnosis != null and mainDiagnosis != ''"> </if>
and main_diagnosis like concat('%', #{mainDiagnosis}, '%') <if test="mainDiagnosis != null and mainDiagnosis != ''">
</if> and main_diagnosis like concat('%', #{mainDiagnosis}, '%')
<if test="hospitalAgencyId != null "> </if>
and hospital_agency_id = #{hospitalAgencyId} <if test="hospitalAgencyId != null ">
</if> and hospital_agency_id = #{hospitalAgencyId}
<if test="campusAgencyId != null "> </if>
and campus_agency_id = #{campusAgencyId} <if test="campusAgencyId != null ">
</if> and campus_agency_id = #{campusAgencyId}
<if test="departmentId != null "> </if>
and department_id = #{departmentId} <if test="departmentId != null ">
</if> and department_id = #{departmentId}
<if test="wardId != null "> </if>
and ward_id = #{wardId} <if test="wardId != null ">
</if> and ward_id = #{wardId}
<if test="visitMethod != null and visitMethod != ''"> </if>
and visit_method = #{visitMethod} <if test="visitMethod != null and visitMethod != ''">
</if> and visit_method = #{visitMethod}
<if test="visitDateStart != null "> </if>
and visit_date >= #{visitDateStart} <if test="visitDateStart != null ">
</if> and visit_date >= #{visitDateStart}
<if test="visitDateEnd != null "> </if>
and visit_date &lt;= #{visitDateEnd} <if test="visitDateEnd != null ">
</if> and visit_date &lt;= #{visitDateEnd}
<if test="admissionTimeStart != null "> </if>
and admission_time >= #{admissionTimeStart} <if test="admissionTimeStart != null ">
</if> and admission_time >= #{admissionTimeStart}
<if test="admissionTimeEnd != null "> </if>
and admission_time &lt;= #{admissionTimeEnd} <if test="admissionTimeEnd != null ">
</if> and admission_time &lt;= #{admissionTimeEnd}
<if test="appointmentDateStart != null "> </if>
and appointment_date >= #{appointmentDateStart} <if test="appointmentDateStart != null ">
</if> and appointment_date >= #{appointmentDateStart}
<if test="appointmentDateEnd != null "> </if>
and appointment_date &lt;= #{appointmentDateEnd} <if test="appointmentDateEnd != null ">
</if> and appointment_date &lt;= #{appointmentDateEnd}
<if test="appointmentTreatmentGroup != null and appointmentTreatmentGroup != ''"> </if>
and appointment_treatment_group = #{appointmentTreatmentGroup} <if test="appointmentTreatmentGroup != null and appointmentTreatmentGroup != ''">
</if> and appointment_treatment_group = #{appointmentTreatmentGroup}
<if test="registrationNo != null and registrationNo != ''"> </if>
and registration_no = #{registrationNo} <if test="registrationNo != null and registrationNo != ''">
</if> and registration_no = #{registrationNo}
<if test="visitSerialNumber != null and visitSerialNumber != ''"> </if>
and visit_serial_number = #{visitSerialNumber} <if test="visitSerialNumber != null and visitSerialNumber != ''">
</if> and visit_serial_number = #{visitSerialNumber}
<if test="responsibleNurse != null and responsibleNurse != ''"> </if>
and responsible_nurse = #{responsibleNurse} <if test="responsibleNurse != null and responsibleNurse != ''">
</if> and responsible_nurse = #{responsibleNurse}
<if test="patientSource != null and patientSource != ''"> </if>
and patient_source = #{patientSource} <if test="patientSource != null and patientSource != ''">
</if> and patient_source = #{patientSource}
</where> </if>
</select> </where>
</select>
<select id="selectPatientInfoById" parameterType="Long" resultMap="PatientInfoResult"> <select id="selectPatientInfoById" parameterType="Long" resultMap="PatientInfoResult">
<include refid="selectPatientInfoVo" /> <include refid="selectPatientInfoVo"/>
where id = #{id} where id = #{id}
</select> </select>
<select id="getPatientBaseInfo" parameterType="Long" resultType="com.xinelu.manage.vo.patientinfo.PatientBaseInfoVo"> <select id="getPatientBaseInfo" parameterType="Long"
resultType="com.xinelu.manage.vo.patientinfo.PatientBaseInfoVo">
select id, resident_id, patient_name, patient_phone, family_member_phone, select id, resident_id, patient_name, patient_phone, family_member_phone,
birth_date, card_no, sex, address birth_date, card_no, sex, address
from patient_info from patient_info
where id = #{id} where id = #{id}
</select> </select>
<insert id="insertPatientInfo" parameterType="com.xinelu.manage.domain.patientinfo.PatientInfo" useGeneratedKeys="true" keyProperty="id"> <insert id="insertPatientInfo" parameterType="com.xinelu.manage.domain.patientinfo.PatientInfo"
insert into patient_info useGeneratedKeys="true" keyProperty="id">
<trim prefix="(" suffix=")" suffixOverrides=","> insert into patient_info
<if test="residentId != null"> <trim prefix="(" suffix=")" suffixOverrides=",">
resident_id, <if test="residentId != null">
</if> resident_id,
<if test="patientName != null"> </if>
patient_name, <if test="patientName != null">
</if> patient_name,
<if test="patientPhone != null">patient_phone, </if>
</if> <if test="patientPhone != null">patient_phone,
<if test="familyMemberPhone != null">family_member_phone, </if>
</if> <if test="familyMemberPhone != null">family_member_phone,
<if test="birthDate != null">birth_date, </if>
</if> <if test="birthDate != null">birth_date,
<if test="cardNo != null">card_no, </if>
</if> <if test="cardNo != null">card_no,
<if test="sex != null">sex, </if>
</if> <if test="sex != null">sex,
<if test="address != null">address, </if>
</if> <if test="address != null">address,
<if test="patientType != null">patient_type, </if>
</if> <if test="patientType != null">patient_type,
<if test="signStatus != null">sign_status, </if>
</if> <if test="signStatus != null">sign_status,
<if test="signPatientRecordId != null">sign_patient_record_id, </if>
</if> <if test="signPatientRecordId != null">sign_patient_record_id,
<if test="serviceStatus != null">service_status, </if>
</if> <if test="serviceStatus != null">service_status,
<if test="signTime != null">sign_time, </if>
</if> <if test="signTime != null">sign_time,
<if test="visitMethod != null">visit_method, </if>
</if> <if test="visitMethod != null">visit_method,
<if test="attendingPhysicianId != null">attending_physician_id, </if>
</if> <if test="attendingPhysicianId != null">attending_physician_id,
<if test="attendingPhysicianName != null">attending_physician_name, </if>
</if> <if test="attendingPhysicianName != null">attending_physician_name,
<if test="mainDiagnosis != null">main_diagnosis, </if>
</if> <if test="mainDiagnosis != null">main_diagnosis,
<if test="hospitalAgencyId != null">hospital_agency_id, </if>
</if> <if test="hospitalAgencyId != null">hospital_agency_id,
<if test="hospitalAgencyName != null">hospital_agency_name, </if>
</if> <if test="hospitalAgencyName != null">hospital_agency_name,
<if test="campusAgencyId != null">campus_agency_id, </if>
</if> <if test="campusAgencyId != null">campus_agency_id,
<if test="campusAgencyName != null">campus_agency_name, </if>
</if> <if test="campusAgencyName != null">campus_agency_name,
<if test="departmentId != null">department_id, </if>
</if> <if test="departmentId != null">department_id,
<if test="departmentName != null">department_name, </if>
</if> <if test="departmentName != null">department_name,
<if test="wardId != null">ward_id, </if>
</if> <if test="wardId != null">ward_id,
<if test="wardName != null">ward_name, </if>
</if> <if test="wardName != null">ward_name,
<if test="responsibleNurse != null"> </if>
responsible_nurse, <if test="responsibleNurse != null">
</if> responsible_nurse,
<if test="patientVisitRecordId != null"> </if>
patient_visit_record_id, <if test="patientVisitRecordId != null">
</if> patient_visit_record_id,
<if test="visitSerialNumber != null"> </if>
visit_serial_number, <if test="visitSerialNumber != null">
</if> visit_serial_number,
<if test="admissionTime != null"> </if>
admission_time, <if test="admissionTime != null">
</if> admission_time,
<if test="dischargeTime != null"> </if>
discharge_time, <if test="dischargeTime != null">
</if> discharge_time,
<if test="appointmentTreatmentGroup != null">appointment_treatment_group, </if>
</if> <if test="appointmentTreatmentGroup != null">appointment_treatment_group,
<if test="registrationNo != null">registration_no, </if>
</if> <if test="registrationNo != null">registration_no,
<if test="registrationDate != null">registration_date, </if>
</if> <if test="registrationDate != null">registration_date,
<if test="appointmentDate != null">appointment_date, </if>
</if> <if test="appointmentDate != null">appointment_date,
<if test="inHospitalNumber != null">in_hospital_number, </if>
</if> <if test="inHospitalNumber != null">in_hospital_number,
<if test="visitDate != null">visit_date, </if>
</if> <if test="visitDate != null">visit_date,
<if test="dischargeMethod != null">discharge_method, </if>
</if> <if test="dischargeMethod != null">discharge_method,
<if test="patientSource != null">patient_source, </if>
</if> <if test="patientSource != null">patient_source,
<if test="delFlag != null">del_flag, </if>
</if> <if test="delFlag != null">del_flag,
<if test="createBy != null">create_by, </if>
</if> <if test="createBy != null">create_by,
<if test="createTime != null">create_time, </if>
</if> <if test="createTime != null">create_time,
<if test="updateBy != null">update_by, </if>
</if> <if test="updateBy != null">update_by,
<if test="updateTime != null">update_time, </if>
</if> <if test="updateTime != null">update_time,
</trim> </if>
<trim prefix="values (" suffix=")" suffixOverrides=","> </trim>
<if test="residentId != null">#{residentId}, <trim prefix="values (" suffix=")" suffixOverrides=",">
</if> <if test="residentId != null">#{residentId},
<if test="patientName != null">#{patientName}, </if>
</if> <if test="patientName != null">#{patientName},
<if test="patientPhone != null">#{patientPhone}, </if>
</if> <if test="patientPhone != null">#{patientPhone},
<if test="familyMemberPhone != null">#{familyMemberPhone}, </if>
</if> <if test="familyMemberPhone != null">#{familyMemberPhone},
<if test="birthDate != null">#{birthDate}, </if>
</if> <if test="birthDate != null">#{birthDate},
<if test="cardNo != null">#{cardNo}, </if>
</if> <if test="cardNo != null">#{cardNo},
<if test="sex != null">#{sex}, </if>
</if> <if test="sex != null">#{sex},
<if test="address != null">#{address}, </if>
</if> <if test="address != null">#{address},
<if test="patientType != null">#{patientType}, </if>
</if> <if test="patientType != null">#{patientType},
<if test="signStatus != null">#{signStatus}, </if>
</if> <if test="signStatus != null">#{signStatus},
<if test="signPatientRecordId != null">#{signPatientRecordId}, </if>
</if> <if test="signPatientRecordId != null">#{signPatientRecordId},
<if test="serviceStatus != null">#{serviceStatus}, </if>
</if> <if test="serviceStatus != null">#{serviceStatus},
<if test="signTime != null">#{signTime}, </if>
</if> <if test="signTime != null">#{signTime},
<if test="visitMethod != null">#{visitMethod}, </if>
</if> <if test="visitMethod != null">#{visitMethod},
<if test="attendingPhysicianId != null">#{attendingPhysicianId}, </if>
</if> <if test="attendingPhysicianId != null">#{attendingPhysicianId},
<if test="attendingPhysicianName != null">#{attendingPhysicianName}, </if>
</if> <if test="attendingPhysicianName != null">#{attendingPhysicianName},
<if test="mainDiagnosis != null">#{mainDiagnosis}, </if>
</if> <if test="mainDiagnosis != null">#{mainDiagnosis},
<if test="hospitalAgencyId != null">#{hospitalAgencyId}, </if>
</if> <if test="hospitalAgencyId != null">#{hospitalAgencyId},
<if test="hospitalAgencyName != null">#{hospitalAgencyName}, </if>
</if> <if test="hospitalAgencyName != null">#{hospitalAgencyName},
<if test="campusAgencyId != null">#{campusAgencyId}, </if>
</if> <if test="campusAgencyId != null">#{campusAgencyId},
<if test="campusAgencyName != null">#{campusAgencyName}, </if>
</if> <if test="campusAgencyName != null">#{campusAgencyName},
<if test="departmentId != null">#{departmentId}, </if>
</if> <if test="departmentId != null">#{departmentId},
<if test="departmentName != null">#{departmentName}, </if>
</if> <if test="departmentName != null">#{departmentName},
<if test="wardId != null">#{wardId}, </if>
</if> <if test="wardId != null">#{wardId},
<if test="wardName != null">#{wardName}, </if>
</if> <if test="wardName != null">#{wardName},
<if test="responsibleNurse != null">#{responsibleNurse}, </if>
</if> <if test="responsibleNurse != null">#{responsibleNurse},
<if test="patientVisitRecordId != null">#{patientVisitRecordId}, </if>
</if> <if test="patientVisitRecordId != null">#{patientVisitRecordId},
<if test="visitSerialNumber != null">#{visitSerialNumber}, </if>
</if> <if test="visitSerialNumber != null">#{visitSerialNumber},
<if test="admissionTime != null">#{admissionTime}, </if>
</if> <if test="admissionTime != null">#{admissionTime},
<if test="dischargeTime != null">#{dischargeTime}, </if>
</if> <if test="dischargeTime != null">#{dischargeTime},
<if test="appointmentTreatmentGroup != null">#{appointmentTreatmentGroup}, </if>
</if> <if test="appointmentTreatmentGroup != null">#{appointmentTreatmentGroup},
<if test="registrationNo != null">#{registrationNo}, </if>
</if> <if test="registrationNo != null">#{registrationNo},
<if test="registrationDate != null">#{registrationDate}, </if>
</if> <if test="registrationDate != null">#{registrationDate},
<if test="appointmentDate != null">#{appointmentDate}, </if>
</if> <if test="appointmentDate != null">#{appointmentDate},
<if test="inHospitalNumber != null">#{inHospitalNumber}, </if>
</if> <if test="inHospitalNumber != null">#{inHospitalNumber},
<if test="visitDate != null">#{visitDate}, </if>
</if> <if test="visitDate != null">#{visitDate},
<if test="dischargeMethod != null">#{dischargeMethod}, </if>
</if> <if test="dischargeMethod != null">#{dischargeMethod},
<if test="patientSource != null">#{patientSource}, </if>
</if> <if test="patientSource != null">#{patientSource},
<if test="delFlag != null">#{delFlag}, </if>
</if> <if test="delFlag != null">#{delFlag},
<if test="createBy != null">#{createBy}, </if>
</if> <if test="createBy != null">#{createBy},
<if test="createTime != null">#{createTime}, </if>
</if> <if test="createTime != null">#{createTime},
<if test="updateBy != null">#{updateBy}, </if>
</if> <if test="updateBy != null">#{updateBy},
<if test="updateTime != null">#{updateTime}, </if>
</if> <if test="updateTime != null">#{updateTime},
</trim> </if>
</insert> </trim>
</insert>
<update id="updatePatientInfo" parameterType="com.xinelu.manage.domain.patientinfo.PatientInfo"> <update id="updatePatientInfo" parameterType="com.xinelu.manage.domain.patientinfo.PatientInfo">
update patient_info update patient_info
<trim prefix="SET" suffixOverrides=","> <trim prefix="SET" suffixOverrides=",">
<if test="residentId != null"> <if test="residentId != null">
resident_id = #{residentId}, resident_id = #{residentId},
</if> </if>
<if test="patientName != null"> <if test="patientName != null">
patient_name = #{patientName}, patient_name = #{patientName},
</if> </if>
<if test="patientPhone != null"> <if test="patientPhone != null">
patient_phone = #{patientPhone}, patient_phone = #{patientPhone},
</if> </if>
<if test="familyMemberPhone != null"> <if test="familyMemberPhone != null">
family_member_phone = #{familyMemberPhone}, family_member_phone = #{familyMemberPhone},
</if> </if>
<if test="birthDate != null"> <if test="birthDate != null">
birth_date = #{birthDate}, birth_date = #{birthDate},
</if> </if>
<if test="cardNo != null"> <if test="cardNo != null">
card_no = #{cardNo}, card_no = #{cardNo},
</if> </if>
<if test="sex != null"> <if test="sex != null">
sex = #{sex}, sex = #{sex},
</if> </if>
<if test="address != null"> <if test="address != null">
address = #{address}, address = #{address},
</if> </if>
<if test="patientType != null"> <if test="patientType != null">
patient_type = #{patientType}, patient_type = #{patientType},
</if> </if>
<if test="signStatus != null">sign_status = <if test="signStatus != null">sign_status =
#{signStatus}, #{signStatus},
</if> </if>
<if test="signPatientRecordId != null">sign_patient_record_id = #{signPatientRecordId}, <if test="signPatientRecordId != null">sign_patient_record_id = #{signPatientRecordId},
</if> </if>
<if test="serviceStatus != null">service_status = #{serviceStatus}, <if test="serviceStatus != null">service_status = #{serviceStatus},
</if> </if>
<if test="signTime != null">sign_time = <if test="signTime != null">sign_time =
#{signTime}, #{signTime},
</if> </if>
<if test="visitMethod != null">visit_method = <if test="visitMethod != null">visit_method =
#{visitMethod}, #{visitMethod},
</if> </if>
<if test="attendingPhysicianId != null">attending_physician_id = <if test="attendingPhysicianId != null">attending_physician_id =
#{attendingPhysicianId}, #{attendingPhysicianId},
</if> </if>
<if test="attendingPhysicianName != null">attending_physician_name = <if test="attendingPhysicianName != null">attending_physician_name =
#{attendingPhysicianName}, #{attendingPhysicianName},
</if> </if>
<if test="mainDiagnosis != null">main_diagnosis = <if test="mainDiagnosis != null">main_diagnosis =
#{mainDiagnosis}, #{mainDiagnosis},
</if> </if>
<if test="hospitalAgencyId != null">hospital_agency_id = <if test="hospitalAgencyId != null">hospital_agency_id =
#{hospitalAgencyId}, #{hospitalAgencyId},
</if> </if>
<if test="hospitalAgencyName != null">hospital_agency_name = <if test="hospitalAgencyName != null">hospital_agency_name =
#{hospitalAgencyName}, #{hospitalAgencyName},
</if> </if>
<if test="campusAgencyId != null">campus_agency_id = <if test="campusAgencyId != null">campus_agency_id =
#{campusAgencyId}, #{campusAgencyId},
</if> </if>
<if test="campusAgencyName != null">campus_agency_name = <if test="campusAgencyName != null">campus_agency_name =
#{campusAgencyName}, #{campusAgencyName},
</if> </if>
<if test="departmentId != null">department_id = <if test="departmentId != null">department_id =
#{departmentId}, #{departmentId},
</if> </if>
<if test="departmentName != null">department_name = <if test="departmentName != null">department_name =
#{departmentName}, #{departmentName},
</if> </if>
<if test="wardId != null">ward_id = <if test="wardId != null">ward_id =
#{wardId}, #{wardId},
</if> </if>
<if test="wardName != null">ward_name = <if test="wardName != null">ward_name =
#{wardName}, #{wardName},
</if> </if>
<if test="responsibleNurse != null">responsible_nurse = <if test="responsibleNurse != null">responsible_nurse =
#{responsibleNurse}, #{responsibleNurse},
</if> </if>
<if test="patientVisitRecordId != null">patient_visit_record_id = <if test="patientVisitRecordId != null">patient_visit_record_id =
#{patientVisitRecordId}, #{patientVisitRecordId},
</if> </if>
<if test="visitSerialNumber != null">visit_serial_number = <if test="visitSerialNumber != null">visit_serial_number =
#{visitSerialNumber}, #{visitSerialNumber},
</if> </if>
<if test="admissionTime != null"> <if test="admissionTime != null">
admission_time = #{admissionTime}, admission_time = #{admissionTime},
</if> </if>
<if test="dischargeTime != null"> <if test="dischargeTime != null">
discharge_time = #{dischargeTime}, discharge_time = #{dischargeTime},
</if> </if>
<if test="appointmentTreatmentGroup != null">appointment_treatment_group = <if test="appointmentTreatmentGroup != null">appointment_treatment_group =
#{appointmentTreatmentGroup}, #{appointmentTreatmentGroup},
</if> </if>
<if test="registrationNo != null">registration_no = <if test="registrationNo != null">registration_no =
#{registrationNo}, #{registrationNo},
</if> </if>
<if test="registrationDate != null">registration_date = <if test="registrationDate != null">registration_date =
#{registrationDate}, #{registrationDate},
</if> </if>
<if test="appointmentDate != null">appointment_date = <if test="appointmentDate != null">appointment_date =
#{appointmentDate}, #{appointmentDate},
</if> </if>
<if test="inHospitalNumber != null">in_hospital_number = <if test="inHospitalNumber != null">in_hospital_number =
#{inHospitalNumber}, #{inHospitalNumber},
</if> </if>
<if test="visitDate != null">visit_date = <if test="visitDate != null">visit_date =
#{visitDate}, #{visitDate},
</if> </if>
<if test="dischargeMethod != null">discharge_method = <if test="dischargeMethod != null">discharge_method =
#{dischargeMethod}, #{dischargeMethod},
</if> </if>
<if test="patientSource != null">patient_source = <if test="patientSource != null">patient_source =
#{patientSource}, #{patientSource},
</if> </if>
<if test="delFlag != null">del_flag = <if test="delFlag != null">del_flag =
#{delFlag}, #{delFlag},
</if> </if>
<if test="createBy != null">create_by = <if test="createBy != null">create_by =
#{createBy}, #{createBy},
</if> </if>
<if test="createTime != null">create_time = <if test="createTime != null">create_time =
#{createTime}, #{createTime},
</if> </if>
<if test="updateBy != null">update_by = <if test="updateBy != null">update_by =
#{updateBy}, #{updateBy},
</if> </if>
<if test="updateTime != null">update_time = <if test="updateTime != null">update_time =
#{updateTime}, #{updateTime},
</if> </if>
</trim> </trim>
where id = #{id} where id = #{id}
</update> </update>
<update id="deletePatientInfoById" parameterType="Long"> <update id="deletePatientInfoById" parameterType="Long">
update patient_info set del_flag = 1 update patient_info set del_flag = 1
where id = #{id} where id = #{id}
</update> </update>
<update id="deletePatientInfoByIds" parameterType="String"> <update id="deletePatientInfoByIds" parameterType="String">
update patient_info set del_flag = 1 where id in update patient_info set del_flag = 1 where id in
<foreach item="id" collection="array" open="(" separator="," close=")"> <foreach item="id" collection="array" open="(" separator="," close=")">
#{id} #{id}
</foreach> </foreach>
</update> </update>
</mapper> </mapper>