AssistBuildMapper.xml 2.33 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
<?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.AssistBuildMapper">

<insert id="addAssistBuildUser" parameterType="com.lyms.platform.pojo.AssistBuildUserModel" >
<selectKey order="AFTER" keyProperty="id" resultType="java.lang.Integer"> SELECT LAST_INSERT_ID() </selectKey>
INSERT INTO lyms_assist_user
(phone,card_no, user_name,password,qr_code,hospital_id, created,modified)
VALUES (#{phone},#{cardNo},#{userName},#{password},#{qrCode},#{hospitalId},#{created},#{modified})
</insert>


<select id="queryAssistBuildUsers" parameterType="java.util.Map" resultType="com.lyms.platform.pojo.AssistBuildUserModel">
SELECT
id,phone,card_no as cardNo, user_name as userName,password,qr_code as qrCode,hospital_id as hospitalId, created,modified
FROM lyms_assist_user
WHERE 1 = 1
<if test="id != null">
and id = #{id,jdbcType=INTEGER}
</if>
<if test="phone != null and phone != ''">
and phone = #{phone,jdbcType=VARCHAR}
</if>
<if test="hospitalId != null and hospitalId != ''">
and hospital_id = #{hospitalId,jdbcType=VARCHAR}
</if>
</select>


<update id="updateAssistBuildUser" parameterType="com.lyms.platform.pojo.AssistBuildUserModel" >
UPDATE
lyms_assist_user
<set>
<if test="userName != null">
user_name = #{userName,jdbcType=VARCHAR},
</if>
<if test="password != null">
password = #{password,jdbcType=VARCHAR},
</if>
<if test="phone != null">
phone = #{phone,jdbcType=VARCHAR},
</if>
<if test="cardNo != null">
card_no = #{cardNo,jdbcType=INTEGER},
</if>
<if test="qrCode != null">
qr_code = #{qrCode,jdbcType=VARCHAR},
</if>
<if test="created != null">
created = #{created},
</if>
<if test="modified != null">
modified = #{modified},
</if>

</set>
where id = #{id,jdbcType=INTEGER}

</update>

</mapper>