ChildrenRecord.xml 10 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
<?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.ChildrenRecordMapper">

<resultMap id="ChildrenRecordResultMap" type="com.lyms.platform.permission.model.ChildrenRecord">
<result column="ID" property="id" jdbcType="VARCHAR"/>
<result column="CHILD_ID" property="childId" jdbcType="VARCHAR"/>
<result column="GESTATIONAL_WEEK" property="gestationalWeek" jdbcType="VARCHAR"/>
<result column="CHILDBIRTH_TYPE" property="childbirthType" jdbcType="INTEGER"/>
<result column="FETUS_NUM" property="fetusNum" jdbcType="INTEGER"/>
<result column="BIRTH_NUM" property="birthNum" jdbcType="INTEGER"/>
<result column="WEIGHT" property="weight" jdbcType="FLOAT"/>
<result column="HEIGHT" property="height" jdbcType="FLOAT"/>
<result column="HEAD_CIRCLE" property="headCircle" jdbcType="FLOAT"/>
<result column="APGAR_SCORE_ONE" property="apgarScoreOne" jdbcType="INTEGER"/>
<result column="APGAR_SCORE_FIVE" property="apgarScoreFive" jdbcType="INTEGER"/>
<result column="APGAR_SCORE_TEN" property="apgarScoreTen" jdbcType="INTEGER"/>
<result column="IS_DEFORMITY" property="isDeformity" jdbcType="INTEGER"/>
<result column="BIRTH_HOSPITAL" property="birthHospital" jdbcType="VARCHAR"/>
<result column="MEDICAL_CARD_NUMBER" property="medicalCardNumber" jdbcType="VARCHAR"/>
<result column="INPATIENT_NUMBER" property="inpatientNumber" jdbcType="VARCHAR"/>
<result column="SERVICE_TYPE" property="serviceType" jdbcType="INTEGER"/>
<result column="SERVICE_STATUS" property="serviceStatus" jdbcType="INTEGER"/>
<result column="REMARK" property="remark" jdbcType="VARCHAR"/>
<result column="CREATE_TIME" property="createTime" jdbcType="TIMESTAMP"/>
</resultMap>


