|
@@ -0,0 +1,134 @@
|
|
|
|
|
+<?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.patient.mapper.FsPatientBaseInfoMapper">
|
|
|
|
|
+
|
|
|
|
|
+ <resultMap type="FsPatientBaseInfo" id="FsPatientBaseInfoResult">
|
|
|
|
|
+ <result property="id" column="id" />
|
|
|
|
|
+ <result property="name" column="name" />
|
|
|
|
|
+ <result property="sex" column="sex" />
|
|
|
|
|
+ <result property="age" column="age" />
|
|
|
|
|
+ <result property="baseInfo" column="base_info" />
|
|
|
|
|
+ <result property="diagnosisResult" column="diagnosis_result" />
|
|
|
|
|
+ <result property="treatmentTarget" column="treatment_target" />
|
|
|
|
|
+ <result property="doctorId" column="doctor_id" />
|
|
|
|
|
+ <result property="projectId" column="project_id" />
|
|
|
|
|
+ <result property="createTime" column="create_time" />
|
|
|
|
|
+ <result property="updateTime" column="update_time" />
|
|
|
|
|
+ <result property="userId" column="user_id" />
|
|
|
|
|
+ <result property="status" column="status" />
|
|
|
|
|
+ <result property="doctorStatus" column="doctor_status" />
|
|
|
|
|
+ <result property="companyUserId" column="company_user_id" />
|
|
|
|
|
+ <result property="diagnosisTime" column="diagnosis_time" />
|
|
|
|
|
+ </resultMap>
|
|
|
|
|
+
|
|
|
|
|
+ <sql id="selectFsPatientBaseInfoVo">
|
|
|
|
|
+ select id, name, sex, age, base_info, diagnosis_result, treatment_target, doctor_id, project_id, create_time, update_time, user_id, status, doctor_status,company_user_id,diagnosis_time from fs_patient_base_info
|
|
|
|
|
+ </sql>
|
|
|
|
|
+
|
|
|
|
|
+ <select id="selectFsPatientBaseInfoList" parameterType="FsPatientBaseInfo" resultMap="FsPatientBaseInfoResult">
|
|
|
|
|
+ <include refid="selectFsPatientBaseInfoVo"/>
|
|
|
|
|
+ <where>
|
|
|
|
|
+ <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
|
|
|
|
+ <if test="sex != null "> and sex = #{sex}</if>
|
|
|
|
|
+ <if test="age != null "> and age = #{age}</if>
|
|
|
|
|
+ <if test="baseInfo != null and baseInfo != ''"> and base_info = #{baseInfo}</if>
|
|
|
|
|
+ <if test="diagnosisResult != null and diagnosisResult != ''"> and diagnosis_result = #{diagnosisResult}</if>
|
|
|
|
|
+ <if test="doctorId != null "> and doctor_id = #{doctorId}</if>
|
|
|
|
|
+ <if test="projectId != null "> and project_id = #{projectId}</if>
|
|
|
|
|
+ <if test="userId != null "> and user_id = #{userId}</if>
|
|
|
|
|
+ <if test="status != null "> and status = #{status}</if>
|
|
|
|
|
+ <if test="doctorStatus != null "> and doctor_status = #{doctorStatus}</if>
|
|
|
|
|
+ <if test="companyUserId != null "> and company_user_id = #{companyUserId}</if>
|
|
|
|
|
+ </where>
|
|
|
|
|
+ ORDER BY create_time DESC
|
|
|
|
|
+ </select>
|
|
|
|
|
+
|
|
|
|
|
+ <select id="selectFsPatientBaseInfoById" parameterType="Long" resultMap="FsPatientBaseInfoResult">
|
|
|
|
|
+ <include refid="selectFsPatientBaseInfoVo"/>
|
|
|
|
|
+ where id = #{id}
|
|
|
|
|
+ </select>
|
|
|
|
|
+
|
|
|
|
|
+ <insert id="insertFsPatientBaseInfo" parameterType="FsPatientBaseInfo" useGeneratedKeys="true" keyProperty="id">
|
|
|
|
|
+ insert into fs_patient_base_info
|
|
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
|
+ <if test="name != null">name,</if>
|
|
|
|
|
+ <if test="sex != null">sex,</if>
|
|
|
|
|
+ <if test="age != null">age,</if>
|
|
|
|
|
+ <if test="baseInfo != null">base_info,</if>
|
|
|
|
|
+ <if test="diagnosisResult != null">diagnosis_result,</if>
|
|
|
|
|
+ <if test="treatmentTarget != null">treatment_target,</if>
|
|
|
|
|
+ <if test="doctorId != null">doctor_id,</if>
|
|
|
|
|
+ <if test="projectId != null">project_id,</if>
|
|
|
|
|
+ <if test="createTime != null">create_time,</if>
|
|
|
|
|
+ <if test="updateTime != null">update_time,</if>
|
|
|
|
|
+ <if test="userId != null">user_id,</if>
|
|
|
|
|
+ <if test="status != null">status,</if>
|
|
|
|
|
+ <if test="doctorStatus != null">doctor_status,</if>
|
|
|
|
|
+ <if test="companyUserId != null">company_user_id,</if>
|
|
|
|
|
+ <if test="diagnosisTime != null">diagnosis_time,</if>
|
|
|
|
|
+ </trim>
|
|
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
|
+ <if test="name != null">#{name},</if>
|
|
|
|
|
+ <if test="sex != null">#{sex},</if>
|
|
|
|
|
+ <if test="age != null">#{age},</if>
|
|
|
|
|
+ <if test="baseInfo != null">#{baseInfo},</if>
|
|
|
|
|
+ <if test="diagnosisResult != null">#{diagnosisResult},</if>
|
|
|
|
|
+ <if test="treatmentTarget != null">#{treatmentTarget},</if>
|
|
|
|
|
+ <if test="doctorId != null">#{doctorId},</if>
|
|
|
|
|
+ <if test="projectId != null">#{projectId},</if>
|
|
|
|
|
+ <if test="createTime != null">#{createTime},</if>
|
|
|
|
|
+ <if test="updateTime != null">#{updateTime},</if>
|
|
|
|
|
+ <if test="userId != null">#{userId},</if>
|
|
|
|
|
+ <if test="status != null">#{status},</if>
|
|
|
|
|
+ <if test="doctorStatus != null">#{doctorStatus},</if>
|
|
|
|
|
+ <if test="companyUserId != null">#{companyUserId},</if>
|
|
|
|
|
+ <if test="diagnosisTime != null">#{diagnosisTime},</if>
|
|
|
|
|
+ </trim>
|
|
|
|
|
+ </insert>
|
|
|
|
|
+
|
|
|
|
|
+ <update id="updateFsPatientBaseInfo" parameterType="FsPatientBaseInfo">
|
|
|
|
|
+ update fs_patient_base_info
|
|
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
|
|
+ <if test="name != null">name = #{name},</if>
|
|
|
|
|
+ <if test="sex != null">sex = #{sex},</if>
|
|
|
|
|
+ <if test="age != null">age = #{age},</if>
|
|
|
|
|
+ <if test="baseInfo != null">base_info = #{baseInfo},</if>
|
|
|
|
|
+ <if test="diagnosisResult != null">diagnosis_result = #{diagnosisResult},</if>
|
|
|
|
|
+ <if test="treatmentTarget != null">treatment_target = #{treatmentTarget},</if>
|
|
|
|
|
+ <if test="doctorId != null">doctor_id = #{doctorId},</if>
|
|
|
|
|
+ <if test="projectId != null">project_id = #{projectId},</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="status != null">status = #{status},</if>
|
|
|
|
|
+ <if test="doctorStatus != null">doctor_status = #{doctorStatus},</if>
|
|
|
|
|
+ <if test="companyUserId != null">company_user_id = #{companyUserId},</if>
|
|
|
|
|
+ <if test="diagnosisTime != null">diagnosis_time = #{diagnosisTime},</if>
|
|
|
|
|
+ </trim>
|
|
|
|
|
+ where id = #{id}
|
|
|
|
|
+ </update>
|
|
|
|
|
+
|
|
|
|
|
+ <delete id="deleteFsPatientBaseInfoById" parameterType="Long">
|
|
|
|
|
+ delete from fs_patient_base_info where id = #{id}
|
|
|
|
|
+ </delete>
|
|
|
|
|
+
|
|
|
|
|
+ <delete id="deleteFsPatientBaseInfoByIds" parameterType="String">
|
|
|
|
|
+ delete from fs_patient_base_info where id in
|
|
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
|
|
+ #{id}
|
|
|
|
|
+ </foreach>
|
|
|
|
|
+ </delete>
|
|
|
|
|
+
|
|
|
|
|
+ <select id="selectFsPatientBaseInfoListDVO" parameterType="com.fs.his.param.FsPatientBaseInfoListDParam" resultType="com.fs.his.vo.FsPatientBaseInfoListDVO">
|
|
|
|
|
+ <include refid="selectFsPatientBaseInfoVo"/>
|
|
|
|
|
+ <where>
|
|
|
|
|
+ <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
|
|
|
|
+ <if test="doctorId != null "> and doctor_id = #{doctorId}</if>
|
|
|
|
|
+ <if test="projectId != null "> and project_id = #{projectId}</if>
|
|
|
|
|
+ <if test="doctorStatus != null "> and doctor_status = #{doctorStatus}</if>
|
|
|
|
|
+ </where>
|
|
|
|
|
+ ORDER BY doctor_status ASC
|
|
|
|
|
+ </select>
|
|
|
|
|
+</mapper>
|