BabyPatientExtendEarMother.xml 15.2 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
 158
 159
 160
 161
 162
 163
 164
 165
 166
 167
 168
 169
 170
 171
 172
 173
 174
 175
 176
 177
 178
 179
 180
 181
 182
 183
 184
 185
 186
 187
 188
 189
 190
 191
 192
 193
 194
 195
 196
 197
 198
 199
 200
 201
 202
 203
 204
 205
 206
 207
 208
 209
 210
 211
 212
 213
 214
 215
 216
 217
 218
 219
 220
 221
 222
 223
 224
 225
 226
 227
 228
 229
 230
 231
 232
 233
 234
 235
 236
 237
 238
 239
 240
 241
 242
 243
 244
 245
 246
 247
 248
 249
 250
 251
 252
 253
 254
 255
 256
 257
 258
 259
 260
 261
 262
 263
 264
 265
 266
 267
 268
 269
 270
 271
 272
 273
 274
 275
 276
 277
 278
 279
 280
 281
 282
 283
 284
<?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.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="INTEGER" />
<result column="abortion_date" property="abortionDate" jdbcType="TIMESTAMP" />
<result column="abortion_cause" property="abortionCause" jdbcType="VARCHAR" />
<result column="abortion_type" property="abortionType" jdbcType="INTEGER" />
<result column="viral_infection_history_type" property="viralInfectionHistoryType" jdbcType="INTEGER" />
<result column="viral_infection_type_id" property="viralInfectionTypeId" jdbcType="VARCHAR" />
<result column="viral_infection_other_desc" property="viralInfectionOtherDesc" jdbcType="VARCHAR" />
<result column="viral_infection_date" property="viralInfectionDate" jdbcType="INTEGER" />
<result column="genital_infection_history_type" property="genitalInfectionHistoryType" jdbcType="INTEGER" />
<result column="genital_infection_type_id" property="genitalInfectionTypeId" jdbcType="VARCHAR" />
<result column="genital_infection_other_desc" property="genitalInfectionOtherDesc" jdbcType="VARCHAR" />
<result column="genital_infection_date" property="genitalInfectionDate" jdbcType="INTEGER" />
<result column="radiation_type" property="radiationType" jdbcType="INTEGER" />
<result column="radiation_date" property="radiationDate" jdbcType="TIMESTAMP" />
<result column="drug_app_type" property="drugAppType" jdbcType="INTEGER" />
<result column="drug_app_name" property="drugAppName" jdbcType="VARCHAR" />
<result column="drug_app_use_date" property="drugAppUseDate" jdbcType="TIMESTAMP" />
<result column="harmful_substance_type" property="harmfulSubstanceType" jdbcType="INTEGER" />
<result column="harmful_substance_name" property="harmfulSubstanceName" jdbcType="VARCHAR" />
<result column="harmful_substance_date" property="harmfulSubstanceDate" jdbcType="TIMESTAMP" />
<result column="bad_life_history_type" property="badLifeHistoryType" jdbcType="INTEGER" />
<result column="bad_life_type_id" property="badLifeTypeId" jdbcType="VARCHAR" />
<result column="medical_history_type" property="medicalHistoryType" jdbcType="INTEGER" />
<result column="medical_type_id" property="medicalTypeId" jdbcType="INTEGER" />
<result column="medical_other_type_desc" property="medicalOtherTypeDesc" jdbcType="VARCHAR" />
<result column="bnormal_pregnancy_history_type" property="bnormalPregnancyHistoryType" jdbcType="INTEGER" />
<result column="bnormal_pregnancy_type_id" property="bnormalPregnancyTypeId" jdbcType="VARCHAR" />
<result column="bnormal_pregnancy_other_desc" property="bnormalPregnancyOtherDesc" jdbcType="VARCHAR" />
<result column="baby_patient_id" property="babyPatientId" 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,abortion_date,abortion_cause,abortion_type,viral_infection_history_type,viral_infection_type_id,viral_infection_other_desc,viral_infection_date,genital_infection_history_type,genital_infection_type_id,genital_infection_other_desc,genital_infection_date,radiation_type,radiation_date,drug_app_type,drug_app_name,drug_app_use_date,harmful_substance_type,harmful_substance_name,harmful_substance_date,bad_life_history_type,bad_life_type_id,medical_history_type,medical_type_id,medical_other_type_desc,bnormal_pregnancy_history_type,bnormal_pregnancy_type_id,bnormal_pregnancy_other_desc,baby_patient_id) values (#{id},#{gestationAge},#{abortionHistoryType},#{abortionDate},#{abortionCause},#{abortionType},#{viralInfectionHistoryType},#{viralInfectionTypeId},#{viralInfectionOtherDesc},#{viralInfectionDate},#{genitalInfectionHistoryType},#{genitalInfectionTypeId},#{genitalInfectionOtherDesc},#{genitalInfectionDate},#{radiationType},#{radiationDate},#{drugAppType},#{drugAppName},#{drugAppUseDate},#{harmfulSubstanceType},#{harmfulSubstanceName},#{harmfulSubstanceDate},#{badLifeHistoryType},#{badLifeTypeId},#{medicalHistoryType},#{medicalTypeId},#{medicalOtherTypeDesc},#{bnormalPregnancyHistoryType},#{bnormalPregnancyTypeId},#{bnormalPregnancyOtherDesc},#{babyPatientId})
</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 >= 0">
abortion_history_type = #{abortionHistoryType,jdbcType=INTEGER},
</if>
<if test="abortionDate != null">
abortion_date = #{abortionDate,jdbcType=TIMESTAMP},
</if>
<if test="abortionCause != null and abortionCause != ''">
abortion_cause = #{abortionCause,jdbcType=VARCHAR},
</if>
<if test="abortionType != null and abortionType >= 0">
abortion_type = #{abortionType,jdbcType=INTEGER},
</if>
<if test="viralInfectionHistoryType != null and viralInfectionHistoryType >= 0">
viral_infection_history_type = #{viralInfectionHistoryType,jdbcType=INTEGER},
</if>
<if test="viralInfectionTypeId != null and viralInfectionTypeId != ''">
viral_infection_type_id = #{viralInfectionTypeId,jdbcType=VARCHAR},
</if>
<if test="viralInfectionOtherDesc != null and viralInfectionOtherDesc != ''">
viral_infection_other_desc = #{viralInfectionOtherDesc,jdbcType=VARCHAR},
</if>
<if test="viralInfectionDate != null and viralInfectionDate >= 0">
viral_infection_date = #{viralInfectionDate,jdbcType=INTEGER},
</if>
<if test="genitalInfectionHistoryType != null and genitalInfectionHistoryType >= 0">
genital_infection_history_type = #{genitalInfectionHistoryType,jdbcType=INTEGER},
</if>
<if test="genitalInfectionTypeId != null and genitalInfectionTypeId != ''">
genital_infection_type_id = #{genitalInfectionTypeId,jdbcType=VARCHAR},
</if>
<if test="genitalInfectionOtherDesc != null and genitalInfectionOtherDesc != ''">
genital_infection_other_desc = #{genitalInfectionOtherDesc,jdbcType=VARCHAR},
</if>
<if test="genitalInfectionDate != null and genitalInfectionDate >= 0">
genital_infection_date = #{genitalInfectionDate,jdbcType=INTEGER},
</if>
<if test="radiationType != null and radiationType >= 0">
radiation_type = #{radiationType,jdbcType=INTEGER},
</if>
<if test="radiationDate != null">
radiation_date = #{radiationDate,jdbcType=TIMESTAMP},
</if>
<if test="drugAppType != null and drugAppType >= 0">
drug_app_type = #{drugAppType,jdbcType=INTEGER},
</if>
<if test="drugAppName != null and drugAppName != ''">
drug_app_name = #{drugAppName,jdbcType=VARCHAR},
</if>
<if test="drugAppUseDate != null">
drug_app_use_date = #{drugAppUseDate,jdbcType=TIMESTAMP},
</if>
<if test="harmfulSubstanceType != null and harmfulSubstanceType >= 0">
harmful_substance_type = #{harmfulSubstanceType,jdbcType=INTEGER},
</if>
<if test="harmfulSubstanceName != null and harmfulSubstanceName != ''">
harmful_substance_name = #{harmfulSubstanceName,jdbcType=VARCHAR},
</if>
<if test="harmfulSubstanceDate != null">
harmful_substance_date = #{harmfulSubstanceDate,jdbcType=TIMESTAMP},
</if>
<if test="badLifeHistoryType != null and badLifeHistoryType >= 0">
bad_life_history_type = #{badLifeHistoryType,jdbcType=INTEGER},
</if>
<if test="badLifeTypeId != null and badLifeTypeId != ''">
bad_life_type_id = #{badLifeTypeId,jdbcType=VARCHAR},
</if>
<if test="medicalHistoryType != null and medicalHistoryType >= 0">
medical_history_type = #{medicalHistoryType,jdbcType=INTEGER},
</if>
<if test="medicalTypeId != null and medicalTypeId >= 0">
medical_type_id = #{medicalTypeId,jdbcType=INTEGER},
</if>
<if test="medicalOtherTypeDesc != null and medicalOtherTypeDesc != ''">
medical_other_type_desc = #{medicalOtherTypeDesc,jdbcType=VARCHAR},
</if>
<if test="bnormalPregnancyHistoryType != null and bnormalPregnancyHistoryType >= 0">
bnormal_pregnancy_history_type = #{bnormalPregnancyHistoryType,jdbcType=INTEGER},
</if>
<if test="bnormalPregnancyTypeId != null and bnormalPregnancyTypeId != ''">
bnormal_pregnancy_type_id = #{bnormalPregnancyTypeId,jdbcType=VARCHAR},
</if>
<if test="bnormalPregnancyOtherDesc != null and bnormalPregnancyOtherDesc != ''">
bnormal_pregnancy_other_desc = #{bnormalPregnancyOtherDesc,jdbcType=VARCHAR},
</if>
<if test="babyPatientId != null and babyPatientId != ''">
baby_patient_id = #{babyPatientId,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>


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



<select id="getBabyPatientExtendEarMother" resultMap="BabyPatientExtendEarMotherResultMap" parameterType="java.lang.String">
select id,gestation_age,abortion_history_type,abortion_date,abortion_cause,abortion_type,viral_infection_history_type,viral_infection_type_id,viral_infection_other_desc,viral_infection_date,genital_infection_history_type,genital_infection_type_id,genital_infection_other_desc,genital_infection_date,radiation_type,radiation_date,drug_app_type,drug_app_name,drug_app_use_date,harmful_substance_type,harmful_substance_name,harmful_substance_date,bad_life_history_type,bad_life_type_id,medical_history_type,medical_type_id,medical_other_type_desc,bnormal_pregnancy_history_type,bnormal_pregnancy_type_id,bnormal_pregnancy_other_desc,baby_patient_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 >= 0">
and abortion_history_type = #{abortionHistoryType,jdbcType=INTEGER}
</if>
<if test="abortionDate != null">
and abortion_date = #{abortionDate,jdbcType=TIMESTAMP}
</if>
<if test="abortionCause != null and abortionCause != ''">
and abortion_cause = #{abortionCause,jdbcType=VARCHAR}
</if>
<if test="abortionType != null and abortionType >= 0">
and abortion_type = #{abortionType,jdbcType=INTEGER}
</if>
<if test="viralInfectionHistoryType != null and viralInfectionHistoryType >= 0">
and viral_infection_history_type = #{viralInfectionHistoryType,jdbcType=INTEGER}
</if>
<if test="viralInfectionTypeId != null and viralInfectionTypeId != ''">
and viral_infection_type_id = #{viralInfectionTypeId,jdbcType=VARCHAR}
</if>
<if test="viralInfectionOtherDesc != null and viralInfectionOtherDesc != ''">
and viral_infection_other_desc = #{viralInfectionOtherDesc,jdbcType=VARCHAR}
</if>
<if test="viralInfectionDate != null and viralInfectionDate >= 0">
and viral_infection_date = #{viralInfectionDate,jdbcType=INTEGER}
</if>
<if test="genitalInfectionHistoryType != null and genitalInfectionHistoryType >= 0">
and genital_infection_history_type = #{genitalInfectionHistoryType,jdbcType=INTEGER}
</if>
<if test="genitalInfectionTypeId != null and genitalInfectionTypeId != ''">
and genital_infection_type_id = #{genitalInfectionTypeId,jdbcType=VARCHAR}
</if>
<if test="genitalInfectionOtherDesc != null and genitalInfectionOtherDesc != ''">
and genital_infection_other_desc = #{genitalInfectionOtherDesc,jdbcType=VARCHAR}
</if>
<if test="genitalInfectionDate != null and genitalInfectionDate >= 0">
and genital_infection_date = #{genitalInfectionDate,jdbcType=INTEGER}
</if>
<if test="radiationType != null and radiationType >= 0">
and radiation_type = #{radiationType,jdbcType=INTEGER}
</if>
<if test="radiationDate != null" >
and radiation_date = #{radiationDate,jdbcType=TIMESTAMP}
</if>
<if test="drugAppType != null and drugAppType >= 0">
and drug_app_type = #{drugAppType,jdbcType=INTEGER}
</if>
<if test="drugAppName != null and drugAppName != ''">
and drug_app_name = #{drugAppName,jdbcType=VARCHAR}
</if>
<if test="drugAppUseDate != null">
and drug_app_use_date = #{drugAppUseDate,jdbcType=TIMESTAMP}
</if>
<if test="harmfulSubstanceType != null and harmfulSubstanceType >= 0">
and harmful_substance_type = #{harmfulSubstanceType,jdbcType=INTEGER}
</if>
<if test="harmfulSubstanceName != null and harmfulSubstanceName != ''">
and harmful_substance_name = #{harmfulSubstanceName,jdbcType=VARCHAR}
</if>
<if test="harmfulSubstanceDate != null">
and harmful_substance_date = #{harmfulSubstanceDate,jdbcType=TIMESTAMP}
</if>
<if test="badLifeHistoryType != null and badLifeHistoryType >= 0">
and bad_life_history_type = #{badLifeHistoryType,jdbcType=INTEGER}
</if>
<if test="badLifeTypeId != null and badLifeTypeId != ''">
and bad_life_type_id = #{badLifeTypeId,jdbcType=VARCHAR}
</if>
<if test="medicalHistoryType != null and medicalHistoryType >= 0">
and medical_history_type = #{medicalHistoryType,jdbcType=INTEGER}
</if>
<if test="medicalTypeId != null and medicalTypeId >= 0">
and medical_type_id = #{medicalTypeId,jdbcType=INTEGER}
</if>
<if test="medicalOtherTypeDesc != null and medicalOtherTypeDesc != ''">
and medical_other_type_desc = #{medicalOtherTypeDesc,jdbcType=VARCHAR}
</if>
<if test="bnormalPregnancyHistoryType != null and bnormalPregnancyHistoryType >= 0">
and bnormal_pregnancy_history_type = #{bnormalPregnancyHistoryType,jdbcType=INTEGER}
</if>
<if test="bnormalPregnancyTypeId != null and bnormalPregnancyTypeId != ''">
and bnormal_pregnancy_type_id = #{bnormalPregnancyTypeId,jdbcType=VARCHAR}
</if>
<if test="bnormalPregnancyOtherDesc != null and bnormalPregnancyOtherDesc != ''">
and bnormal_pregnancy_other_desc = #{bnormalPregnancyOtherDesc,jdbcType=VARCHAR}
</if>
<if test="babyPatientId != null and babyPatientId != ''">
and baby_patient_id = #{babyPatientId,jdbcType=VARCHAR}
</if>
</where>
</sql>



<select id="queryBabyPatientExtendEarMother" resultMap="BabyPatientExtendEarMotherResultMap" parameterType="com.lyms.platform.permission.model.BabyPatientExtendEarMotherQuery">
select id,gestation_age,abortion_history_type,abortion_date,abortion_cause,abortion_type,viral_infection_history_type,viral_infection_type_id,viral_infection_other_desc,viral_infection_date,genital_infection_history_type,genital_infection_type_id,genital_infection_other_desc,genital_infection_date,radiation_type,radiation_date,drug_app_type,drug_app_name,drug_app_use_date,harmful_substance_type,harmful_substance_name,harmful_substance_date,bad_life_history_type,bad_life_type_id,medical_history_type,medical_type_id,medical_other_type_desc,bnormal_pregnancy_history_type,bnormal_pregnancy_type_id,bnormal_pregnancy_other_desc,baby_patient_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>