BabyPatientExtendEarFollowUp.xml 12.1 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
<?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.BabyPatientExtendEarFollowUpMapper">

<resultMap id="BabyPatientExtendEarFollowUpResultMap"
type="com.lyms.platform.permission.model.BabyPatientExtendEarFollowUp">
<id column="id" property="id" jdbcType="VARCHAR"/>
<result column="baby_id" property="babyId" jdbcType="VARCHAR"/>
<result column="follow_time" property="followTime" jdbcType="TIMESTAMP"/>
<result column="follow_addr" property="followAddr" jdbcType="VARCHAR"/>
<result column="mark_time" property="markTime" jdbcType="TIMESTAMP"/>
<result column="mark_result" property="markResult" jdbcType="VARCHAR"/>
<result column="mark_detail" property="markDetail" jdbcType="VARCHAR"/>
<result column="follow_info" property="followInfo" jdbcType="VARCHAR"/>
<result column="audiphone" property="audiphone" jdbcType="INTEGER"/>
<result column="operation" property="operation" jdbcType="INTEGER"/>
<result column="artifi_cochlea" property="artifiCochlea" jdbcType="INTEGER"/>
<result column="guide_opinion" property="guideOpinion" jdbcType="VARCHAR"/>
<result column="follow_doctor_name" property="followDoctorName" jdbcType="VARCHAR"/>
<result column="follow_doctor_id" property="followDoctorId" jdbcType="VARCHAR"/>
<result column="next_time" property="nextTime" jdbcType="TIMESTAMP"/>
<result column="ifdel" property="ifdel" jdbcType="INTEGER"/>
<result column="ifclose" property="ifclose" jdbcType="INTEGER"/>
<result column="hospital_id" property="hospitalId" jdbcType="VARCHAR"/>
<result column="modify_time" property="modifyTime" jdbcType="TIMESTAMP"/>
<result column="modify_id" property="modifyId" jdbcType="VARCHAR"/>
<result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
<result column="create_id" property="createId" jdbcType="VARCHAR"/>
<result column="enalble" property="enalble" jdbcType="INTEGER"/>
</resultMap>


