BabyPatientExtendEarMother.xml 7.5 KB
   1
   2
   3
   4
   5
   6
   7
   8
   9
  10
  11
  12
  13
  14
  15
  16
  17
  18
  19
  20
  21
  22
  23
  24
  25
  26
  27
  28
  29
  30
  31
  32
  33
  34
  35
  36
  37
  38
  39
  40
  41
  42
  43
  44
  45
  46
  47
  48
  49
  50
  51
  52
  53
  54
  55
  56
  57
  58
  59
  60
  61
  62
  63
  64
  65
  66
  67
  68
  69
  70
  71
  72
  73
  74
  75
  76
  77
  78
  79
  80
  81
  82
  83
  84
  85
  86
  87
  88
  89
  90
  91
  92
  93
  94
  95
  96
  97
  98
  99
 100
 101
 102
 103
 104
 105
 106
 107
 108
 109
 110
 111
 112
 113
 114
 115
 116
 117
 118
 119
 120
 121
 122
 123
 124
 125
 126
 127
 128
 129
 130
 131
 132
 133
 134
 135
 136
 137
 138
 139
 140
 141
 142
 143
 144
 145
 146
 147
 148
 149
 150
 151
 152
 153
 154
 155
 156
 157
<?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.BabyPatientExtendEarMotherMapper">

<resultMap id="BabyPatientExtendEarMotherResultMap" type="com.lyms.platform.permission.model.BabyPatientExtendEarMother">
<id column="id" property="id" jdbcType="VARCHAR" />
<result column="gestation_age" property="gestationAge" jdbcType="INTEGER" />
<result column="abortion_history_type" property="abortionHistoryType" jdbcType="VARCHAR" />
<result column="viral_infection_history_type" property="viralInfectionHistoryType" jdbcType="VARCHAR" />
<result column="genital_infection_history_type" property="genitalInfectionHistoryType" jdbcType="VARCHAR" />
<result column="radiation_history_type" property="radiationHistoryType" jdbcType="VARCHAR" />
<result column="drug_app_name" property="drugAppName" jdbcType="VARCHAR" />
<result column="harmful_substance_type" property="harmfulSubstanceType" jdbcType="VARCHAR" />
<result column="bad_life_history_type" property="badLifeHistoryType" jdbcType="VARCHAR" />
<result column="medical_history_type" property="medicalHistoryType" jdbcType="VARCHAR" />
<result column="bnormal_pregnancy_history_type" property="bnormalPregnancyHistoryType" jdbcType="VARCHAR" />
<result column="baby_patient_id" property="babyPatientId" jdbcType="VARCHAR" />
<result column="baby_ear_id" property="babyEarId" jdbcType="VARCHAR" />
</resultMap>



