<?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.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="parturition_type" property="parturitionType" jdbcType="INTEGER"/>
<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_name" property="earPoisonName" jdbcType="VARCHAR"/>
<result column="ear_poison_number" property="earPoisonNumber" jdbcType="VARCHAR"/>
<result column="ear_poison_course" property="earPoisonCourse" 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="outside_response" property="outsideResponse" jdbcType="INTEGER"/>
<result column="baby_patient_id" property="babyPatientId" jdbcType="VARCHAR"/>
</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,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_name,ear_poison_number,ear_poison_course,tympanitis_type,tympanitis_desc,nicu_type,nicu_cause,nicu_continued_date,respirator_type,respirator_continued_date,outside_response,baby_patient_id) values (#{id},#{fetuNumber},#{productNumber},#{birthWeight},#{parturitionType},#{birthDefectType},#{birthDefectDesc},#{fetuEmbarrasType},#{apgarScoreOne},#{apgarScoreFive},#{apgarScoreTen},#{birthInjuryType},#{birthInjuryPosition},#{amnioticFluidType},#{abnormalParturitionType},#{abnormalParturitionPosition},#{deformityType},#{deformityPosition},#{birthInfectionType},#{birthInfectionCause},#{birthCourseDisease},#{birthIllType},#{birthIllCause},#{birthIllDisease},#{headTraumaHistory},#{headTraumaDesc},#{earPoisonType},#{earPoisonName},#{earPoisonNumber},#{earPoisonCourse},#{tympanitisType},#{tympanitisDesc},#{nicuType},#{nicuCause},#{nicuContinuedDate},#{respiratorType},#{respiratorContinuedDate},#{outsideResponse},#{babyPatientId})
</insert>
<update id="updateBabyPatientExtendEarBirth"
parameterType="com.lyms.platform.permission.model.BabyPatientExtendEarBirth">
update baby_patient_extend_ear_birth
<set>
<if test="fetuNumber != null and fetuNumber >= 0">
fetu_number = #{fetuNumber,jdbcType=INTEGER},
</if>
<if test="productNumber != null and productNumber >= 0">
product_number = #{productNumber,jdbcType=INTEGER},
</if>
<if test="birthWeight != null and birthWeight >= 0">
birth_weight = #{birthWeight,jdbcType=DOUBLE},
</if>
<if test="parturitionType != null and parturitionType >= 0">
parturition_type = #{parturitionType,jdbcType=INTEGER},
</if>
<if test="birthDefectType != null and birthDefectType >= 0">
birth_defect_type = #{birthDefectType,jdbcType=INTEGER},
</if>
<if test="birthDefectDesc != null and birthDefectDesc != ''">
birth_defect_desc = #{birthDefectDesc,jdbcType=VARCHAR},
</if>
<if test="fetuEmbarrasType != null and fetuEmbarrasType >= 0">
fetu_embarras_type = #{fetuEmbarrasType,jdbcType=INTEGER},
</if>
<if test="apgarScoreOne != null and apgarScoreOne >= 0">
apgar_score_one = #{apgarScoreOne,jdbcType=DOUBLE},
</if>
<if test="apgarScoreFive != null and apgarScoreFive >= 0">
apgar_score_five = #{apgarScoreFive,jdbcType=DOUBLE},
</if>
<if test="apgarScoreTen != null and apgarScoreTen >= 0">
apgar_score_ten = #{apgarScoreTen,jdbcType=DOUBLE},
</if>
<if test="birthInjuryType != null and birthInjuryType >= 0">
birth_injury_type = #{birthInjuryType,jdbcType=INTEGER},
</if>
<if test="birthInjuryPosition != null and birthInjuryPosition != ''">
birth_injury_position = #{birthInjuryPosition,jdbcType=VARCHAR},
</if>
<if test="amnioticFluidType != null and amnioticFluidType >= 0">
amniotic_fluid_type = #{amnioticFluidType,jdbcType=INTEGER},
</if>
<if test="abnormalParturitionType != null and abnormalParturitionType >= 0">
abnormal_parturition_type = #{abnormalParturitionType,jdbcType=INTEGER},
</if>
<if test="abnormalParturitionPosition != null and abnormalParturitionPosition != ''">
abnormal_parturition_position = #{abnormalParturitionPosition,jdbcType=VARCHAR},
</if>
<if test="deformityType != null and deformityType >= 0">
deformity_type = #{deformityType,jdbcType=INTEGER},
</if>
<if test="deformityPosition != null and deformityPosition != ''">
deformity_position = #{deformityPosition,jdbcType=VARCHAR},
</if>
<if test="birthInfectionType != null and birthInfectionType >= 0">
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 and birthIllType >= 0">
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 and headTraumaHistory >= 0">
head_trauma_history = #{headTraumaHistory,jdbcType=INTEGER},
</if>
<if test="headTraumaDesc != null and headTraumaDesc != ''">
head_trauma_desc = #{headTraumaDesc,jdbcType=VARCHAR},
</if>
<if test="earPoisonType != null and earPoisonType >= 0">
ear_poison_type = #{earPoisonType,jdbcType=INTEGER},
</if>
<if test="earPoisonName != null and earPoisonName != ''">
ear_poison_name = #{earPoisonName,jdbcType=VARCHAR},
</if>
<if test="earPoisonNumber != null and earPoisonNumber != ''">
ear_poison_number = #{earPoisonNumber,jdbcType=VARCHAR},
</if>
<if test="earPoisonCourse != null and earPoisonCourse != ''">
ear_poison_course = #{earPoisonCourse,jdbcType=VARCHAR},
</if>
<if test="tympanitisType != null and tympanitisType >= 0">
tympanitis_type = #{tympanitisType,jdbcType=INTEGER},
</if>
<if test="tympanitisDesc != null and tympanitisDesc != ''">
tympanitis_desc = #{tympanitisDesc,jdbcType=VARCHAR},
</if>
<if test="nicuType != null and nicuType >= 0">
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 and respiratorType >= 0">
respirator_type = #{respiratorType,jdbcType=INTEGER},
</if>
<if test="respiratorContinuedDate != null and respiratorContinuedDate != ''">
respirator_continued_date = #{respiratorContinuedDate,jdbcType=VARCHAR},
</if>
<if test="outsideResponse != null and outsideResponse >= 0">
outside_response = #{outsideResponse,jdbcType=INTEGER},
</if>
<if test="babyPatientId != null and babyPatientId != ''">
baby_patient_id = #{babyPatientId,jdbcType=VARCHAR},
</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,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_name,ear_poison_number,ear_poison_course,tympanitis_type,tympanitis_desc,nicu_type,nicu_cause,nicu_continued_date,respirator_type,respirator_continued_date,outside_response,baby_patient_id
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 fetuNumber >= 0">
and fetu_number = #{fetuNumber,jdbcType=INTEGER}
</if>
<if test="productNumber != null and productNumber >= 0">
and product_number = #{productNumber,jdbcType=INTEGER}
</if>
<if test="birthWeight != null and birthWeight >= 0">
and birth_weight = #{birthWeight,jdbcType=DOUBLE}
</if>
<if test="parturitionType != null and parturitionType >= 0">
and parturition_type = #{parturitionType,jdbcType=INTEGER}
</if>
<if test="birthDefectType != null and birthDefectType >= 0">
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 fetuEmbarrasType >= 0">
and fetu_embarras_type = #{fetuEmbarrasType,jdbcType=INTEGER}
</if>
<if test="apgarScoreOne != null and apgarScoreOne >= 0">
and apgar_score_one = #{apgarScoreOne,jdbcType=DOUBLE}
</if>
<if test="apgarScoreFive != null and apgarScoreFive >= 0">
and apgar_score_five = #{apgarScoreFive,jdbcType=DOUBLE}
</if>
<if test="apgarScoreTen != null and apgarScoreTen >= 0">
and apgar_score_ten = #{apgarScoreTen,jdbcType=DOUBLE}
</if>
<if test="birthInjuryType != null and birthInjuryType >= 0">
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 amnioticFluidType >= 0">
and amniotic_fluid_type = #{amnioticFluidType,jdbcType=INTEGER}
</if>
<if test="abnormalParturitionType != null and abnormalParturitionType >= 0">
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 deformityType >= 0">
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 birthInfectionType >= 0">
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 birthIllType >= 0">
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 headTraumaHistory >= 0">
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 earPoisonType >= 0">
and ear_poison_type = #{earPoisonType,jdbcType=INTEGER}
</if>
<if test="earPoisonName != null and earPoisonName != ''">
and ear_poison_name = #{earPoisonName,jdbcType=VARCHAR}
</if>
<if test="earPoisonNumber != null and earPoisonNumber != ''">
and ear_poison_number = #{earPoisonNumber,jdbcType=VARCHAR}
</if>
<if test="earPoisonCourse != null and earPoisonCourse != ''">
and ear_poison_course = #{earPoisonCourse,jdbcType=VARCHAR}
</if>
<if test="tympanitisType != null and tympanitisType >= 0">
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 nicuType >= 0">
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 respiratorType >= 0">
and respirator_type = #{respiratorType,jdbcType=INTEGER}
</if>
<if test="respiratorContinuedDate != null and respiratorContinuedDate != ''">
and respirator_continued_date = #{respiratorContinuedDate,jdbcType=VARCHAR}
</if>
<if test="outsideResponse != null and outsideResponse >= 0">
and outside_response = #{outsideResponse,jdbcType=INTEGER}
</if>
<if test="babyPatientId != null and babyPatientId != ''">
and baby_patient_id = #{babyPatientId,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,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_name,ear_poison_number,ear_poison_course,tympanitis_type,tympanitis_desc,nicu_type,nicu_cause,nicu_continued_date,respirator_type,respirator_continued_date,outside_response,baby_patient_id
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>