<insert id="addChildrenRecord" parameterType="com.lyms.platform.permission.model.ChildrenRecord">
insert into CHILDREN_RECORD (ID,CHILD_ID,GESTATIONAL_WEEK,CHILDBIRTH_TYPE,FETUS_NUM,BIRTH_NUM,WEIGHT,HEIGHT,HEAD_CIRCLE,APGAR_SCORE_ONE,APGAR_SCORE_FIVE,APGAR_SCORE_TEN,IS_DEFORMITY,BIRTH_HOSPITAL,MEDICAL_CARD_NUMBER,INPATIENT_NUMBER,SERVICE_TYPE,SERVICE_STATUS,REMARK,CREATE_TIME) values (#{id},#{childId},#{gestationalWeek},#{childbirthType},#{fetusNum},#{birthNum},#{weight},#{height},#{headCircle},#{apgarScoreOne},#{apgarScoreFive},#{apgarScoreTen},#{isDeformity},#{birthHospital},#{medicalCardNumber},#{inpatientNumber},#{serviceType},#{serviceStatus},#{remark},#{createTime})
</insert>


<update id="updateChildrenRecord" parameterType="com.lyms.platform.permission.model.ChildrenRecord">
update CHILDREN_RECORD
<set>
<if test="id != null and id != ''">
ID = #{id,jdbcType=VARCHAR},
</if>
<if test="childId != null and childId != ''">
CHILD_ID = #{childId,jdbcType=VARCHAR},
</if>
<if test="gestationalWeek != null and gestationalWeek != ''">
GESTATIONAL_WEEK = #{gestationalWeek,jdbcType=VARCHAR},
</if>
<if test="childbirthType != null and childbirthType >= 0">
CHILDBIRTH_TYPE = #{childbirthType,jdbcType=INTEGER},
</if>
<if test="fetusNum != null and fetusNum >= 0">
FETUS_NUM = #{fetusNum,jdbcType=INTEGER},
</if>
<if test="birthNum != null and birthNum >= 0">
BIRTH_NUM = #{birthNum,jdbcType=INTEGER},
</if>
<if test="weight != null">
WEIGHT = #{weight,jdbcType=FLOAT},
</if>
<if test="height != null">
HEIGHT = #{height,jdbcType=FLOAT},
</if>
<if test="headCircle != null">
HEAD_CIRCLE = #{headCircle,jdbcType=FLOAT},
</if>
<if test="apgarScoreOne != null and apgarScoreOne >= 0">
APGAR_SCORE_ONE = #{apgarScoreOne,jdbcType=INTEGER},
</if>
<if test="apgarScoreFive != null and apgarScoreFive >= 0">
APGAR_SCORE_FIVE = #{apgarScoreFive,jdbcType=INTEGER},
</if>
<if test="apgarScoreTen != null and apgarScoreTen >= 0">
APGAR_SCORE_TEN = #{apgarScoreTen,jdbcType=INTEGER},
</if>
<if test="isDeformity != null and isDeformity >= 0">
IS_DEFORMITY = #{isDeformity,jdbcType=INTEGER},
</if>
<if test="birthHospital != null and birthHospital != ''">
BIRTH_HOSPITAL = #{birthHospital,jdbcType=VARCHAR},
</if>
<if test="medicalCardNumber != null and medicalCardNumber != ''">
MEDICAL_CARD_NUMBER = #{medicalCardNumber,jdbcType=VARCHAR},
</if>
<if test="inpatientNumber != null and inpatientNumber != ''">
INPATIENT_NUMBER = #{inpatientNumber,jdbcType=VARCHAR},
</if>
<if test="serviceType != null and serviceType >= 0">
SERVICE_TYPE = #{serviceType,jdbcType=INTEGER},
</if>
<if test="serviceStatus != null and serviceStatus >= 0">
SERVICE_STATUS = #{serviceStatus,jdbcType=INTEGER},
</if>
<if test="remark != null and remark != ''">
REMARK = #{remark,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
CREATE_TIME = #{createTime,jdbcType=TIMESTAMP},
</if>
</set>
</update>


<delete id="deleteChildrenRecord" parameterType="java.lang.String">
</delete>


<select id="getChildrenRecord" resultMap="ChildrenRecordResultMap" parameterType="java.lang.String">
select ID,CHILD_ID,GESTATIONAL_WEEK,CHILDBIRTH_TYPE,FETUS_NUM,BIRTH_NUM,WEIGHT,HEIGHT,HEAD_CIRCLE,APGAR_SCORE_ONE,APGAR_SCORE_FIVE,APGAR_SCORE_TEN,IS_DEFORMITY,BIRTH_HOSPITAL,MEDICAL_CARD_NUMBER,INPATIENT_NUMBER,SERVICE_TYPE,SERVICE_STATUS,REMARK,CREATE_TIME
</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="ChildrenRecordCondition">
<where>
1 = 1
<if test="id != null and id != ''">
and ID = #{id,jdbcType=VARCHAR}
</if>
<if test="childId != null and childId != ''">
and CHILD_ID = #{childId,jdbcType=VARCHAR}
</if>
<if test="gestationalWeek != null and gestationalWeek != ''">
and GESTATIONAL_WEEK = #{gestationalWeek,jdbcType=VARCHAR}
</if>
<if test="childbirthType != null and childbirthType >= 0">
and CHILDBIRTH_TYPE = #{childbirthType,jdbcType=INTEGER}
</if>
<if test="fetusNum != null and fetusNum >= 0">
and FETUS_NUM = #{fetusNum,jdbcType=INTEGER}
</if>
<if test="birthNum != null and birthNum >= 0">
and BIRTH_NUM = #{birthNum,jdbcType=INTEGER}
</if>
<if test="weight != null">
and WEIGHT = #{weight,jdbcType=FLOAT}
</if>
<if test="height != null">
and HEIGHT = #{height,jdbcType=FLOAT}
</if>
<if test="headCircle != null">
and HEAD_CIRCLE = #{headCircle,jdbcType=FLOAT}
</if>
<if test="apgarScoreOne != null and apgarScoreOne >= 0">
and APGAR_SCORE_ONE = #{apgarScoreOne,jdbcType=INTEGER}
</if>
<if test="apgarScoreFive != null and apgarScoreFive >= 0">
and APGAR_SCORE_FIVE = #{apgarScoreFive,jdbcType=INTEGER}
</if>
<if test="apgarScoreTen != null and apgarScoreTen >= 0">
and APGAR_SCORE_TEN = #{apgarScoreTen,jdbcType=INTEGER}
</if>
<if test="isDeformity != null and isDeformity >= 0">
and IS_DEFORMITY = #{isDeformity,jdbcType=INTEGER}
</if>
<if test="birthHospital != null and birthHospital != ''">
and BIRTH_HOSPITAL = #{birthHospital,jdbcType=VARCHAR}
</if>
<if test="medicalCardNumber != null and medicalCardNumber != ''">
and MEDICAL_CARD_NUMBER = #{medicalCardNumber,jdbcType=VARCHAR}
</if>
<if test="inpatientNumber != null and inpatientNumber != ''">
and INPATIENT_NUMBER = #{inpatientNumber,jdbcType=VARCHAR}
</if>
<if test="serviceType != null and serviceType >= 0">
and SERVICE_TYPE = #{serviceType,jdbcType=INTEGER}
</if>
<if test="serviceStatus != null and serviceStatus >= 0">
and SERVICE_STATUS = #{serviceStatus,jdbcType=INTEGER}
</if>
<if test="remark != null and remark != ''">
and REMARK = #{remark,jdbcType=VARCHAR}
</if>
<if test="createTime != null">
and CREATE_TIME = #{createTime,jdbcType=TIMESTAMP}
</if>
</where>
</sql>


<select id="queryChildrenRecord" resultMap="ChildrenRecordResultMap"
parameterType="com.lyms.platform.permission.model.ChildrenRecordQuery">
select
ID,CHILD_ID,GESTATIONAL_WEEK,CHILDBIRTH_TYPE,FETUS_NUM,BIRTH_NUM,WEIGHT,HEIGHT,HEAD_CIRCLE,APGAR_SCORE_ONE,APGAR_SCORE_FIVE,APGAR_SCORE_TEN,IS_DEFORMITY,BIRTH_HOSPITAL,MEDICAL_CARD_NUMBER,INPATIENT_NUMBER,SERVICE_TYPE,SERVICE_STATUS,REMARK,CREATE_TIME
from CHILDREN_RECORD
<include refid="ChildrenRecordCondition"/>
<include refid="orderAndLimit"/>
</select>


<select id="queryChildrenRecordCount" resultType="int"
parameterType="com.lyms.platform.permission.model.ChildrenRecordQuery">
select count(1) from CHILDREN_RECORD
<include refid="ChildrenRecordCondition"/>
</select>


</mapper>