BabyPatientExtendEar.xml 9.44 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
<?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.BabyPatientExtendEarMapper">

<resultMap id="BabyPatientExtendEarResultMap" type="com.lyms.platform.permission.model.BabyPatientExtendEar">
<id column="id" property="id" jdbcType="VARCHAR"/>
<result column="person_id" property="personId" jdbcType="VARCHAR"/>
<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="high_risk_cause" property="highRiskCause" jdbcType="VARCHAR"/>
<result column="status" property="status" jdbcType="INTEGER"/>
<result column="baby_patient_id" property="babyPatientId" jdbcType="VARCHAR"/>
<result column="admiss_no" property="admissNo" jdbcType="VARCHAR"/>
<result column="discharge_diagnosis" property="dischargeDiagnosis" jdbcType="VARCHAR"/>
<result column="bar_code" property="barCode" jdbcType="VARCHAR"/>
<result column="nation" property="nation" jdbcType="VARCHAR"/>
<result column="mhigh_risk_factor_id" property="mHighRiskFactorId" jdbcType="VARCHAR"/>
</resultMap>


<insert id="addBabyPatientExtendEar" parameterType="com.lyms.platform.permission.model.BabyPatientExtendEar">
insert into baby_patient_extend_ear (id,person_id,create_date,create_user_id,create_hospital_id,last_update_date,last_update_user_id,last_update_hospital_id,high_risk_cause,status,baby_patient_id,admiss_no,discharge_diagnosis,bar_code,nation,mhigh_risk_factor_id) values (#{id},#{personId},#{createDate},#{createUserId},#{createHospitalId},#{lastUpdateDate},#{lastUpdateUserId},#{lastUpdateHospitalId},#{highRiskCause},#{status},#{babyPatientId},#{admissNo},#{dischargeDiagnosis},#{barCode},#{nation},#{mHighRiskFactorId})
</insert>


<update id="updateBabyPatientExtendEar" parameterType="com.lyms.platform.permission.model.BabyPatientExtendEar">
update baby_patient_extend_ear
<set>
<if test="personId != null and personId != ''">
person_id = #{personId,jdbcType=VARCHAR},
</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="highRiskCause != null and highRiskCause != ''">
high_risk_cause = #{highRiskCause,jdbcType=VARCHAR},
</if>
<if test="status != null and status >= 0">
status = #{status,jdbcType=INTEGER},
</if>
<if test="babyPatientId != null and babyPatientId != ''">
baby_patient_id = #{babyPatientId,jdbcType=VARCHAR},
</if>
<if test="admissNo != null and admissNo != ''">
admiss_no = #{admissNo,jdbcType=VARCHAR},
</if>
<if test="dischargeDiagnosis != null and dischargeDiagnosis != ''">
discharge_diagnosis = #{dischargeDiagnosis,jdbcType=VARCHAR},
</if>
<if test="barCode != null and barCode != ''">
bar_code = #{barCode,jdbcType=VARCHAR},
</if>
<if test="nation != null and nation != ''">
nation = #{nation,jdbcType=VARCHAR},
</if>
<if test="mHighRiskFactorId != null and mHighRiskFactorId != ''">
mhigh_risk_factor_id = #{mHighRiskFactorId,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>


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


<select id="getBabyPatientExtendEar" resultMap="BabyPatientExtendEarResultMap" parameterType="java.lang.String">
select id,person_id,create_date,create_user_id,create_hospital_id,last_update_date,last_update_user_id,last_update_hospital_id,high_risk_cause,status,baby_patient_id,admiss_no,discharge_diagnosis,bar_code,nation,mhigh_risk_factor_id
from baby_patient_extend_ear 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="BabyPatientExtendEarCondition">
<where>
1 = 1
<if test="id != null and id != ''">
and id = #{id,jdbcType=VARCHAR}
</if>
<if test="babyPatientIds!=null">
and baby_patient_id in (
<foreach item="babyPatientId" collection="babyPatientIds" separator="," >
#{babyPatientId}
</foreach>
)
</if>
<if test="personId != null and personId != ''">
and person_id = #{personId,jdbcType=VARCHAR}
</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="createHospitalIds != null">
and create_hospital_id in
<foreach item="item" index="index" collection="createHospitalIds" open="(" separator="," close=")">
#{item}
</foreach>
</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="highRiskCause != null and highRiskCause != ''">
and high_risk_cause = #{highRiskCause,jdbcType=VARCHAR}
</if>
<if test="status != null and status >= 0">
and status = #{status,jdbcType=INTEGER}
</if>
<if test="babyPatientId != null and babyPatientId != ''">
and baby_patient_id = #{babyPatientId,jdbcType=VARCHAR}
</if>
<if test="admissNo != null and admissNo != ''">
and admiss_no = #{admissNo,jdbcType=VARCHAR}
</if>
<if test="dischargeDiagnosis != null and dischargeDiagnosis != ''">
and discharge_diagnosis = #{dischargeDiagnosis,jdbcType=VARCHAR}
</if>
<if test="barCode != null and barCode != ''">
and bar_code = #{barCode,jdbcType=VARCHAR}
</if>
<if test="nation != null and nation != ''">
and nation = #{nation,jdbcType=VARCHAR}
</if>
<if test="mHighRiskFactorId != null and mHighRiskFactorId != ''">
and mhigh_risk_factor_id = #{mHighRiskFactorId,jdbcType=VARCHAR}
</if>
</where>
</sql>


<select id="queryBabyPatientExtendEar" resultMap="BabyPatientExtendEarResultMap"
parameterType="com.lyms.platform.permission.model.BabyPatientExtendEarQuery">
select
id,person_id,create_date,create_user_id,create_hospital_id,last_update_date,last_update_user_id,last_update_hospital_id,high_risk_cause,status,baby_patient_id,admiss_no,discharge_diagnosis,bar_code,nation,mhigh_risk_factor_id
from baby_patient_extend_ear
<include refid="BabyPatientExtendEarCondition"/>
<include refid="orderAndLimit"/>
</select>


<select id="queryBabyPatientExtendEarCount" resultType="int"
parameterType="com.lyms.platform.permission.model.BabyPatientExtendEarQuery">
select count(1) from baby_patient_extend_ear
<include refid="BabyPatientExtendEarCondition"/>
</select>


</mapper>