|
|
@@ -0,0 +1,135 @@
|
|
|
+<?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.FsFourDiagnosisRecordMapper">
|
|
|
+
|
|
|
+ <resultMap type="FsFourDiagnosisRecord" id="FsFourDiagnosisRecordResult">
|
|
|
+ <id property="id" column="id" />
|
|
|
+ <result property="reportNo" column="report_no" />
|
|
|
+ <result property="userName" column="user_name" />
|
|
|
+ <result property="mobile" column="mobile" />
|
|
|
+ <result property="gender" column="gender" />
|
|
|
+ <result property="birthday" column="birthday" />
|
|
|
+ <result property="height" column="height" />
|
|
|
+ <result property="weight" column="weight" />
|
|
|
+ <result property="occupation" column="occupation" />
|
|
|
+ <result property="medicalHistory" column="medical_history" />
|
|
|
+ <result property="symptomType" column="symptom_type" />
|
|
|
+ <result property="tizhiName" column="tizhi_name" />
|
|
|
+ <result property="origin" column="origin" />
|
|
|
+ <result property="reportPdfUrl" column="report_pdf_url" />
|
|
|
+ <result property="detectTime" column="detect_time" />
|
|
|
+ <result property="createTime" column="create_time" />
|
|
|
+ <result property="updateTime" column="update_time" />
|
|
|
+ <result property="isDel" column="is_del" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectFsFourDiagnosisRecordVo">
|
|
|
+ select id, report_no, user_name, mobile, gender, birthday, age, height, weight,
|
|
|
+ occupation, medical_history, symptom_type, tizhi_name, origin,
|
|
|
+ report_pdf_url, detect_time,
|
|
|
+ create_time, update_time, is_del
|
|
|
+ from fs_four_diagnosis_record
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectFsFourDiagnosisRecordById" parameterType="Long" resultMap="FsFourDiagnosisRecordResult">
|
|
|
+ <include refid="selectFsFourDiagnosisRecordVo"/>
|
|
|
+ where id = #{id} and is_del = 0
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectByReportNo" parameterType="String" resultMap="FsFourDiagnosisRecordResult">
|
|
|
+ <include refid="selectFsFourDiagnosisRecordVo"/>
|
|
|
+ where report_no = #{reportNo} and is_del = 0
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectFsFourDiagnosisRecordList" parameterType="FsFourDiagnosisRecord" resultMap="FsFourDiagnosisRecordResult">
|
|
|
+ <include refid="selectFsFourDiagnosisRecordVo"/>
|
|
|
+ <where>
|
|
|
+ and is_del = 0
|
|
|
+ <if test="reportNo != null and reportNo != ''">and report_no = #{reportNo}</if>
|
|
|
+ <if test="userName != null and userName != ''">and user_name like concat('%', #{userName}, '%')</if>
|
|
|
+ <if test="mobile != null and mobile != ''">and mobile = #{mobile}</if>
|
|
|
+ <if test="gender != null">and gender = #{gender}</if>
|
|
|
+ <if test="symptomType != null and symptomType != ''">and symptom_type = #{symptomType}</if>
|
|
|
+ <if test="tizhiName != null and tizhiName != ''">and tizhi_name = #{tizhiName}</if>
|
|
|
+ <if test="params.beginDetectTime != null and params.beginDetectTime != ''">
|
|
|
+ and detect_time >= #{params.beginDetectTime}
|
|
|
+ </if>
|
|
|
+ <if test="params.endDetectTime != null and params.endDetectTime != ''">
|
|
|
+ and detect_time <= #{params.endDetectTime}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ order by detect_time desc
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertFsFourDiagnosisRecord" parameterType="FsFourDiagnosisRecord" useGeneratedKeys="true" keyProperty="id">
|
|
|
+ insert into fs_four_diagnosis_record
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="reportNo != null">report_no,</if>
|
|
|
+ <if test="userName != null">user_name,</if>
|
|
|
+ <if test="mobile != null">mobile,</if>
|
|
|
+ <if test="gender != null">gender,</if>
|
|
|
+ <if test="birthday != null">birthday,</if>
|
|
|
+ <if test="age != null">age,</if>
|
|
|
+ <if test="height != null">height,</if>
|
|
|
+ <if test="weight != null">weight,</if>
|
|
|
+ <if test="occupation != null">occupation,</if>
|
|
|
+ <if test="medicalHistory != null">medical_history,</if>
|
|
|
+ <if test="symptomType != null">symptom_type,</if>
|
|
|
+ <if test="tizhiName != null">tizhi_name,</if>
|
|
|
+ <if test="origin != null">origin,</if>
|
|
|
+ <if test="reportPdfUrl != null">report_pdf_url,</if>
|
|
|
+ <if test="detectTime != null">detect_time,</if>
|
|
|
+ create_time
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="reportNo != null">#{reportNo},</if>
|
|
|
+ <if test="userName != null">#{userName},</if>
|
|
|
+ <if test="mobile != null">#{mobile},</if>
|
|
|
+ <if test="gender != null">#{gender},</if>
|
|
|
+ <if test="birthday != null">#{birthday},</if>
|
|
|
+ <if test="age != null">#{age},</if>
|
|
|
+ <if test="height != null">#{height},</if>
|
|
|
+ <if test="weight != null">#{weight},</if>
|
|
|
+ <if test="occupation != null">#{occupation},</if>
|
|
|
+ <if test="medicalHistory != null">#{medicalHistory},</if>
|
|
|
+ <if test="symptomType != null">#{symptomType},</if>
|
|
|
+ <if test="tizhiName != null">#{tizhiName},</if>
|
|
|
+ <if test="origin != null">#{origin},</if>
|
|
|
+ <if test="reportPdfUrl != null">#{reportPdfUrl},</if>
|
|
|
+ <if test="detectTime != null">#{detectTime},</if>
|
|
|
+ now()
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateFsFourDiagnosisRecord" parameterType="FsFourDiagnosisRecord">
|
|
|
+ update fs_four_diagnosis_record
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="userName != null">user_name = #{userName},</if>
|
|
|
+ <if test="mobile != null">mobile = #{mobile},</if>
|
|
|
+ <if test="gender != null">gender = #{gender},</if>
|
|
|
+ <if test="birthday != null">birthday = #{birthday},</if>
|
|
|
+ <if test="age != null">age = #{age},</if>
|
|
|
+ <if test="height != null">height = #{height},</if>
|
|
|
+ <if test="weight != null">weight = #{weight},</if>
|
|
|
+ <if test="occupation != null">occupation = #{occupation},</if>
|
|
|
+ <if test="medicalHistory != null">medical_history = #{medicalHistory},</if>
|
|
|
+ <if test="symptomType != null">symptom_type = #{symptomType},</if>
|
|
|
+ <if test="tizhiName != null">tizhi_name = #{tizhiName},</if>
|
|
|
+ <if test="origin != null">origin = #{origin},</if>
|
|
|
+ <if test="reportPdfUrl != null">report_pdf_url = #{reportPdfUrl},</if>
|
|
|
+ <if test="detectTime != null">detect_time = #{detectTime},</if>
|
|
|
+ update_time = now()
|
|
|
+ </trim>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <update id="deleteFsFourDiagnosisRecordByIds">
|
|
|
+ update fs_four_diagnosis_record set is_del = 1 where id in
|
|
|
+ <foreach collection="array" item="id" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </update>
|
|
|
+
|
|
|
+</mapper>
|