|
|
@@ -0,0 +1,133 @@
|
|
|
+<?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.fs.his.mapper.FsDoctorPatientMapper">
|
|
|
+
|
|
|
+ <resultMap type="com.fs.his.domain.FsDoctorPatient" id="FsDoctorPatientResult">
|
|
|
+ <result property="id" column="id" />
|
|
|
+ <result property="patientName" column="patient_name" />
|
|
|
+ <result property="sex" column="sex" />
|
|
|
+ <result property="age" column="age" />
|
|
|
+ <result property="phone" column="phone" />
|
|
|
+ <result property="receptionTime" column="reception_time" />
|
|
|
+ <result property="receptionDoctor" column="reception_doctor" />
|
|
|
+ <result property="city" column="city" />
|
|
|
+ <result property="presentIllness" column="present_illness" />
|
|
|
+ <result property="pastHistory" column="past_history" />
|
|
|
+ <result property="allergyHistory" column="allergy_history" />
|
|
|
+ <result property="diagnosis" column="diagnosis" />
|
|
|
+ <result property="syndromeType" column="syndrome_type" />
|
|
|
+ <result property="syndromeRegulation" column="syndrome_regulation" />
|
|
|
+ <result property="treatmentOpinion" column="treatment_opinion" />
|
|
|
+ <result property="precautions" column="precautions" />
|
|
|
+ <result property="doctorSignature" column="doctor_signature" />
|
|
|
+ <result property="practiceCertificateNo" column="practice_certificate_no" />
|
|
|
+ <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="remark" column="remark" />
|
|
|
+ <result property="doctorId" column="doctor_id" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectFsDoctorPatientVo">
|
|
|
+ select id, patient_name, sex, age, phone, reception_time, reception_doctor, city,
|
|
|
+ present_illness, past_history, allergy_history, diagnosis, syndrome_type,
|
|
|
+ syndrome_regulation, treatment_opinion, precautions, doctor_signature,
|
|
|
+ practice_certificate_no, doctor_id,
|
|
|
+ create_by, create_time, update_by, update_time, remark, del_flag
|
|
|
+ from fs_doctor_patient
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectFsDoctorPatientList" parameterType="com.fs.his.domain.FsDoctorPatient" resultMap="FsDoctorPatientResult">
|
|
|
+ <include refid="selectFsDoctorPatientVo"/>
|
|
|
+ where del_flag = '0'
|
|
|
+ <if test="patientName != null and patientName != ''">
|
|
|
+ and patient_name like concat('%', #{patientName}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="sex != null and sex != ''">
|
|
|
+ and sex = #{sex}
|
|
|
+ </if>
|
|
|
+ <if test="phone != null and phone != ''">
|
|
|
+ and phone like concat('%', #{phone}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="receptionDoctor != null and receptionDoctor != ''">
|
|
|
+ and reception_doctor like concat('%', #{receptionDoctor}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="receptionTime != null">
|
|
|
+ and reception_time = #{receptionTime}
|
|
|
+ </if>
|
|
|
+ <if test="beginTime != null and beginTime != ''">
|
|
|
+ and reception_time >= #{params.beginTime}
|
|
|
+ </if>
|
|
|
+ <if test="endTime != null and endTime != ''">
|
|
|
+ and reception_time <= #{params.endTime}
|
|
|
+ </if>
|
|
|
+ <if test="doctorId != null">
|
|
|
+ and doctor_id = #{doctorId}
|
|
|
+ </if>
|
|
|
+ order by reception_time desc
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectFsDoctorPatientById" parameterType="Long" resultMap="FsDoctorPatientResult">
|
|
|
+ <include refid="selectFsDoctorPatientVo"/>
|
|
|
+ where id = #{id} and del_flag = '0'
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertFsDoctorPatient" parameterType="com.fs.his.domain.FsDoctorPatient" useGeneratedKeys="true" keyProperty="id">
|
|
|
+ insert into fs_doctor_patient (
|
|
|
+ patient_name, sex, age, phone, reception_time, reception_doctor, city,
|
|
|
+ present_illness, past_history, allergy_history, diagnosis, syndrome_type,
|
|
|
+ syndrome_regulation, treatment_opinion, precautions, doctor_signature,
|
|
|
+ practice_certificate_no, doctor_id,
|
|
|
+ create_by, create_time, remark
|
|
|
+ ) values (
|
|
|
+ #{patientName}, #{sex}, #{age}, #{phone}, #{receptionTime}, #{receptionDoctor}, #{city},
|
|
|
+ #{presentIllness}, #{pastHistory}, #{allergyHistory}, #{diagnosis}, #{syndromeType},
|
|
|
+ #{syndromeRegulation}, #{treatmentOpinion}, #{precautions}, #{doctorSignature},
|
|
|
+ #{practiceCertificateNo}, #{doctorId},
|
|
|
+ #{createBy}, sysdate(), #{remark}
|
|
|
+ )
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateFsDoctorPatient" parameterType="com.fs.his.domain.FsDoctorPatient">
|
|
|
+ update fs_doctor_patient
|
|
|
+ <set>
|
|
|
+ <if test="patientName != null and patientName != ''">patient_name = #{patientName},</if>
|
|
|
+ <if test="sex != null">sex = #{sex},</if>
|
|
|
+ <if test="age != null">age = #{age},</if>
|
|
|
+ <if test="phone != null">phone = #{phone},</if>
|
|
|
+ <if test="receptionTime != null">reception_time = #{receptionTime},</if>
|
|
|
+ <if test="receptionDoctor != null">reception_doctor = #{receptionDoctor},</if>
|
|
|
+ <if test="city != null">city = #{city},</if>
|
|
|
+ <if test="presentIllness != null">present_illness = #{presentIllness},</if>
|
|
|
+ <if test="pastHistory != null">past_history = #{pastHistory},</if>
|
|
|
+ <if test="allergyHistory != null">allergy_history = #{allergyHistory},</if>
|
|
|
+ <if test="diagnosis != null">diagnosis = #{diagnosis},</if>
|
|
|
+ <if test="syndromeType != null">syndrome_type = #{syndromeType},</if>
|
|
|
+ <if test="syndromeRegulation != null">syndrome_regulation = #{syndromeRegulation},</if>
|
|
|
+ <if test="treatmentOpinion != null">treatment_opinion = #{treatmentOpinion},</if>
|
|
|
+ <if test="precautions != null">precautions = #{precautions},</if>
|
|
|
+ <if test="doctorSignature != null">doctor_signature = #{doctorSignature},</if>
|
|
|
+ <if test="practiceCertificateNo != null">practice_certificate_no = #{practiceCertificateNo},</if>
|
|
|
+ <if test="remark != null">remark = #{remark},</if>
|
|
|
+ <if test="updateBy != null">update_by = #{updateBy},</if>
|
|
|
+ <if test="doctorId != null">doctor_id = #{doctorId},</if>
|
|
|
+ update_time = sysdate()
|
|
|
+ </set>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <update id="deleteFsDoctorPatientById" parameterType="Long">
|
|
|
+ update fs_doctor_patient set del_flag = '2' where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <update id="deleteFsDoctorPatientByIds" parameterType="String">
|
|
|
+ update fs_doctor_patient set del_flag = '2' where id in
|
|
|
+ <foreach collection="array" item="id" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </update>
|
|
|
+
|
|
|
+</mapper>
|