BabyPatientExtendEarScreen.xml 16.8 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
 285
 286
 287
 288
 289
 290
 291
 292
 293
 294
 295
 296
 297
 298
 299
 300
 301
 302
 303
 304
 305
 306
 307
 308
 309
 310
 311
 312
 313
<?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.BabyPatientExtendEarScreenMapper">

<resultMap id="BabyPatientExtendEarScreenResultMap"
type="com.lyms.platform.permission.model.BabyPatientExtendEarScreen">
<id column="id" property="id" jdbcType="VARCHAR"/>
<result column="baby_id" property="babyId" jdbcType="VARCHAR"/>
<result column="screen_type" property="screenType" jdbcType="INTEGER"/>
<result column="check_hospital_id" property="checkHospitalId" jdbcType="VARCHAR"/>
<result column="screen_date" property="screenDate" jdbcType="TIMESTAMP"/>
<result column="high_risk_cause" property="highRiskCause" jdbcType="INTEGER"/>
<result column="oae_left" property="oaeLeft" jdbcType="INTEGER"/>
<result column="oae_right" property="oaeRight" jdbcType="INTEGER"/>
<result column="aabr_left" property="aabrLeft" jdbcType="INTEGER"/>
<result column="aabr_right" property="aabrRight" jdbcType="INTEGER"/>
<result column="gjb2_del_35" property="gjb2Del35" jdbcType="INTEGER"/>
<result column="gjb2_del_176" property="gjb2Del176" jdbcType="INTEGER"/>
<result column="gjb2_del_235" property="gjb2Del235" jdbcType="INTEGER"/>
<result column="gjb2_del_299" property="gjb2Del299" jdbcType="INTEGER"/>
<result column="gjb3_slc26a4_538" property="gjb3Slc26a4538" jdbcType="INTEGER"/>
<result column="gjb3_slc26a4_2168" property="gjb3Slc26a42168" jdbcType="INTEGER"/>
<result column="gjb3_slc26a4_ivs7" property="gjb3Slc26a4Ivs7" jdbcType="INTEGER"/>
<result column="process_option_type" property="processOptionType" jdbcType="INTEGER"/>
<result column="process_option_desc" property="processOptionDesc" jdbcType="VARCHAR"/>
<result column="guid_opinion" property="guidOpinion" jdbcType="VARCHAR"/>
<result column="check_doctor_id" property="checkDoctorId" jdbcType="VARCHAR"/>
<result column="referral_date" property="referralDate" jdbcType="TIMESTAMP"/>
<result column="create_date" property="createDate" jdbcType="TIMESTAMP"/>
<result column="create_user_id" property="createUserId" jdbcType="VARCHAR"/>
<result column="create_hospital_id" property="createHospitalId" jdbcType="VARCHAR"/>
<result column="last_update_date" property="lastUpdateDate" jdbcType="TIMESTAMP"/>
<result column="last_update_user_id" property="lastUpdateUserId" jdbcType="VARCHAR"/>
<result column="last_update_hospital_id" property="lastUpdateHospitalId" jdbcType="VARCHAR"/>
<result column="status" property="status" jdbcType="INTEGER"/>
</resultMap>


