BabyPatientExtendEar.xml 6.75 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
<?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.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"/>
</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) values (#{id},#{personId},#{createDate},#{createUserId},#{createHospitalId},#{lastUpdateDate},#{lastUpdateUserId},#{lastUpdateHospitalId},#{highRiskCause},#{status},#{babyPatientId})
</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="babyPatientId != null and babyPatientId != ''">
baby_patient_id = #{babyPatientId,jdbcType=VARCHAR},
</if>
<if test="status != null and status >= 0">
status = #{status,jdbcType=INTEGER},
</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 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="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="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 != ''">
baby_patient_id = #{babyPatientId,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 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>