初始化
This commit is contained in:
@@ -0,0 +1,176 @@
|
||||
<?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.os.mapper.HealthcareOsPatientDiagnosisMapper">
|
||||
|
||||
<resultMap type="HealthcareOsPatientDiagnosis" id="HealthcareOsPatientDiagnosisResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="patientId" column="patient_id" />
|
||||
<result property="diagnosisType" column="diagnosis_type" />
|
||||
<result property="isInsured" column="is_insured" />
|
||||
<result property="value" column="value" />
|
||||
<result property="studentId" column="student_id" />
|
||||
<result property="name" column="name" />
|
||||
<result property="patientType" column="patient_type" />
|
||||
<result property="chiefComplaint" column="chief_complaint" />
|
||||
<result property="presentIllness" column="present_illness" />
|
||||
<result property="pastHistory" column="past_history" />
|
||||
<result property="diagnosis" column="diagnosis" />
|
||||
<result property="medicalAdvice" column="medical_advice" />
|
||||
<result property="doctorName" column="doctor_name" />
|
||||
<result property="status" column="status" />
|
||||
<result property="outpatientTime" column="outpatient_time" />
|
||||
<!-- 库房 -->
|
||||
<result property="storeroomId" column="storeroom_id" />
|
||||
<result property="storeroomName" column="storeroom_name" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="idCard" column="id_card" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectHealthcareOsPatientDiagnosisVo">
|
||||
select id, patient_id, diagnosis_type, is_insured,AES_DECRYPT(UNHEX(id_card),'zhxg') as id_card ,value, student_id, name,
|
||||
patient_type, chief_complaint, present_illness, past_history, diagnosis, medical_advice, doctor_name, status , outpatient_time ,storeroom_id , storeroom_name , create_by, create_time, update_by, update_time from healthcare_os_patient_diagnosis
|
||||
</sql>
|
||||
|
||||
<select id="selectHealthcareOsPatientDiagnosisList" parameterType="HealthcareOsPatientDiagnosis" resultMap="HealthcareOsPatientDiagnosisResult" >
|
||||
<include refid="selectHealthcareOsPatientDiagnosisVo"/>
|
||||
<where>
|
||||
<if test="patientId != null "> and patient_id = #{patientId}</if>
|
||||
<if test="diagnosisType != null "> and diagnosis_type = #{diagnosisType}</if>
|
||||
<if test="isInsured != null "> and is_insured = #{isInsured}</if>
|
||||
<if test="value != null "> and value = #{value}</if>
|
||||
<if test="studentId != null and studentId != ''"> and student_id like concat('%', #{studentId}, '%')</if>
|
||||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||
<if test="patientType != null "> and patient_type = #{patientType}</if>
|
||||
<if test="chiefComplaint != null and chiefComplaint != ''"> and chief_complaint = #{chiefComplaint}</if>
|
||||
<if test="presentIllness != null and presentIllness != ''"> and present_illness = #{presentIllness}</if>
|
||||
<if test="pastHistory != null and pastHistory != ''"> and past_history = #{pastHistory}</if>
|
||||
<if test="diagnosis != null and diagnosis != ''"> and diagnosis = #{diagnosis}</if>
|
||||
<if test="medicalAdvice != null and medicalAdvice != ''"> and medical_advice = #{medicalAdvice}</if>
|
||||
<if test="doctorName != null and doctorName != ''"> and doctor_name like concat('%', #{doctorName}, '%')</if>
|
||||
<if test="status != null and status != ''"> and status = #{status}</if>
|
||||
<if test="outpatientTime != null and outpatientTime instanceof java.util.Date"> and outpatient_time between #{params.outpatientTimeFront} and #{params.outpatientTimeAfter}</if>
|
||||
<if test="storeroomId != null" >and storeroom_id = #{storeroomId}</if>
|
||||
<if test="storeroomName != null" >and storeroom_name = #{storeroomName}</if>
|
||||
<if test="startTime != null and endTime != null">
|
||||
AND healthcare_os_patient_diagnosis.outpatient_time BETWEEN #{startTime} AND #{endTime}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY outpatient_time DESC
|
||||
</select>
|
||||
|
||||
<select id="selectHealthcareOsPatientDiagnosisById" parameterType="Long" resultMap="HealthcareOsPatientDiagnosisResult">
|
||||
<include refid="selectHealthcareOsPatientDiagnosisVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertHealthcareOsPatientDiagnosis" parameterType="HealthcareOsPatientDiagnosis" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into healthcare_os_patient_diagnosis
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="patientId != null">patient_id,</if>
|
||||
<if test="diagnosisType != null">diagnosis_type,</if>
|
||||
<if test="isInsured != null">is_insured,</if>
|
||||
<if test="value != null">value,</if>
|
||||
<if test="studentId != null">student_id,</if>
|
||||
<if test="name != null and name != ''">name,</if>
|
||||
<if test="patientType != null">patient_type,</if>
|
||||
<if test="chiefComplaint != null">chief_complaint,</if>
|
||||
<if test="presentIllness != null">present_illness,</if>
|
||||
<if test="pastHistory != null">past_history,</if>
|
||||
<if test="diagnosis != null">diagnosis,</if>
|
||||
<if test="medicalAdvice != null">medical_advice,</if>
|
||||
<if test="doctorName != null">doctor_name,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="outpatientTime != null">outpatient_time,</if>
|
||||
<if test="storeroomId != null" >storeroom_id ,</if>
|
||||
<if test="storeroomName != null" >storeroom_name ,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="idCard != null">id_card,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="patientId != null">#{patientId},</if>
|
||||
<if test="diagnosisType != null">#{diagnosisType},</if>
|
||||
<if test="isInsured != null">#{isInsured},</if>
|
||||
<if test="value != null">#{value},</if>
|
||||
<if test="studentId != null">#{studentId},</if>
|
||||
<if test="name != null and name != ''">#{name},</if>
|
||||
<if test="patientType != null">#{patientType},</if>
|
||||
<if test="chiefComplaint != null">#{chiefComplaint},</if>
|
||||
<if test="presentIllness != null">#{presentIllness},</if>
|
||||
<if test="pastHistory != null">#{pastHistory},</if>
|
||||
<if test="diagnosis != null">#{diagnosis},</if>
|
||||
<if test="medicalAdvice != null">#{medicalAdvice},</if>
|
||||
<if test="doctorName != null">#{doctorName},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="outpatientTime != null">#{outpatientTime},</if>
|
||||
<if test="storeroomId != null">#{storeroomId},</if>
|
||||
<if test="storeroomName != null">#{storeroomName},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="idCard != null">#{idCard},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateHealthcareOsPatientDiagnosis" parameterType="HealthcareOsPatientDiagnosis">
|
||||
update healthcare_os_patient_diagnosis
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="patientId != null">patient_id = #{patientId},</if>
|
||||
<if test="diagnosisType != null">diagnosis_type = #{diagnosisType},</if>
|
||||
<if test="isInsured != null">is_insured = #{isInsured},</if>
|
||||
<if test="value != null">value = #{value},</if>
|
||||
<if test="studentId != null">student_id = #{studentId},</if>
|
||||
<if test="name != null and name != ''">name = #{name},</if>
|
||||
<if test="patientType != null">patient_type = #{patientType},</if>
|
||||
<if test="chiefComplaint != null">chief_complaint = #{chiefComplaint},</if>
|
||||
<if test="presentIllness != null">present_illness = #{presentIllness},</if>
|
||||
<if test="pastHistory != null">past_history = #{pastHistory},</if>
|
||||
<if test="diagnosis != null">diagnosis = #{diagnosis},</if>
|
||||
<if test="medicalAdvice != null">medical_advice = #{medicalAdvice},</if>
|
||||
<if test="doctorName != null">doctor_name = #{doctorName},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="outpatientTime != null">outpatient_time = #{outpatientTime},</if>
|
||||
<if test="storeroomId != null">storeroom_id = #{storeroomId},</if>
|
||||
<if test="storeroomName != null">storeroom_name = #{storeroomName},</if>
|
||||
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="idCard != null">id_card = #{idCard},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteHealthcareOsPatientDiagnosisById" parameterType="Long">
|
||||
delete from healthcare_os_patient_diagnosis where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteHealthcareOsPatientDiagnosisByIds" parameterType="String">
|
||||
delete from healthcare_os_patient_diagnosis where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<update id="updateHealthchcareOsPatientDiagnoisDataUtile">
|
||||
UPDATE healthcare_os_patient_diagnosis pd
|
||||
JOIN healthcare_os_patient_info pi ON pd.student_id = pi.student_id
|
||||
SET pd.patient_id = pi.id
|
||||
WHERE pd.patient_id IS NULL;
|
||||
</update>
|
||||
|
||||
<update id="updateHealthchcareOspatientDiagnoisDocitNameUtile">
|
||||
update healthcare_os_patient_diagnosis hpd
|
||||
join sys_user su on hpd.doctor_name = su.user_name COLLATE utf8mb4_unicode_ci
|
||||
set hpd.doctor_name = su.nick_name where hpd.doctor_name COLLATE utf8mb4_unicode_ci is not null;
|
||||
</update>
|
||||
|
||||
</mapper>
|
Reference in New Issue
Block a user