MeasureUserInfoMapper.xml 6.8 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
<?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.MeasureUserInfoMapper">

<resultMap type="com.lyms.platform.pojo.MeasureUserInfoModel" id="measureUserInfoModelMap">
<result column="id" property="id"/>
<result column="user_name" property="userName"/>
<result column="cert_type" property="certType"/>
<result column="cert_no" property="certNo"/>
<result column="age" property="age"/>
<result column="phone" property="phone"/>
<result column="sex" property="sex"/>
<result column="vc_card_no" property="vcCardNo"/>
<result column="hospital_id" property="hospitalId"/>
<result column="created" property="created"/>
<result column="modified" property="modified"/>
<result column="zy_no" property="zyNo"/>
<result column="visit_id" property="visitId"/>
<result column="patient_id" property="patientId"/>
<result column="address" property="address"/>
<result column="face" property="face"/>
<result column="finger" property="finger"/>
<result column="is_zy" property="isZy"/>
</resultMap>
<insert id="addMeasureUserInfo" parameterType="com.lyms.platform.pojo.MeasureUserInfoModel" >
<selectKey order="AFTER" keyProperty="id" resultType="java.lang.Integer"> SELECT LAST_INSERT_ID() </selectKey>
INSERT INTO measure_user_info(
user_name,cert_type,
cert_no,age,phone,sex,vc_card_no,
created,modified,hospital_id,zy_no,visit_id,patient_id,address,face,finger,is_zy)
VALUES (#{userName},#{certType},
#{certNo},#{age},#{phone},#{sex}
,#{vcCardNo},#{created},#{modified},
#{hospitalId},#{zyNo},#{visitId},#{patientId},#{address},#{face},#{finger},#{isZy})
</insert>

<select id="queryMeasureUserInfoList" parameterType="com.lyms.platform.query.MeasureUserInfoQuery"
resultMap="measureUserInfoModelMap">
SELECT id,user_name,cert_type,
cert_no,age,phone,sex,vc_card_no,
created,modified,hospital_id,zy_no,visit_id,patient_id,address,face,finger,is_zy
FROM measure_user_info

<include refid="queryMeasureUserInfoCondition"/>
<include refid="orderAndLimit"/>
</select>

<select id="queryMeasureUserInfoListCount" parameterType="com.lyms.platform.query.MeasureUserInfoQuery" resultType="int">
SELECT count(id) FROM measure_user_info
<include refid="queryMeasureUserInfoCondition"/>
</select>


<update id="updateMeasureUserInfo" parameterType="com.lyms.platform.pojo.MeasureUserInfoModel" >
UPDATE
measure_user_info
<set>
<if test="id != null and id >= 0">
id = #{id,jdbcType=INTEGER},
</if>
<if test="userName != null">
user_name = #{userName,jdbcType=VARCHAR},
</if>
<if test="certType != null">
cert_type = #{certType,jdbcType=VARCHAR},
</if>
<if test="certNo != null">
cert_no = #{certNo,jdbcType=VARCHAR},
</if>
<if test="age != null and age >= 0">
age = #{age,jdbcType=INTEGER},
</if>
<if test="isZy != null and isZy >= 0">
is_zy = #{isZy,jdbcType=INTEGER},
</if>
<if test="phone != null">
phone = #{phone,jdbcType=VARCHAR},
</if>
<if test="sex != null">
sex = #{sex,jdbcType=INTEGER},
</if>
<if test="vcCardNo != null">
vc_card_no = #{vcCardNo,jdbcType=VARCHAR},
</if>
<if test="zyNo != null and zyNo != ''">
zy_no = #{zyNo,jdbcType=VARCHAR},
</if>
<if test="visitId != null and visitId != ''">
visit_id = #{visitId,jdbcType=VARCHAR},
</if>
<if test="patientId != null and patientId != ''">
patient_id = #{patientId,jdbcType=VARCHAR},
</if>
<if test="hospitalId != null and hospitalId != ''">
hospital_id = #{hospitalId,jdbcType=VARCHAR},
</if>
<if test="created != null">
created = #{created},
</if>
<if test="modified != null">
modified = #{modified},
</if>
<if test="address != null and address != ''">
address = #{address,jdbcType=VARCHAR},
</if>
<if test="face != null and face != ''">
face = #{face,jdbcType=VARCHAR},
</if>
<if test="finger != null and finger != ''">
finger = #{finger,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>


<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="queryMeasureUserInfoCondition">
<where>
1 = 1
<if test="id != null and id >= 0">
and id = #{id,jdbcType=INTEGER}
</if>
<if test="userName != null">
and user_name = #{userName,jdbcType=VARCHAR}
</if>
<if test="certType != null and certType != ''">
and cert_type = #{certType,jdbcType=VARCHAR}
</if>
<if test="certNo != null and certNo != ''">
and cert_no = #{certNo,jdbcType=VARCHAR}
</if>
<if test="age != null and age != ''">
and age = #{age,jdbcType=VARCHAR}
</if>
<if test="phone != null and phone != ''">
and phone = #{phone,jdbcType=VARCHAR}
</if>
<if test="sex != null">
and sex = #{sex,jdbcType=INTEGER}
</if>
<if test="isZy != null">
and is_zy = #{isZy,jdbcType=INTEGER}
</if>
<if test="vcCardNo != null and vcCardNo != ''">
and vc_card_no = #{vcCardNo,jdbcType=VARCHAR}
</if>
<if test="zyNo != null and zyNo != ''">
and zy_no = #{zyNo,jdbcType=VARCHAR}
</if>
<if test="visitId != null and visitId != ''">
and visit_id = #{visitId,jdbcType=VARCHAR}
</if>
<if test="patientId != null and patientId != ''">
and patient_id = #{valueOne,jdbcType=VARCHAR}
</if>
<if test="createdTimeStart != null">
AND created >= date_format(#{createdTimeStart},'%Y-%m-%d')
</if>
<if test="createdTimeEnd != null">
AND <![CDATA[ created < date_format(#{createdTimeEnd},'%Y-%m-%d') ]]>
</if>

<if test="modifiedTimeStart != null">
AND modified >= date_format(#{modifiedTimeStart},'%Y-%m-%d')
</if>
<if test="modifiedTimeEnd != null">
AND <![CDATA[ modified < date_format(#{modifiedTimeEnd},'%Y-%m-%d') ]]>
</if>

<if test="queryNo != null and queryNo != ''">
and (phone = #{queryNo,jdbcType=VARCHAR} or cert_no = #{queryNo,jdbcType=VARCHAR}
or user_name = #{queryNo,jdbcType=VARCHAR})
</if>
<if test="hospitalId != null and hospitalId != ''">
and hospital_id = #{hospitalId,jdbcType=VARCHAR}
</if>
<if test="hospitalIds != null and hospitalIds.size() > 0">
and hospital_id in
<foreach collection="hospitalIds" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="address != null and address != ''">
and address = #{address,jdbcType=VARCHAR}
</if>
<if test="face != null and face != ''">
and face = #{face,jdbcType=VARCHAR}
</if>
<if test="finger != null and finger != ''">
and finger = #{finger,jdbcType=VARCHAR}
</if>
</where>
</sql>

</mapper>