<?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.lyms.platform.permission.dao.master.BabyPatientExtendEarBirthMapper">
<resultMap id="BabyPatientExtendEarBirthResultMap"
type="com.lyms.platform.permission.model.BabyPatientExtendEarBirth">
<id column="id" property="id" jdbcType="VARCHAR"/>
<result column="fetu_number" property="fetuNumber" jdbcType="INTEGER"/>
<result column="product_number" property="productNumber" jdbcType="INTEGER"/>
<result column="birth_weight" property="birthWeight" jdbcType="DOUBLE"/>
<result column="tire_number" property="tireNumber" jdbcType="VARCHAR"/>
<result column="parturition_type" property="parturitionType" jdbcType="VARCHAR"/>
<result column="birth_defect_type" property="birthDefectType" jdbcType="INTEGER"/>
<result column="birth_defect_desc" property="birthDefectDesc" jdbcType="VARCHAR"/>
<result column="fetu_embarras_type" property="fetuEmbarrasType" jdbcType="INTEGER"/>
<result column="apgar_score_one" property="apgarScoreOne" jdbcType="DOUBLE"/>
<result column="apgar_score_five" property="apgarScoreFive" jdbcType="DOUBLE"/>
<result column="apgar_score_ten" property="apgarScoreTen" jdbcType="DOUBLE"/>
<result column="birth_injury_type" property="birthInjuryType" jdbcType="INTEGER"/>
<result column="birth_injury_position" property="birthInjuryPosition" jdbcType="VARCHAR"/>
<result column="amniotic_fluid_type" property="amnioticFluidType" jdbcType="INTEGER"/>
<result column="abnormal_parturition_type" property="abnormalParturitionType" jdbcType="INTEGER"/>
<result column="abnormal_parturition_position" property="abnormalParturitionPosition" jdbcType="VARCHAR"/>
<result column="deformity_type" property="deformityType" jdbcType="INTEGER"/>
<result column="deformity_position" property="deformityPosition" jdbcType="VARCHAR"/>
<result column="birth_infection_type" property="birthInfectionType" jdbcType="INTEGER"/>
<result column="birth_infection_cause" property="birthInfectionCause" jdbcType="VARCHAR"/>
<result column="birth_course_disease" property="birthCourseDisease" jdbcType="VARCHAR"/>
<result column="birth_ill_type" property="birthIllType" jdbcType="INTEGER"/>
<result column="birth_ill_cause" property="birthIllCause" jdbcType="VARCHAR"/>
<result column="birth_ill_disease" property="birthIllDisease" jdbcType="VARCHAR"/>
<result column="head_trauma_history" property="headTraumaHistory" jdbcType="INTEGER"/>
<result column="head_trauma_desc" property="headTraumaDesc" jdbcType="VARCHAR"/>
<result column="ear_poison_type" property="earPoisonType" jdbcType="INTEGER"/>
<result column="ear_poison_map" property="earPoisonMap" jdbcType="VARCHAR"/>
<result column="tympanitis_type" property="tympanitisType" jdbcType="INTEGER"/>
<result column="tympanitis_desc" property="tympanitisDesc" jdbcType="VARCHAR"/>
<result column="nicu_type" property="nicuType" jdbcType="INTEGER"/>
<result column="nicu_cause" property="nicuCause" jdbcType="VARCHAR"/>
<result column="nicu_continued_date" property="nicuContinuedDate" jdbcType="VARCHAR"/>
<result column="respirator_type" property="respiratorType" jdbcType="INTEGER"/>
<result column="respirator_continued_date" property="respiratorContinuedDate" jdbcType="VARCHAR"/>
<result column="respirator_continued_date_unit" property="respiratorContinuedDateUnit" jdbcType="VARCHAR"/>
<result column="outside_response" property="outsideResponse" jdbcType="INTEGER"/>
<result column="baby_patient_id" property="babyPatientId" jdbcType="VARCHAR"/>
<result column="baby_ear_id" property="babyEarId" jdbcType="VARCHAR" />
<result column="apgar_unknown" property="apgarUnknown" jdbcType="INTEGER" />
</resultMap>
<insert id="addBabyPatientExtendEarBirth"
parameterType="com.lyms.platform.permission.model.BabyPatientExtendEarBirth">
insert into baby_patient_extend_ear_birth (id,fetu_number,product_number,birth_weight,tire_number,parturition_type,birth_defect_type,birth_defect_desc,fetu_embarras_type,apgar_score_one,apgar_score_five,apgar_score_ten,birth_injury_type,birth_injury_position,amniotic_fluid_type,abnormal_parturition_type,abnormal_parturition_position,deformity_type,deformity_position,birth_infection_type,birth_infection_cause,birth_course_disease,birth_ill_type,birth_ill_cause,birth_ill_disease,head_trauma_history,head_trauma_desc,ear_poison_type,ear_poison_map,tympanitis_type,tympanitis_desc,nicu_type,nicu_cause,nicu_continued_date,respirator_type,respirator_continued_date,respirator_continued_date_unit,outside_response,baby_patient_id,baby_ear_id,apgar_unknown) values (#{id},#{fetuNumber},#{productNumber},#{birthWeight},#{tireNumber},#{parturitionType},#{birthDefectType},#{birthDefectDesc},#{fetuEmbarrasType},#{apgarScoreOne},#{apgarScoreFive},#{apgarScoreTen},#{birthInjuryType},#{birthInjuryPosition},#{amnioticFluidType},#{abnormalParturitionType},#{abnormalParturitionPosition},#{deformityType},#{deformityPosition},#{birthInfectionType},#{birthInfectionCause},#{birthCourseDisease},#{birthIllType},#{birthIllCause},#{birthIllDisease},#{headTraumaHistory},#{headTraumaDesc},#{earPoisonType},#{earPoisonMap},#{tympanitisType},#{tympanitisDesc},#{nicuType},#{nicuCause},#{nicuContinuedDate},#{respiratorType},#{respiratorContinuedDate},#{respiratorContinuedDateUnit},#{outsideResponse},#{babyPatientId},#{babyEarId},#{apgarUnknown})
</insert>
<update id="updateBabyPatientExtendEarBirth"
parameterType="com.lyms.platform.permission.model.BabyPatientExtendEarBirth">
update baby_patient_extend_ear_birth
<set>
<if test="fetuNumber != null">
fetu_number = #{fetuNumber,jdbcType=INTEGER},
</if>
<if test="productNumber != null">
product_number = #{productNumber,jdbcType=INTEGER},
</if>
<if test="birthWeight != null">
birth_weight = #{birthWeight,jdbcType=DOUBLE},
</if>
<if test="parturitionType != null and parturitionType != ''">
parturition_type = #{parturitionType,jdbcType=VARCHAR},
</if>
<if test="tireNumber != null and tireNumber != ''">
tire_number = #{tireNumber,jdbcType=VARCHAR},
</if>
<if test="birthDefectType != null">
birth_defect_type = #{birthDefectType,jdbcType=INTEGER},
</if>
<if test="birthDefectDesc != null and birthDefectDesc != ''">
birth_defect_desc = #{birthDefectDesc,jdbcType=VARCHAR},
</if>
<if test="fetuEmbarrasType != null">
fetu_embarras_type = #{fetuEmbarrasType,jdbcType=INTEGER},
</if>
<if test="apgarScoreOne != null">
apgar_score_one = #{apgarScoreOne,jdbcType=DOUBLE},
</if>
<if test="apgarScoreFive != null">
apgar_score_five = #{apgarScoreFive,jdbcType=DOUBLE},
</if>
<if test="apgarScoreTen != null">
apgar_score_ten = #{apgarScoreTen,jdbcType=DOUBLE},
</if>
<if test="birthInjuryType != null">
birth_injury_type = #{birthInjuryType,jdbcType=INTEGER},
</if>
<if test="birthInjuryPosition != null and birthInjuryPosition != ''">
birth_injury_position = #{birthInjuryPosition,jdbcType=VARCHAR},
</if>
<if test="amnioticFluidType != null">
amniotic_fluid_type = #{amnioticFluidType,jdbcType=INTEGER},
</if>
<if test="abnormalParturitionType != null">
abnormal_parturition_type = #{abnormalParturitionType,jdbcType=INTEGER},
</if>
<if test="abnormalParturitionPosition != null and abnormalParturitionPosition != ''">
abnormal_parturition_position = #{abnormalParturitionPosition,jdbcType=VARCHAR},
</if>
<if test="deformityType != null">
deformity_type = #{deformityType,jdbcType=INTEGER},
</if>
<if test="deformityPosition != null and deformityPosition != ''">
deformity_position = #{deformityPosition,jdbcType=VARCHAR},
</if>
<if test="birthInfectionType != null">
birth_infection_type = #{birthInfectionType,jdbcType=INTEGER},
</if>
<if test="birthInfectionCause != null and birthInfectionCause != ''">
birth_infection_cause = #{birthInfectionCause,jdbcType=VARCHAR},
</if>
<if test="birthCourseDisease != null and birthCourseDisease != ''">
birth_course_disease = #{birthCourseDisease,jdbcType=VARCHAR},
</if>
<if test="birthIllType != null">
birth_ill_type = #{birthIllType,jdbcType=INTEGER},
</if>
<if test="birthIllCause != null and birthIllCause != ''">
birth_ill_cause = #{birthIllCause,jdbcType=VARCHAR},
</if>
<if test="birthIllDisease != null and birthIllDisease != ''">
birth_ill_disease = #{birthIllDisease,jdbcType=VARCHAR},
</if>
<if test="headTraumaHistory != null">
head_trauma_history = #{headTraumaHistory,jdbcType=INTEGER},
</if>
<if test="headTraumaDesc != null and headTraumaDesc != ''">
head_trauma_desc = #{headTraumaDesc,jdbcType=VARCHAR},
</if>
<if test="earPoisonType != null">
ear_poison_type = #{earPoisonType,jdbcType=INTEGER},
</if>
<if test="earPoisonMap != null and earPoisonMap != ''">
ear_poison_map = #{earPoisonMap,jdbcType=VARCHAR},
</if>
<if test="tympanitisType != null">
tympanitis_type = #{tympanitisType,jdbcType=INTEGER},
</if>
<if test="tympanitisDesc != null and tympanitisDesc != ''">
tympanitis_desc = #{tympanitisDesc,jdbcType=VARCHAR},
</if>
<if test="nicuType != null">
nicu_type = #{nicuType,jdbcType=INTEGER},
</if>
<if test="nicuCause != null and nicuCause != ''">
nicu_cause = #{nicuCause,jdbcType=VARCHAR},
</if>
<if test="nicuContinuedDate != null and nicuContinuedDate != ''">
nicu_continued_date = #{nicuContinuedDate,jdbcType=VARCHAR},
</if>
<if test="respiratorType != null">
respirator_type = #{respiratorType,jdbcType=INTEGER},
</if>
<if test="respiratorContinuedDate != null and respiratorContinuedDate != ''">
respirator_continued_date = #{respiratorContinuedDate,jdbcType=VARCHAR},
</if>
<if test="respiratorContinuedDateUnit != null and respiratorContinuedDateUnit != ''">
respirator_continued_date_unit = #{respiratorContinuedDateUnit,jdbcType=VARCHAR},
</if>
<if test="outsideResponse != null">
outside_response = #{outsideResponse,jdbcType=INTEGER},
</if>
<if test="babyPatientId != null and babyPatientId != ''">
baby_patient_id = #{babyPatientId,jdbcType=VARCHAR},
</if>
<if test="babyEarId != null and babyEarId != ''">
baby_ear_id = #{babyEarId,jdbcType=VARCHAR},
</if>
<if test="apgarUnknown != null">
apgar_unknown = #{apgarUnknown,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>
<delete id="deleteBabyPatientExtendEarBirth" parameterType="java.lang.String">
delete from baby_patient_extend_ear_birth where id = #{id,jdbcType=VARCHAR}
</delete>
<select id="getBabyPatientExtendEarBirth" resultMap="BabyPatientExtendEarBirthResultMap"
parameterType="java.lang.String">
select id,fetu_number,product_number,birth_weight,tire_number,parturition_type,birth_defect_type,birth_defect_desc,fetu_embarras_type,apgar_score_one,apgar_score_five,apgar_score_ten,birth_injury_type,birth_injury_position,amniotic_fluid_type,abnormal_parturition_type,abnormal_parturition_position,deformity_type,deformity_position,birth_infection_type,birth_infection_cause,birth_course_disease,birth_ill_type,birth_ill_cause,birth_ill_disease,head_trauma_history,head_trauma_desc,ear_poison_type,ear_poison_map,tympanitis_type,tympanitis_desc,nicu_type,nicu_cause,nicu_continued_date,respirator_type,respirator_continued_date,respirator_continued_date_unit,outside_response,baby_patient_id,baby_ear_id,apgar_unknown
from baby_patient_extend_ear_birth where id = #{id,jdbcType=VARCHAR}
</select>
<sql id="orderAndLimit">
<if test="sort != null and sort != '' ">
order by ${sort}
<if test="need != null">
limit #{offset, jdbcType=INTEGER} , #{limit, jdbcType=INTEGER}
</if>
</if>
</sql>
<sql id="BabyPatientExtendEarBirthCondition">
<where>
1 = 1
<if test="id != null and id != ''">
and id = #{id,jdbcType=VARCHAR}
</if>
<if test="fetuNumber != null">
and fetu_number = #{fetuNumber,jdbcType=INTEGER}
</if>
<if test="productNumber != null">
and product_number = #{productNumber,jdbcType=INTEGER}
</if>
<if test="birthWeight != null">
and birth_weight = #{birthWeight,jdbcType=DOUBLE}
</if>
<if test="parturitionType != null and parturitionType != ''">
and parturition_type = #{parturitionType,jdbcType=VARCHAR}
</if>
<if test="tireNumber != null and tireNumber != ''">
and tire_number = #{tireNumber,jdbcType=VARCHAR}
</if>
<if test="birthDefectType != null">
and birth_defect_type = #{birthDefectType,jdbcType=INTEGER}
</if>
<if test="birthDefectDesc != null and birthDefectDesc != ''">
and birth_defect_desc = #{birthDefectDesc,jdbcType=VARCHAR}
</if>
<if test="fetuEmbarrasType != null">
and fetu_embarras_type = #{fetuEmbarrasType,jdbcType=INTEGER}
</if>
<if test="apgarScoreOne != null">
and apgar_score_one = #{apgarScoreOne,jdbcType=DOUBLE}
</if>
<if test="apgarScoreFive != null">
and apgar_score_five = #{apgarScoreFive,jdbcType=DOUBLE}
</if>
<if test="apgarScoreTen != null">
and apgar_score_ten = #{apgarScoreTen,jdbcType=DOUBLE}
</if>
<if test="birthInjuryType != null">
and birth_injury_type = #{birthInjuryType,jdbcType=INTEGER}
</if>
<if test="birthInjuryPosition != null and birthInjuryPosition != ''">
and birth_injury_position = #{birthInjuryPosition,jdbcType=VARCHAR}
</if>
<if test="amnioticFluidType != null">
and amniotic_fluid_type = #{amnioticFluidType,jdbcType=INTEGER}
</if>
<if test="abnormalParturitionType != null">
and abnormal_parturition_type = #{abnormalParturitionType,jdbcType=INTEGER}
</if>
<if test="abnormalParturitionPosition != null and abnormalParturitionPosition != ''">
and abnormal_parturition_position = #{abnormalParturitionPosition,jdbcType=VARCHAR}
</if>
<if test="deformityType != null">
and deformity_type = #{deformityType,jdbcType=INTEGER}
</if>
<if test="deformityPosition != null and deformityPosition != ''">
and deformity_position = #{deformityPosition,jdbcType=VARCHAR}
</if>
<if test="birthInfectionType != null">
and birth_infection_type = #{birthInfectionType,jdbcType=INTEGER}
</if>
<if test="birthInfectionCause != null and birthInfectionCause != ''">
and birth_infection_cause = #{birthInfectionCause,jdbcType=VARCHAR}
</if>
<if test="birthCourseDisease != null and birthCourseDisease != ''">
and birth_course_disease = #{birthCourseDisease,jdbcType=VARCHAR}
</if>
<if test="birthIllType != null">
and birth_ill_type = #{birthIllType,jdbcType=INTEGER}
</if>
<if test="birthIllCause != null and birthIllCause != ''">
and birth_ill_cause = #{birthIllCause,jdbcType=VARCHAR}
</if>
<if test="birthIllDisease != null and birthIllDisease != ''">
and birth_ill_disease = #{birthIllDisease,jdbcType=VARCHAR}
</if>
<if test="headTraumaHistory != null">
and head_trauma_history = #{headTraumaHistory,jdbcType=INTEGER}
</if>
<if test="headTraumaDesc != null and headTraumaDesc != ''">
and head_trauma_desc = #{headTraumaDesc,jdbcType=VARCHAR}
</if>
<if test="earPoisonType != null">
and ear_poison_type = #{earPoisonType,jdbcType=INTEGER}
</if>
<if test="earPoisonMap != null and earPoisonMap != ''">
and ear_poison_map = #{earPoisonMap,jdbcType=VARCHAR}
</if>
<if test="tympanitisType != null">
and tympanitis_type = #{tympanitisType,jdbcType=INTEGER}
</if>
<if test="tympanitisDesc != null and tympanitisDesc != ''">
and tympanitis_desc = #{tympanitisDesc,jdbcType=VARCHAR}
</if>
<if test="nicuType != null">
and nicu_type = #{nicuType,jdbcType=INTEGER}
</if>
<if test="nicuCause != null and nicuCause != ''">
and nicu_cause = #{nicuCause,jdbcType=VARCHAR}
</if>
<if test="nicuContinuedDate != null and nicuContinuedDate != ''">
and nicu_continued_date = #{nicuContinuedDate,jdbcType=VARCHAR}
</if>
<if test="respiratorType != null">
and respirator_type = #{respiratorType,jdbcType=INTEGER}
</if>
<if test="respiratorContinuedDate != null and respiratorContinuedDate != ''">
and respirator_continued_date = #{respiratorContinuedDate,jdbcType=VARCHAR}
</if>
<if test="respiratorContinuedDateUnit != null and respiratorContinuedDateUnit != ''">
and respirator_continued_date_unit = #{respiratorContinuedDateUnit,jdbcType=VARCHAR}
</if>
<if test="outsideResponse != null">
and outside_response = #{outsideResponse,jdbcType=INTEGER}
</if>
<if test="babyPatientId != null and babyPatientId != ''">
and baby_patient_id = #{babyPatientId,jdbcType=VARCHAR}
</if>
<if test="babyEarId != null and babyEarId != ''">
and baby_ear_id = #{babyEarId,jdbcType=VARCHAR}
</if>
</where>
</sql>
<select id="queryBabyPatientExtendEarBirth" resultMap="BabyPatientExtendEarBirthResultMap"
parameterType="com.lyms.platform.permission.model.BabyPatientExtendEarBirthQuery">
select
id,fetu_number,product_number,birth_weight,tire_number,parturition_type,birth_defect_type,birth_defect_desc,fetu_embarras_type,apgar_score_one,apgar_score_five,apgar_score_ten,birth_injury_type,birth_injury_position,amniotic_fluid_type,abnormal_parturition_type,abnormal_parturition_position,deformity_type,deformity_position,birth_infection_type,birth_infection_cause,birth_course_disease,birth_ill_type,birth_ill_cause,birth_ill_disease,head_trauma_history,head_trauma_desc,ear_poison_type,ear_poison_map,tympanitis_type,tympanitis_desc,nicu_type,nicu_cause,nicu_continued_date,respirator_type,respirator_continued_date,respirator_continued_date_unit,outside_response,baby_patient_id,baby_ear_id,apgar_unknown
from baby_patient_extend_ear_birth
<include refid="BabyPatientExtendEarBirthCondition"/>
<include refid="orderAndLimit"/>
</select>
<select id="queryBabyPatientExtendEarBirthCount" resultType="int"
parameterType="com.lyms.platform.permission.model.BabyPatientExtendEarBirthQuery">
select count(1) from baby_patient_extend_ear_birth
<include refid="BabyPatientExtendEarBirthCondition"/>
</select>
</mapper>