|
@@ -0,0 +1,132 @@
|
|
|
|
+<?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.FsUserHealthProfileMapper">
|
|
|
|
+
|
|
|
|
+ <resultMap type="FsUserHealthProfile" id="FsUserHealthProfileResult">
|
|
|
|
+ <result property="userId" column="user_id" />
|
|
|
|
+ <result property="height" column="height" />
|
|
|
|
+ <result property="weight" column="weight" />
|
|
|
|
+ <result property="waistCircumference" column="waist_circumference" />
|
|
|
|
+ <result property="hipCircumference" column="hip_circumference" />
|
|
|
|
+ <result property="hyperglycemia" column="hyperglycemia" />
|
|
|
|
+ <result property="hyperglycemiaValue" column="hyperglycemia_value" />
|
|
|
|
+ <result property="hypertension" column="hypertension" />
|
|
|
|
+ <result property="systolicPressure" column="systolic_pressure" />
|
|
|
|
+ <result property="diastolicPressure" column="diastolic_pressure" />
|
|
|
|
+ <result property="hyperlipidemia" column="hyperlipidemia" />
|
|
|
|
+ <result property="hyperuricemia" column="hyperuricemia" />
|
|
|
|
+ <result property="hyperuricemiaValue" column="hyperuricemia_value" />
|
|
|
|
+ <result property="bodyWeightStatus" column="body_weight_status" />
|
|
|
|
+ <result property="otherMedicalHistory" column="other_medical_history" />
|
|
|
|
+ <result property="symptomHistory" column="symptom_history" />
|
|
|
|
+ <result property="createdTime" column="created_time" />
|
|
|
|
+ <result property="updatedTime" column="updated_time" />
|
|
|
|
+ </resultMap>
|
|
|
|
+
|
|
|
|
+ <sql id="selectFsUserHealthProfileVo">
|
|
|
|
+ select user_id, height, weight, waist_circumference, hip_circumference, hyperglycemia, hyperglycemia_value, hypertension, systolic_pressure, diastolic_pressure, hyperlipidemia, hyperuricemia, hyperuricemia_value, body_weight_status, other_medical_history, symptom_history, created_time, updated_time from fs_user_health_profile
|
|
|
|
+ </sql>
|
|
|
|
+
|
|
|
|
+ <select id="selectFsUserHealthProfileList" parameterType="FsUserHealthProfile" resultMap="FsUserHealthProfileResult">
|
|
|
|
+ <include refid="selectFsUserHealthProfileVo"/>
|
|
|
|
+ <where>
|
|
|
|
+ <if test="height != null "> and height = #{height}</if>
|
|
|
|
+ <if test="weight != null "> and weight = #{weight}</if>
|
|
|
|
+ <if test="waistCircumference != null "> and waist_circumference = #{waistCircumference}</if>
|
|
|
|
+ <if test="hipCircumference != null "> and hip_circumference = #{hipCircumference}</if>
|
|
|
|
+ <if test="hyperglycemia != null "> and hyperglycemia = #{hyperglycemia}</if>
|
|
|
|
+ <if test="hyperglycemiaValue != null "> and hyperglycemia_value = #{hyperglycemiaValue}</if>
|
|
|
|
+ <if test="hypertension != null "> and hypertension = #{hypertension}</if>
|
|
|
|
+ <if test="systolicPressure != null "> and systolic_pressure = #{systolicPressure}</if>
|
|
|
|
+ <if test="diastolicPressure != null "> and diastolic_pressure = #{diastolicPressure}</if>
|
|
|
|
+ <if test="hyperlipidemia != null "> and hyperlipidemia = #{hyperlipidemia}</if>
|
|
|
|
+ <if test="hyperuricemia != null "> and hyperuricemia = #{hyperuricemia}</if>
|
|
|
|
+ <if test="hyperuricemiaValue != null "> and hyperuricemia_value = #{hyperuricemiaValue}</if>
|
|
|
|
+ <if test="bodyWeightStatus != null "> and body_weight_status = #{bodyWeightStatus}</if>
|
|
|
|
+ <if test="otherMedicalHistory != null and otherMedicalHistory != ''"> and other_medical_history = #{otherMedicalHistory}</if>
|
|
|
|
+ <if test="symptomHistory != null and symptomHistory != ''"> and symptom_history = #{symptomHistory}</if>
|
|
|
|
+ <if test="createdTime != null "> and created_time = #{createdTime}</if>
|
|
|
|
+ <if test="updatedTime != null "> and updated_time = #{updatedTime}</if>
|
|
|
|
+ </where>
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <select id="selectFsUserHealthProfileByUserId" resultMap="FsUserHealthProfileResult">
|
|
|
|
+ <include refid="selectFsUserHealthProfileVo"/>
|
|
|
|
+ where user_id = #{userId}
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <insert id="insertFsUserHealthProfile" parameterType="FsUserHealthProfile">
|
|
|
|
+ insert into fs_user_health_profile
|
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
+ <if test="userId != null">user_id,</if>
|
|
|
|
+ <if test="height != null">height,</if>
|
|
|
|
+ <if test="weight != null">weight,</if>
|
|
|
|
+ <if test="waistCircumference != null">waist_circumference,</if>
|
|
|
|
+ <if test="hipCircumference != null">hip_circumference,</if>
|
|
|
|
+ <if test="hyperglycemia != null">hyperglycemia,</if>
|
|
|
|
+ <if test="hyperglycemiaValue != null">hyperglycemia_value,</if>
|
|
|
|
+ <if test="hypertension != null">hypertension,</if>
|
|
|
|
+ <if test="systolicPressure != null">systolic_pressure,</if>
|
|
|
|
+ <if test="diastolicPressure != null">diastolic_pressure,</if>
|
|
|
|
+ <if test="hyperlipidemia != null">hyperlipidemia,</if>
|
|
|
|
+ <if test="hyperuricemia != null">hyperuricemia,</if>
|
|
|
|
+ <if test="hyperuricemiaValue != null">hyperuricemia_value,</if>
|
|
|
|
+ <if test="bodyWeightStatus != null">body_weight_status,</if>
|
|
|
|
+ <if test="otherMedicalHistory != null">other_medical_history,</if>
|
|
|
|
+ <if test="symptomHistory != null">symptom_history,</if>
|
|
|
|
+ <if test="createdTime != null">created_time,</if>
|
|
|
|
+ <if test="updatedTime != null">updated_time,</if>
|
|
|
|
+ </trim>
|
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
+ <if test="userId != null">#{userId},</if>
|
|
|
|
+ <if test="height != null">#{height},</if>
|
|
|
|
+ <if test="weight != null">#{weight},</if>
|
|
|
|
+ <if test="waistCircumference != null">#{waistCircumference},</if>
|
|
|
|
+ <if test="hipCircumference != null">#{hipCircumference},</if>
|
|
|
|
+ <if test="hyperglycemia != null">#{hyperglycemia},</if>
|
|
|
|
+ <if test="hyperglycemiaValue != null">#{hyperglycemiaValue},</if>
|
|
|
|
+ <if test="hypertension != null">#{hypertension},</if>
|
|
|
|
+ <if test="systolicPressure != null">#{systolicPressure},</if>
|
|
|
|
+ <if test="diastolicPressure != null">#{diastolicPressure},</if>
|
|
|
|
+ <if test="hyperlipidemia != null">#{hyperlipidemia},</if>
|
|
|
|
+ <if test="hyperuricemia != null">#{hyperuricemia},</if>
|
|
|
|
+ <if test="hyperuricemiaValue != null">#{hyperuricemiaValue},</if>
|
|
|
|
+ <if test="bodyWeightStatus != null">#{bodyWeightStatus},</if>
|
|
|
|
+ <if test="otherMedicalHistory != null">#{otherMedicalHistory},</if>
|
|
|
|
+ <if test="symptomHistory != null">#{symptomHistory},</if>
|
|
|
|
+ <if test="createdTime != null">#{createdTime},</if>
|
|
|
|
+ <if test="updatedTime != null">#{updatedTime},</if>
|
|
|
|
+ </trim>
|
|
|
|
+ </insert>
|
|
|
|
+
|
|
|
|
+ <update id="updateFsUserHealthProfile" parameterType="FsUserHealthProfile">
|
|
|
|
+ update fs_user_health_profile
|
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
|
+ <if test="height != null">height = #{height},</if>
|
|
|
|
+ <if test="weight != null">weight = #{weight},</if>
|
|
|
|
+ <if test="waistCircumference != null">waist_circumference = #{waistCircumference},</if>
|
|
|
|
+ <if test="hipCircumference != null">hip_circumference = #{hipCircumference},</if>
|
|
|
|
+ <if test="hyperglycemia != null">hyperglycemia = #{hyperglycemia},</if>
|
|
|
|
+ <if test="hyperglycemiaValue != null">hyperglycemia_value = #{hyperglycemiaValue},</if>
|
|
|
|
+ <if test="hypertension != null">hypertension = #{hypertension},</if>
|
|
|
|
+ <if test="systolicPressure != null">systolic_pressure = #{systolicPressure},</if>
|
|
|
|
+ <if test="diastolicPressure != null">diastolic_pressure = #{diastolicPressure},</if>
|
|
|
|
+ <if test="hyperlipidemia != null">hyperlipidemia = #{hyperlipidemia},</if>
|
|
|
|
+ <if test="hyperuricemia != null">hyperuricemia = #{hyperuricemia},</if>
|
|
|
|
+ <if test="hyperuricemiaValue != null">hyperuricemia_value = #{hyperuricemiaValue},</if>
|
|
|
|
+ <if test="bodyWeightStatus != null">body_weight_status = #{bodyWeightStatus},</if>
|
|
|
|
+ <if test="otherMedicalHistory != null">other_medical_history = #{otherMedicalHistory},</if>
|
|
|
|
+ <if test="symptomHistory != null">symptom_history = #{symptomHistory},</if>
|
|
|
|
+ <if test="createdTime != null">created_time = #{createdTime},</if>
|
|
|
|
+ <if test="updatedTime != null">updated_time = #{updatedTime},</if>
|
|
|
|
+ </trim>
|
|
|
|
+ where user_id = #{userId}
|
|
|
|
+ </update>
|
|
|
|
+
|
|
|
|
+ <delete id="deleteFsUserHealthProfileByUserId">
|
|
|
|
+ delete from fs_user_health_profile where user_id = #{userId}
|
|
|
|
+ </delete>
|
|
|
|
+
|
|
|
|
+</mapper>
|