<?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.smartor.mapper.MedicalHistoryBabyMapper">
|
|
<resultMap type="com.smartor.domain.MedicalHistoryBaby" id="MedicalHistoryBabyResult">
|
<result property="id" column="id"/>
|
<result property="procreate" column="procreate"/>
|
<result property="gestationIllnesses" column="gestation_illnesses"/>
|
<result property="familyHistory" column="family_history"/>
|
<result property="surgicalHistory" column="surgical_history"/>
|
<result property="birthAge" column="birth_age"/>
|
<result property="birthWeight" column="birth_weight"/>
|
<result property="outCorrectAge" column="out_correct_age"/>
|
<result property="outWeight" column="out_weight"/>
|
<result property="allergy" column="allergy"/>
|
<result property="feed" column="feed"/>
|
<result property="patid" column="patid"/>
|
</resultMap>
|
|
<sql id="selectMedicalHistoryBabyVo">
|
select id, procreate, gestation_illnesses, family_history, surgical_history, birth_age, birth_weight, out_correct_age, out_weight, allergy, feed, patid
|
from medical_history_baby
|
</sql>
|
|
<select id="selectMedicalHistoryBabyList" parameterType="com.smartor.domain.MedicalHistoryBaby"
|
resultMap="MedicalHistoryBabyResult">
|
<include refid="selectMedicalHistoryBabyVo"/>
|
<where>
|
del_flag=0
|
<if test="procreate != null and procreate != ''">
|
and procreate = #{procreate}
|
</if>
|
<if test="gestationIllnesses != null and gestationIllnesses != ''">
|
and gestation_illnesses = #{gestationIllnesses}
|
</if>
|
<if test="familyHistory != null and familyHistory != ''">
|
and family_history = #{familyHistory}
|
</if>
|
<if test="surgicalHistory != null and surgicalHistory != ''">
|
and surgical_history = #{surgicalHistory}
|
</if>
|
<if test="birthAge != null and birthAge != ''">
|
and birth_age = #{birthAge}
|
</if>
|
<if test="birthWeight != null and birthWeight != ''">
|
and birth_weight = #{birthWeight}
|
</if>
|
<if test="outCorrectAge != null and outCorrectAge != ''">
|
and out_correct_age = #{outCorrectAge}
|
</if>
|
<if test="outWeight != null and outWeight != ''">
|
and out_weight = #{outWeight}
|
</if>
|
<if test="allergy != null and allergy != ''">
|
and allergy = #{allergy}
|
</if>
|
<if test="feed != null and feed != ''">
|
and feed = #{feed}
|
</if>
|
<if test="patid != null ">
|
and patid = #{patid}
|
</if>
|
</where>
|
</select>
|
|
<select id="selectMedicalHistoryBabyById" parameterType="Long"
|
resultMap="MedicalHistoryBabyResult">
|
<include refid="selectMedicalHistoryBabyVo"/>
|
where id = #{id}
|
</select>
|
|
<insert id="insertMedicalHistoryBaby" parameterType="com.smartor.domain.MedicalHistoryBaby" useGeneratedKeys="true" keyProperty="id">
|
insert into medical_history_baby
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="procreate != null">procreate,
|
</if>
|
<if test="gestationIllnesses != null">gestation_illnesses,
|
</if>
|
<if test="familyHistory != null">family_history,
|
</if>
|
<if test="surgicalHistory != null">surgical_history,
|
</if>
|
<if test="birthAge != null">birth_age,
|
</if>
|
<if test="birthWeight != null">birth_weight,
|
</if>
|
<if test="outCorrectAge != null">out_correct_age,
|
</if>
|
<if test="outWeight != null">out_weight,
|
</if>
|
<if test="allergy != null">allergy,
|
</if>
|
<if test="feed != null">feed,
|
</if>
|
<if test="patid != null">patid,
|
</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="procreate != null">#{procreate},
|
</if>
|
<if test="gestationIllnesses != null">#{gestationIllnesses},
|
</if>
|
<if test="familyHistory != null">#{familyHistory},
|
</if>
|
<if test="surgicalHistory != null">#{surgicalHistory},
|
</if>
|
<if test="birthAge != null">#{birthAge},
|
</if>
|
<if test="birthWeight != null">#{birthWeight},
|
</if>
|
<if test="outCorrectAge != null">#{outCorrectAge},
|
</if>
|
<if test="outWeight != null">#{outWeight},
|
</if>
|
<if test="allergy != null">#{allergy},
|
</if>
|
<if test="feed != null">#{feed},
|
</if>
|
<if test="patid != null">#{patid},
|
</if>
|
</trim>
|
</insert>
|
|
<update id="updateMedicalHistoryBaby" parameterType="com.smartor.domain.MedicalHistoryBaby">
|
update medical_history_baby
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="procreate != null">procreate =
|
#{procreate},
|
</if>
|
<if test="gestationIllnesses != null">gestation_illnesses =
|
#{gestationIllnesses},
|
</if>
|
<if test="familyHistory != null">family_history =
|
#{familyHistory},
|
</if>
|
<if test="surgicalHistory != null">surgical_history =
|
#{surgicalHistory},
|
</if>
|
<if test="birthAge != null">birth_age =
|
#{birthAge},
|
</if>
|
<if test="birthWeight != null">birth_weight =
|
#{birthWeight},
|
</if>
|
<if test="outCorrectAge != null">out_correct_age =
|
#{outCorrectAge},
|
</if>
|
<if test="outWeight != null">out_weight =
|
#{outWeight},
|
</if>
|
<if test="allergy != null">allergy =
|
#{allergy},
|
</if>
|
<if test="feed != null">feed =
|
#{feed},
|
</if>
|
<if test="patid != null">patid =
|
#{patid},
|
</if>
|
</trim>
|
where id = #{id}
|
</update>
|
|
<update id="deleteMedicalHistoryBabyById" parameterType="Long">
|
update medical_history_baby
|
<trim prefix="SET" suffixOverrides=",">
|
del_flag =1
|
</trim>
|
where id = #{id}
|
</update>
|
|
<update id="deleteMedicalHistoryBabyByIds" parameterType="String">
|
update medical_history_baby
|
<trim prefix="SET" suffixOverrides=",">
|
del_flag =1
|
</trim>
|
where id in
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
</update>
|
|
|
|
|
</mapper>
|