BabyPatientExtendEarFamily.xml 6.21 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
<?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.BabyPatientExtendEarFamilyMapper">

<resultMap id="BabyPatientExtendEarFamilyResultMap"
type="com.lyms.platform.permission.model.BabyPatientExtendEarFamily">
<id column="id" property="id" jdbcType="VARCHAR"/>
<result column="bad_life_history_type" property="badLifeHistoryType" jdbcType="INTEGER"/>
<result column="bad_life_type_id" property="badLifeTypeId" jdbcType="VARCHAR"/>
<result column="deaf_type" property="deafType" jdbcType="INTEGER"/>
<result column="deat_relationship" property="deatRelationship" jdbcType="VARCHAR"/>
<result column="deaf_desc" property="deafDesc" jdbcType="VARCHAR"/>
<result column="proximity_type" property="proximityType" jdbcType="INTEGER"/>
<result column="proximity_relationship" property="proximityRelationship" jdbcType="VARCHAR"/>
<result column="baby_patient_id" property="babyPatientId" jdbcType="VARCHAR"/>
</resultMap>


<insert id="addBabyPatientExtendEarFamily"
parameterType="com.lyms.platform.permission.model.BabyPatientExtendEarFamily">
insert into baby_patient_extend_ear_family (id,bad_life_history_type,bad_life_type_id,deaf_type,deat_relationship,deaf_desc,proximity_type,proximity_relationship,baby_patient_id) values (#{id},#{badLifeHistoryType},#{badLifeTypeId},#{deafType},#{deatRelationship},#{deafDesc},#{proximityType},#{proximityRelationship},#{babyPatientId})
</insert>


<update id="updateBabyPatientExtendEarFamily"
parameterType="com.lyms.platform.permission.model.BabyPatientExtendEarFamily">
update baby_patient_extend_ear_family
<set>
<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="deafType != null and deafType >= 0">
deaf_type = #{deafType,jdbcType=INTEGER},
</if>
<if test="deatRelationship != null and deatRelationship != ''">
deat_relationship = #{deatRelationship,jdbcType=VARCHAR},
</if>
<if test="deafDesc != null and deafDesc != ''">
deaf_desc = #{deafDesc,jdbcType=VARCHAR},
</if>
<if test="proximityType != null and proximityType >= 0">
proximity_type = #{proximityType,jdbcType=INTEGER},
</if>
<if test="proximityRelationship != null and proximityRelationship != ''">
proximity_relationship = #{proximityRelationship,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="deleteBabyPatientExtendEarFamily" parameterType="java.lang.String">
delete from baby_patient_extend_ear_family where id = #{id,jdbcType=VARCHAR}
</delete>


<select id="getBabyPatientExtendEarFamily" resultMap="BabyPatientExtendEarFamilyResultMap"
parameterType="java.lang.String">
select id,bad_life_history_type,bad_life_type_id,deaf_type,deat_relationship,deaf_desc,proximity_type,proximity_relationship,baby_patient_id
from baby_patient_extend_ear_family 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="BabyPatientExtendEarFamilyCondition">
<where>
1 = 1
<if test="id != null and id != ''">
and id = #{id,jdbcType=VARCHAR}
</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="deafType != null and deafType >= 0">
and deaf_type = #{deafType,jdbcType=INTEGER}
</if>
<if test="deatRelationship != null and deatRelationship != ''">
and deat_relationship = #{deatRelationship,jdbcType=VARCHAR}
</if>
<if test="deafDesc != null and deafDesc != ''">
and deaf_desc = #{deafDesc,jdbcType=VARCHAR}
</if>
<if test="proximityType != null and proximityType >= 0">
and proximity_type = #{proximityType,jdbcType=INTEGER}
</if>
<if test="proximityRelationship != null and proximityRelationship != ''">
and proximity_relationship = #{proximityRelationship,jdbcType=VARCHAR}
</if>
<if test="babyPatientId != null and babyPatientId != ''">
and baby_patient_id = #{babyPatientId,jdbcType=VARCHAR}
</if>
</where>
</sql>


<select id="queryBabyPatientExtendEarFamily" resultMap="BabyPatientExtendEarFamilyResultMap"
parameterType="com.lyms.platform.permission.model.BabyPatientExtendEarFamilyQuery">
select
id,bad_life_history_type,bad_life_type_id,deaf_type,deat_relationship,deaf_desc,proximity_type,proximity_relationship,baby_patient_id
from baby_patient_extend_ear_family
<include refid="BabyPatientExtendEarFamilyCondition"/>
<include refid="orderAndLimit"/>
</select>


<select id="queryBabyPatientExtendEarFamilyCount" resultType="int"
parameterType="com.lyms.platform.permission.model.BabyPatientExtendEarFamilyQuery">
select count(1) from baby_patient_extend_ear_family
<include refid="BabyPatientExtendEarFamilyCondition"/>
</select>


</mapper>