<insert id="addBabyPatientExtendEarScreen"
parameterType="com.lyms.platform.permission.model.BabyPatientExtendEarScreen">
insert into baby_patient_extend_ear_screen (id,baby_id,screen_type,check_hospital_id,screen_date,high_risk_cause,oae_left,oae_right,aabr_left,aabr_right,gjb2_del_35,gjb2_del_176,gjb2_del_235,gjb2_del_299,gjb3_slc26a4_538,gjb3_slc26a4_2168,gjb3_slc26a4_ivs7,process_option_type,process_option_desc,guid_opinion,check_doctor_id,referral_date,create_date,create_user_id,create_hospital_id,last_update_date,last_update_user_id,last_update_hospital_id,status) values (#{id},#{babyId},#{screenType},#{checkHospitalId},#{screenDate},#{highRiskCause},#{oaeLeft},#{oaeRight},#{aabrLeft},#{aabrRight},#{gjb2Del35},#{gjb2Del176},#{gjb2Del235},#{gjb2Del299},#{gjb3Slc26a4538},#{gjb3Slc26a42168},#{gjb3Slc26a4Ivs7},#{processOptionType},#{processOptionDesc},#{guidOpinion},#{checkDoctorId},#{referralDate},#{createDate},#{createUserId},#{createHospitalId},#{lastUpdateDate},#{lastUpdateUserId},#{lastUpdateHospitalId},#{status})
</insert>


<update id="updateBabyPatientExtendEarScreen"
parameterType="com.lyms.platform.permission.model.BabyPatientExtendEarScreen">
update baby_patient_extend_ear_screen
<set>
<if test="babyId != null and babyId != ''">
baby_id = #{babyId,jdbcType=VARCHAR},
</if>
<if test="screenType != null and screenType >= 0">
screen_type = #{screenType,jdbcType=INTEGER},
</if>
<if test="checkHospitalId != null and checkHospitalId != ''">
check_hospital_id = #{checkHospitalId,jdbcType=VARCHAR},
</if>
<if test="screenDate != null">
screen_date = #{screenDate,jdbcType=TIMESTAMP},
</if>
<if test="highRiskCause != null and highRiskCause >= 0">
high_risk_cause = #{highRiskCause,jdbcType=INTEGER},
</if>
<if test="oaeLeft != null and oaeLeft >= 0">
oae_left = #{oaeLeft,jdbcType=INTEGER},
</if>
<if test="oaeRight != null and oaeRight >= 0">
oae_right = #{oaeRight,jdbcType=INTEGER},
</if>
<if test="aabrLeft != null and aabrLeft >= 0">
aabr_left = #{aabrLeft,jdbcType=INTEGER},
</if>
<if test="aabrRight != null and aabrRight >= 0">
aabr_right = #{aabrRight,jdbcType=INTEGER},
</if>
<if test="gjb2Del35 != null and gjb2Del35 >= 0">
gjb2_del_35 = #{gjb2Del35,jdbcType=INTEGER},
</if>
<if test="gjb2Del176 != null and gjb2Del176 >= 0">
gjb2_del_176 = #{gjb2Del176,jdbcType=INTEGER},
</if>
<if test="gjb2Del235 != null and gjb2Del235 >= 0">
gjb2_del_235 = #{gjb2Del235,jdbcType=INTEGER},
</if>
<if test="gjb2Del299 != null and gjb2Del299 >= 0">
gjb2_del_299 = #{gjb2Del299,jdbcType=INTEGER},
</if>
<if test="gjb3Slc26a4538 != null and gjb3Slc26a4538 >= 0">
gjb3_slc26a4_538 = #{gjb3Slc26a4538,jdbcType=INTEGER},
</if>
<if test="gjb3Slc26a42168 != null and gjb3Slc26a42168 >= 0">
gjb3_slc26a4_2168 = #{gjb3Slc26a42168,jdbcType=INTEGER},
</if>
<if test="gjb3Slc26a4Ivs7 != null and gjb3Slc26a4Ivs7 >= 0">
gjb3_slc26a4_ivs7 = #{gjb3Slc26a4Ivs7,jdbcType=INTEGER},
</if>
<if test="processOptionType != null and processOptionType >= 0">
process_option_type = #{processOptionType,jdbcType=INTEGER},
</if>
<if test="processOptionDesc != null and processOptionDesc != ''">
process_option_desc = #{processOptionDesc,jdbcType=VARCHAR},
</if>
<if test="guidOpinion != null and guidOpinion != ''">
guid_opinion = #{guidOpinion,jdbcType=VARCHAR},
</if>
<if test="checkDoctorId != null and checkDoctorId != ''">
check_doctor_id = #{checkDoctorId,jdbcType=VARCHAR},
</if>
<if test="referralDate != null">
referral_date = #{referralDate,jdbcType=TIMESTAMP},
</if>
<if test="createDate != null">
create_date = #{createDate,jdbcType=TIMESTAMP},
</if>
<if test="createUserId != null and createUserId != ''">
create_user_id = #{createUserId,jdbcType=VARCHAR},
</if>
<if test="createHospitalId != null and createHospitalId != ''">
create_hospital_id = #{createHospitalId,jdbcType=VARCHAR},
</if>
<if test="lastUpdateDate != null">
last_update_date = #{lastUpdateDate,jdbcType=TIMESTAMP},
</if>
<if test="lastUpdateUserId != null and lastUpdateUserId != ''">
last_update_user_id = #{lastUpdateUserId,jdbcType=VARCHAR},
</if>
<if test="lastUpdateHospitalId != null and lastUpdateHospitalId != ''">
last_update_hospital_id = #{lastUpdateHospitalId,jdbcType=VARCHAR},
</if>
<if test="status != null and status >= 0">
status = #{status,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>


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


<select id="getBabyPatientExtendEarScreen" resultMap="BabyPatientExtendEarScreenResultMap"
parameterType="java.lang.String">
select id,baby_id,screen_type,check_hospital_id,screen_date,high_risk_cause,oae_left,oae_right,aabr_left,aabr_right,gjb2_del_35,gjb2_del_176,gjb2_del_235,gjb2_del_299,gjb3_slc26a4_538,gjb3_slc26a4_2168,gjb3_slc26a4_ivs7,process_option_type,process_option_desc,guid_opinion,check_doctor_id,referral_date,create_date,create_user_id,create_hospital_id,last_update_date,last_update_user_id,last_update_hospital_id,status
from baby_patient_extend_ear_screen 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="BabyPatientExtendEarScreenCondition">
<where>
1 = 1
<if test="id != null and id != ''">
and id = #{id,jdbcType=VARCHAR}
</if>
<if test="babyId != null and babyId != ''">
and baby_id = #{babyId,jdbcType=VARCHAR}
</if>
<if test="babyIds != null ">
and baby_id not in
<foreach item="item" index="index" collection="babyIds" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="screenType != null and screenType >= 0">
and screen_type = #{screenType,jdbcType=INTEGER}
</if>
<if test="checkHospitalIds != null ">
and check_hospital_id in
<foreach item="item" index="index" collection="checkHospitalIds" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="checkHospitalId != null and checkHospitalId != ''">
and check_hospital_id = #{checkHospitalId,jdbcType=VARCHAR}
</if>
<if test="screenDate != null">
and screen_date = #{screenDate,jdbcType=TIMESTAMP}
</if>
<if test="highRiskCause != null and highRiskCause >= 0">
and high_risk_cause = #{highRiskCause,jdbcType=INTEGER}
</if>
<if test="oaeLeft != null and oaeLeft >= 0">
and oae_left = #{oaeLeft,jdbcType=INTEGER}
</if>
<if test="oaeRight != null and oaeRight >= 0">
and oae_right = #{oaeRight,jdbcType=INTEGER}
</if>
<if test="aabrLeft != null and aabrLeft >= 0">
and aabr_left = #{aabrLeft,jdbcType=INTEGER}
</if>
<if test="aabrRight != null and aabrRight >= 0">
and aabr_right = #{aabrRight,jdbcType=INTEGER}
</if>
<if test="gjb2Del35 != null and gjb2Del35 >= 0">
and gjb2_del_35 = #{gjb2Del35,jdbcType=INTEGER}
</if>
<if test="gjb2Del176 != null and gjb2Del176 >= 0">
and gjb2_del_176 = #{gjb2Del176,jdbcType=INTEGER}
</if>
<if test="gjb2Del235 != null and gjb2Del235 >= 0">
and gjb2_del_235 = #{gjb2Del235,jdbcType=INTEGER}
</if>
<if test="gjb2Del299 != null and gjb2Del299 >= 0">
and gjb2_del_299 = #{gjb2Del299,jdbcType=INTEGER}
</if>
<if test="gjb3Slc26a4538 != null and gjb3Slc26a4538 >= 0">
and gjb3_slc26a4_538 = #{gjb3Slc26a4538,jdbcType=INTEGER}
</if>
<if test="gjb3Slc26a42168 != null and gjb3Slc26a42168 >= 0">
and gjb3_slc26a4_2168 = #{gjb3Slc26a42168,jdbcType=INTEGER}
</if>
<if test="gjb3Slc26a4Ivs7 != null and gjb3Slc26a4Ivs7 >= 0">
and gjb3_slc26a4_ivs7 = #{gjb3Slc26a4Ivs7,jdbcType=INTEGER}
</if>
<if test="processOptionType != null and processOptionType >= 0">
and process_option_type = #{processOptionType,jdbcType=INTEGER}
</if>
<if test="processOptionDesc != null and processOptionDesc != ''">
and process_option_desc = #{processOptionDesc,jdbcType=VARCHAR}
</if>
<if test="guidOpinion != null and guidOpinion != ''">
and guid_opinion = #{guidOpinion,jdbcType=VARCHAR}
</if>
<if test="checkDoctorId != null and checkDoctorId != ''">
and check_doctor_id = #{checkDoctorId,jdbcType=VARCHAR}
</if>
<if test="referralDate != null">
and referral_date = #{referralDate,jdbcType=TIMESTAMP}
</if>
<if test="createDate != null">
and create_date = #{createDate,jdbcType=TIMESTAMP}
</if>
<if test="createUserId != null and createUserId != ''">
and create_user_id = #{createUserId,jdbcType=VARCHAR}
</if>
<if test="createHospitalId != null and createHospitalId != ''">
and create_hospital_id = #{createHospitalId,jdbcType=VARCHAR}
</if>
<if test="lastUpdateDate != null">
and last_update_date = #{lastUpdateDate,jdbcType=TIMESTAMP}
</if>
<if test="lastUpdateUserId != null and lastUpdateUserId != ''">
and last_update_user_id = #{lastUpdateUserId,jdbcType=VARCHAR}
</if>
<if test="lastUpdateHospitalId != null and lastUpdateHospitalId != ''">
and last_update_hospital_id = #{lastUpdateHospitalId,jdbcType=VARCHAR}
</if>
<if test="status != null and status >= 0">
and status = #{status,jdbcType=INTEGER}
</if>

</where>
</sql>


<select id="queryBabyPatientExtendEarScreen" resultMap="BabyPatientExtendEarScreenResultMap"
parameterType="com.lyms.platform.permission.model.BabyPatientExtendEarScreenQuery">
select
id,baby_id,screen_type,check_hospital_id,screen_date,high_risk_cause,oae_left,oae_right,aabr_left,aabr_right,gjb2_del_35,gjb2_del_176,gjb2_del_235,gjb2_del_299,gjb3_slc26a4_538,gjb3_slc26a4_2168,gjb3_slc26a4_ivs7,process_option_type,process_option_desc,guid_opinion,check_doctor_id,referral_date,create_date,create_user_id,create_hospital_id,last_update_date,last_update_user_id,last_update_hospital_id,status
from baby_patient_extend_ear_screen
<include refid="BabyPatientExtendEarScreenCondition"/>
<include refid="orderAndLimit"/>
</select>

<select id="notAuscultationBabyPatientExtendEarScreen" resultMap="BabyPatientExtendEarScreenResultMap"
parameterType="com.lyms.platform.permission.model.BabyPatientExtendEarScreenQuery">
select
id,baby_id,screen_type,check_hospital_id,screen_date,high_risk_cause,oae_left,oae_right,aabr_left,aabr_right,gjb2_del_35,gjb2_del_176,gjb2_del_235,gjb2_del_299,gjb3_slc26a4_538,gjb3_slc26a4_2168,gjb3_slc26a4_ivs7,process_option_type,process_option_desc,guid_opinion,check_doctor_id,referral_date,create_date,create_user_id,create_hospital_id,last_update_date,last_update_user_id,last_update_hospital_id,status
from baby_patient_extend_ear_screen
<include refid="BabyPatientExtendEarScreenCondition"/>
<include refid="orderAndLimit"/>
</select>


<select id="queryBabyPatientExtendEarScreenCount" resultType="int"
parameterType="com.lyms.platform.permission.model.BabyPatientExtendEarScreenQuery">
select count(1) from baby_patient_extend_ear_screen
<include refid="BabyPatientExtendEarScreenCondition"/>
</select>

<select id="queryScrBabyIds" parameterType="com.lyms.platform.permission.model.BabyPatientExtendEarScreenQuery" resultType="String">
select DISTINCT baby_id from baby_patient_extend_ear_screen sc
<where>
<if test="checkHospitalIds!=null">
and sc.check_hospital_id in (
<foreach item="hsId" collection="checkHospitalIds" separator=",">
#{hsId}
</foreach>
)
</if>
/*根据儿童id进行查询*/
<if test="babyIds!=null">
and sc.baby_id in (
<foreach item="bId" collection="babyIds" separator=",">
#{bId}
</foreach>
)
</if>
ORDER BY sc.create_date DESC
</where>
</select>
</mapper>