<insert id="addBabyPatientExtendEarFollowUp"
parameterType="com.lyms.platform.permission.model.BabyPatientExtendEarFollowUp">
insert into baby_patient_extend_ear_follow_up
(id,baby_id,follow_time,follow_addr,mark_time,mark_result,mark_detail,follow_info,audiphone,operation,artifi_cochlea,guide_opinion,follow_doctor_name,follow_doctor_id,next_time,ifdel,ifclose,hospital_id,modify_time,modify_id,create_time,create_id,enalble)
values
(#{id},#{babyId},#{followTime},#{followAddr},#{markTime},#{markResult},#{markDetail},#{followInfo},#{audiphone},#{operation},#{artifiCochlea},#{guideOpinion},#{followDoctorName},#{followDoctorId},#{nextTime},#{ifdel},#{ifclose},#{hospitalId},#{modifyTime},#{modifyId},#{createTime},#{createId},#{enalble})
</insert>


<update id="updateBabyPatientExtendEarFollowUp"
parameterType="com.lyms.platform.permission.model.BabyPatientExtendEarFollowUp">
update baby_patient_extend_ear_follow_up
<set>
<if test="babyId != null and babyId != ''">
baby_id = #{babyId,jdbcType=VARCHAR},
</if>
<if test="followTime != null">
follow_time = #{followTime,jdbcType=TIMESTAMP},
</if>
<if test="followAddr != null and followAddr != ''">
follow_addr = #{followAddr,jdbcType=VARCHAR},
</if>
<if test="markTime != null">
mark_time = #{markTime,jdbcType=TIMESTAMP},
</if>
<if test="markResult != null and markResult != ''">
mark_result = #{markResult,jdbcType=VARCHAR},
</if>
<if test="markDetail != null and markDetail != ''">
mark_detail = #{markDetail,jdbcType=VARCHAR},
</if>
<if test="followInfo != null and followInfo != ''">
follow_info = #{followInfo,jdbcType=VARCHAR},
</if>
<if test="audiphone != null and audiphone >= 0">
audiphone = #{audiphone,jdbcType=INTEGER},
</if>
<if test="operation != null and operation >= 0">
operation = #{operation,jdbcType=INTEGER},
</if>
<if test="artifiCochlea != null and artifiCochlea >= 0">
artifi_cochlea = #{artifiCochlea,jdbcType=INTEGER},
</if>
<if test="guideOpinion != null and guideOpinion != ''">
guide_opinion = #{guideOpinion,jdbcType=VARCHAR},
</if>
<if test="followDoctorName != null and followDoctorName != ''">
follow_doctor_name = #{followDoctorName,jdbcType=VARCHAR},
</if>
<if test="followDoctorId != null and followDoctorId != ''">
follow_doctor_id = #{followDoctorId,jdbcType=VARCHAR},
</if>
<if test="nextTime != null">
next_time = #{nextTime,jdbcType=TIMESTAMP},
</if>
<if test="ifdel != null and ifdel >= 0">
ifdel = #{ifdel,jdbcType=INTEGER},
</if>
<if test="ifclose != null and ifclose >= 0">
ifclose = #{ifclose,jdbcType=INTEGER},
</if>
<if test="hospitalId != null and hospitalId != ''">
hospital_id = #{hospitalId,jdbcType=VARCHAR},
</if>
<if test="modifyTime != null">
modify_time = #{modifyTime,jdbcType=TIMESTAMP},
</if>
<if test="modifyId != null and modifyId != ''">
modify_id = #{modifyId,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="createId != null and createId != ''">
create_id = #{createId,jdbcType=VARCHAR},
</if>
<if test="enalble != null and enalble >= 0">
enalble = #{enalble,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>


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


<select id="getBabyPatientExtendEarFollowUp" resultMap="BabyPatientExtendEarFollowUpResultMap"
parameterType="java.lang.String">
select id,baby_id,follow_time,follow_addr,mark_time,mark_result,mark_detail,follow_info,audiphone,operation,artifi_cochlea,guide_opinion,follow_doctor_name,follow_doctor_id,next_time,ifdel,ifclose,hospital_id,modify_time,modify_id,create_time,create_id,enalble
from baby_patient_extend_ear_follow_up 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="BabyPatientExtendEarFollowUpCondition">
<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="followTime != null">
and follow_time = #{followTime,jdbcType=TIMESTAMP}
</if>-->
<if test="followUpStartTime != null">
and follow_time >= #{followUpStartTime,jdbcType=TIMESTAMP}
</if>
<if test="followUpEndTime != null and followAddr != ''">
and follow_addr <![CDATA[<]]>= #{followUpEndTime,jdbcType=VARCHAR}
</if>
<if test="markTime != null">
and mark_time = #{markTime,jdbcType=TIMESTAMP}
</if>
<if test="markResult != null and markResult != ''">
and mark_result like concat("%",#{markResult},"%")
</if>
<if test="markDetail != null and markDetail != ''">
and mark_detail = #{markDetail,jdbcType=VARCHAR}
</if>
<if test="followInfo != null and followInfo != ''">
and follow_info = #{followInfo,jdbcType=VARCHAR}
</if>

<if test="interCure != null and interCure == 1">
and artifi_cochlea is not null
</if>
<if test="interCure != null and interCure == 2">
and audiphone is not null
</if>
<if test="interCure != null and interCure == 3">
and operation is not null
</if>

<if test="audiphone != null and audiphone >= 0">
and audiphone = #{audiphone,jdbcType=INTEGER}
</if>
<if test="operation != null and operation >= 0">
and operation = #{operation,jdbcType=INTEGER}
</if>
<if test="artifiCochlea != null and artifiCochlea >= 0">
and artifi_cochlea = #{artifiCochlea,jdbcType=INTEGER}
</if>
<if test="guideOpinion != null and guideOpinion != ''">
and guide_opinion = #{guideOpinion,jdbcType=VARCHAR}
</if>
<if test="followDoctorName != null and followDoctorName != ''">
and follow_doctor_name = #{followDoctorName,jdbcType=VARCHAR}
</if>
<if test="followDoctorId != null and followDoctorId != ''">
and follow_doctor_id = #{followDoctorId,jdbcType=VARCHAR}
</if>
<if test="nextStartTime != null">
and next_time >= #{nextStartTime,jdbcType=TIMESTAMP}
</if>
<if test="nextEndTime != null">
and next_time <![CDATA[<]]>= #{nextEndTime,jdbcType=TIMESTAMP}
</if>
<if test="nextTime != null">
and next_time = #{nextTime,jdbcType=TIMESTAMP}
</if>
<if test="ifdel != null and ifdel >= 0">
and ifdel = #{ifdel,jdbcType=INTEGER}
</if>
<if test="ifclose != null and ifclose >= 0">
and ifclose = #{ifclose,jdbcType=INTEGER}
</if>
<if test="hospitalId != null and hospitalId != ''">
and hospital_id = #{hospitalId,jdbcType=VARCHAR}
</if>
<if test="modifyTime != null">
and modify_time = #{modifyTime,jdbcType=TIMESTAMP}
</if>
<if test="modifyId != null and modifyId != ''">
and modify_id = #{modifyId,jdbcType=VARCHAR}
</if>
<if test="createTime != null">
and create_time = #{createTime,jdbcType=TIMESTAMP}
</if>
<if test="createId != null and createId != ''">
and create_id = #{createId,jdbcType=VARCHAR}
</if>
<if test="enalble != null and enalble >= 0">
and enalble = #{enalble,jdbcType=INTEGER}
</if>
</where>
</sql>


<select id="queryBabyPatientExtendEarFollowUp" resultMap="BabyPatientExtendEarFollowUpResultMap"
parameterType="com.lyms.platform.permission.model.BabyPatientExtendEarFollowUpQuery">
select
id,baby_id,follow_time,follow_addr,mark_time,mark_result,mark_detail,follow_info,audiphone,operation,artifi_cochlea,guide_opinion,follow_doctor_name,follow_doctor_id,next_time,ifdel,ifclose,hospital_id,modify_time,modify_id,create_time,create_id,enalble
from baby_patient_extend_ear_follow_up
<include refid="BabyPatientExtendEarFollowUpCondition"/>
<include refid="orderAndLimit"/>
</select>


<select id="queryBabyPatientExtendEarFollowUpCount" resultType="int"
parameterType="com.lyms.platform.permission.model.BabyPatientExtendEarFollowUpQuery">
select count(1) from baby_patient_extend_ear_follow_up
<include refid="BabyPatientExtendEarFollowUpCondition"/>
</select>


</mapper>