|
@@ -0,0 +1,138 @@
|
|
|
+<?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.FsFirstDiagnosisMapper">
|
|
|
+
|
|
|
+ <resultMap type="FsFirstDiagnosis" id="FsFirstDiagnosisResult">
|
|
|
+ <result property="id" column="id" />
|
|
|
+ <result property="patientName" column="patient_name" />
|
|
|
+ <result property="age" column="age" />
|
|
|
+ <result property="gender" column="gender" />
|
|
|
+ <result property="phone" column="phone" />
|
|
|
+ <result property="physicalCondition" column="physical_condition" />
|
|
|
+ <result property="dateTime" column="date_time" />
|
|
|
+ <result property="firstDiagnosis" column="first_diagnosis" />
|
|
|
+ <result property="doctorId" column="doctor_id" />
|
|
|
+ <result property="doctorName" column="doctor_name" />
|
|
|
+ <result property="doctorDep" column="doctor_dep" />
|
|
|
+ <result property="createTime" column="create_time" />
|
|
|
+ <result property="updateTime" column="update_time" />
|
|
|
+ <result property="userId" column="user_id" />
|
|
|
+ <result property="doctorCertificate" column="doctor_certificate" />
|
|
|
+ <result property="doctorStatus" column="doctor_status" />
|
|
|
+ <result property="userStatus" column="user_status" />
|
|
|
+ <result property="qwUserId" column="qw_user_id" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectFsFirstDiagnosisVo">
|
|
|
+ select id, patient_name, age, gender, phone, physical_condition, date_time, first_diagnosis, doctor_id, doctor_name, doctor_dep, create_time, update_time, user_id, doctor_certificate,qw_user_id,doctor_status,user_status from fs_first_diagnosis
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectFsFirstDiagnosisList" parameterType="FsFirstDiagnosis" resultMap="FsFirstDiagnosisResult">
|
|
|
+ <include refid="selectFsFirstDiagnosisVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="patientName != null and patientName != ''"> and patient_name like concat('%', #{patientName}, '%')</if>
|
|
|
+ <if test="age != null and age != ''"> and age = #{age}</if>
|
|
|
+ <if test="gender != null "> and gender = #{gender}</if>
|
|
|
+ <if test="phone != null and phone != ''"> and phone = #{phone}</if>
|
|
|
+ <if test="physicalCondition != null and physicalCondition != ''"> and physical_condition = #{physicalCondition}</if>
|
|
|
+ <if test="dateTime != null "> and date_time = #{dateTime}</if>
|
|
|
+ <if test="firstDiagnosis != null and firstDiagnosis != ''"> and first_diagnosis = #{firstDiagnosis}</if>
|
|
|
+ <if test="doctorId != null "> and doctor_id = #{doctorId}</if>
|
|
|
+ <if test="doctorName != null and doctorName != ''"> and doctor_name like concat('%', #{doctorName}, '%')</if>
|
|
|
+ <if test="doctorDep != null and doctorDep != ''"> and doctor_dep = #{doctorDep}</if>
|
|
|
+ <if test="userId != null "> and user_id = #{userId}</if>
|
|
|
+ <if test="doctorCertificate != null and doctorCertificate != ''"> and doctor_certificate = #{doctorCertificate}</if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectFsFirstDiagnosisById" parameterType="Long" resultMap="FsFirstDiagnosisResult">
|
|
|
+ <include refid="selectFsFirstDiagnosisVo"/>
|
|
|
+ where id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertFsFirstDiagnosis" parameterType="FsFirstDiagnosis">
|
|
|
+ insert into fs_first_diagnosis
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="id != null">id,</if>
|
|
|
+ <if test="patientName != null">patient_name,</if>
|
|
|
+ <if test="age != null">age,</if>
|
|
|
+ <if test="gender != null">gender,</if>
|
|
|
+ <if test="phone != null">phone,</if>
|
|
|
+ <if test="physicalCondition != null">physical_condition,</if>
|
|
|
+ <if test="dateTime != null">date_time,</if>
|
|
|
+ <if test="firstDiagnosis != null">first_diagnosis,</if>
|
|
|
+ <if test="doctorId != null">doctor_id,</if>
|
|
|
+ <if test="doctorName != null">doctor_name,</if>
|
|
|
+ <if test="doctorDep != null">doctor_dep,</if>
|
|
|
+ <if test="createTime != null">create_time,</if>
|
|
|
+ <if test="updateTime != null">update_time,</if>
|
|
|
+ <if test="userId != null">user_id,</if>
|
|
|
+ <if test="doctorCertificate != null">doctor_certificate,</if>
|
|
|
+ <if test="qwUserId != null">qw_user_id,</if>
|
|
|
+ <if test="doctorStatus != null">doctor_status,</if>
|
|
|
+ <if test="userStatus != null">user_status,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="id != null">#{id},</if>
|
|
|
+ <if test="patientName != null">#{patientName},</if>
|
|
|
+ <if test="age != null">#{age},</if>
|
|
|
+ <if test="gender != null">#{gender},</if>
|
|
|
+ <if test="phone != null">#{phone},</if>
|
|
|
+ <if test="physicalCondition != null">#{physicalCondition},</if>
|
|
|
+ <if test="dateTime != null">#{dateTime},</if>
|
|
|
+ <if test="firstDiagnosis != null">#{firstDiagnosis},</if>
|
|
|
+ <if test="doctorId != null">#{doctorId},</if>
|
|
|
+ <if test="doctorName != null">#{doctorName},</if>
|
|
|
+ <if test="doctorDep != null">#{doctorDep},</if>
|
|
|
+ <if test="createTime != null">#{createTime},</if>
|
|
|
+ <if test="updateTime != null">#{updateTime},</if>
|
|
|
+ <if test="userId != null">#{userId},</if>
|
|
|
+ <if test="doctorCertificate != null">#{doctorCertificate},</if>
|
|
|
+ <if test="qwUserId != null">#{qwUserId},</if>
|
|
|
+ <if test="doctorStatus != null">#{doctorStatus},</if>
|
|
|
+ <if test="userStatus != null">#{userStatus},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateFsFirstDiagnosis" parameterType="FsFirstDiagnosis">
|
|
|
+ update fs_first_diagnosis
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="patientName != null">patient_name = #{patientName},</if>
|
|
|
+ <if test="age != null">age = #{age},</if>
|
|
|
+ <if test="gender != null">gender = #{gender},</if>
|
|
|
+ <if test="phone != null">phone = #{phone},</if>
|
|
|
+ <if test="physicalCondition != null">physical_condition = #{physicalCondition},</if>
|
|
|
+ <if test="dateTime != null">date_time = #{dateTime},</if>
|
|
|
+ <if test="firstDiagnosis != null">first_diagnosis = #{firstDiagnosis},</if>
|
|
|
+ <if test="doctorId != null">doctor_id = #{doctorId},</if>
|
|
|
+ <if test="doctorName != null">doctor_name = #{doctorName},</if>
|
|
|
+ <if test="doctorDep != null">doctor_dep = #{doctorDep},</if>
|
|
|
+ <if test="createTime != null">create_time = #{createTime},</if>
|
|
|
+ <if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
+ <if test="userId != null">user_id = #{userId},</if>
|
|
|
+ <if test="doctorCertificate != null">doctor_certificate = #{doctorCertificate},</if>
|
|
|
+ <if test="qwUserId != null">qw_user_id = #{qwUserId},</if>
|
|
|
+ <if test="doctorStatus != null">doctor_status = #{doctorStatus},</if>
|
|
|
+ <if test="userStatus != null">user_status = #{userStatus},</if>
|
|
|
+ </trim>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteFsFirstDiagnosisById" parameterType="Long">
|
|
|
+ delete from fs_first_diagnosis where id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteFsFirstDiagnosisByIds" parameterType="String">
|
|
|
+ delete from fs_first_diagnosis where id in
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <select id="getByUserId" parameterType="Long" resultMap="FsFirstDiagnosisResult">
|
|
|
+ <include refid="selectFsFirstDiagnosisVo"/>
|
|
|
+ where user_id = #{userId}
|
|
|
+ </select>
|
|
|
+</mapper>
|