<insert id="addBabyPatientExtendEarMother" parameterType="com.lyms.platform.permission.model.BabyPatientExtendEarMother">
insert into baby_patient_extend_ear_mother (id,gestation_age,abortion_history_type,viral_infection_history_type,genital_infection_history_type,radiation_history_type,drug_app_name,harmful_substance_type,bad_life_history_type,medical_history_type,bnormal_pregnancy_history_type,baby_patient_id,baby_ear_id) values (#{id},#{gestationAge},#{abortionHistoryType},#{viralInfectionHistoryType},#{genitalInfectionHistoryType},#{radiationHistoryType},#{drugAppName},#{harmfulSubstanceType},#{badLifeHistoryType},#{medicalHistoryType},#{bnormalPregnancyHistoryType},#{babyPatientId},#{babyEarId})
</insert>



<update id="updateBabyPatientExtendEarMother" parameterType="com.lyms.platform.permission.model.BabyPatientExtendEarMother">
update baby_patient_extend_ear_mother <set><if test="gestationAge != null and gestationAge >= 0">
gestation_age = #{gestationAge,jdbcType=INTEGER},
</if>
<if test="abortionHistoryType != null and abortionHistoryType != ''">
abortion_history_type = #{abortionHistoryType,jdbcType=VARCHAR},
</if>
<if test="viralInfectionHistoryType != null and viralInfectionHistoryType != ''">
viral_infection_history_type = #{viralInfectionHistoryType,jdbcType=VARCHAR},
</if>
<if test="genitalInfectionHistoryType != null and genitalInfectionHistoryType != ''">
genital_infection_history_type = #{genitalInfectionHistoryType,jdbcType=VARCHAR},
</if>
<if test="radiationHistoryType != null and radiationHistoryType != ''">
radiation_history_type = #{radiationHistoryType,jdbcType=VARCHAR},
</if>
<if test="drugAppName != null and drugAppName != ''">
drug_app_name = #{drugAppName,jdbcType=VARCHAR},
</if>
<if test="harmfulSubstanceType != null and harmfulSubstanceType != ''">
harmful_substance_type = #{harmfulSubstanceType,jdbcType=VARCHAR},
</if>
<if test="badLifeHistoryType != null and badLifeHistoryType != ''">
bad_life_history_type = #{badLifeHistoryType,jdbcType=VARCHAR},
</if>
<if test="medicalHistoryType != null and medicalHistoryType != ''">
medical_history_type = #{medicalHistoryType,jdbcType=VARCHAR},
</if>
<if test="bnormalPregnancyHistoryType != null and bnormalPregnancyHistoryType != ''">
bnormal_pregnancy_history_type = #{bnormalPregnancyHistoryType,jdbcType=VARCHAR},
</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>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>


<delete id="deleteBabyPatientExtendEarMother" parameterType="java.lang.Integer">
delete from baby_patient_extend_ear_mother where id = #{id,jdbcType=VARCHAR}
</delete>



<select id="getBabyPatientExtendEarMother" resultMap="BabyPatientExtendEarMotherResultMap" parameterType="java.lang.Integer">
select id,gestation_age,abortion_history_type,viral_infection_history_type,genital_infection_history_type,radiation_history_type,drug_app_name,harmful_substance_type,bad_life_history_type,medical_history_type,bnormal_pregnancy_history_type,baby_patient_id,baby_ear_id
from baby_patient_extend_ear_mother 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="BabyPatientExtendEarMotherCondition">
<where>
1 = 1
<if test="id != null and id != ''">
and id = #{id,jdbcType=VARCHAR}
</if>
<if test="gestationAge != null and gestationAge >= 0">
and gestation_age = #{gestationAge,jdbcType=INTEGER}
</if>
<if test="abortionHistoryType != null and abortionHistoryType != ''">
and abortion_history_type = #{abortionHistoryType,jdbcType=VARCHAR}
</if>
<if test="viralInfectionHistoryType != null and viralInfectionHistoryType != ''">
and viral_infection_history_type = #{viralInfectionHistoryType,jdbcType=VARCHAR}
</if>
<if test="genitalInfectionHistoryType != null and genitalInfectionHistoryType != ''">
and genital_infection_history_type = #{genitalInfectionHistoryType,jdbcType=VARCHAR}
</if>
<if test="radiationHistoryType != null and radiationHistoryType != ''">
and radiation_history_type = #{radiationHistoryType,jdbcType=VARCHAR}
</if>
<if test="drugAppName != null and drugAppName != ''">
and drug_app_name = #{drugAppName,jdbcType=VARCHAR}
</if>
<if test="harmfulSubstanceType != null and harmfulSubstanceType != ''">
and harmful_substance_type = #{harmfulSubstanceType,jdbcType=VARCHAR}
</if>
<if test="badLifeHistoryType != null and badLifeHistoryType != ''">
and bad_life_history_type = #{badLifeHistoryType,jdbcType=VARCHAR}
</if>
<if test="medicalHistoryType != null and medicalHistoryType != ''">
and medical_history_type = #{medicalHistoryType,jdbcType=VARCHAR}
</if>
<if test="bnormalPregnancyHistoryType != null and bnormalPregnancyHistoryType != ''">
and bnormal_pregnancy_history_type = #{bnormalPregnancyHistoryType,jdbcType=VARCHAR}
</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="queryBabyPatientExtendEarMother" resultMap="BabyPatientExtendEarMotherResultMap" parameterType="com.lyms.platform.permission.model.BabyPatientExtendEarMotherQuery">
select id,gestation_age,abortion_history_type,viral_infection_history_type,genital_infection_history_type,radiation_history_type,drug_app_name,harmful_substance_type,bad_life_history_type,medical_history_type,bnormal_pregnancy_history_type,baby_patient_id,baby_ear_id
from baby_patient_extend_ear_mother
<include refid="BabyPatientExtendEarMotherCondition" />
<include refid="orderAndLimit" />
</select>



<select id="queryBabyPatientExtendEarMotherCount" resultType="int" parameterType="com.lyms.platform.permission.model.BabyPatientExtendEarMotherQuery">
select count(1) from baby_patient_extend_ear_mother
<include refid="BabyPatientExtendEarMotherCondition" />
</select>



</mapper>