MemberMapper.xml
4.9 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
<?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.sibu.orderHelper.integral.dao.MemberDao">
<resultMap id="MemberInfoResult" type="com.sibu.orderHelper.integral.vo.IMMemberBean">
<id column="id" property="id"/>
<result column="member_id" property="memberId" jdbcType="VARCHAR"/>
<result column="member_source" property="memberSource" jdbcType="INTEGER"/>
<result column="db_index" property="dbIndex" jdbcType="INTEGER"/>
<result column="table_index" property="tableIndex" jdbcType="INTEGER"/>
<result column="nick_name" property="nickName" jdbcType="VARCHAR"/>
<result column="true_name" property="trueName" jdbcType="VARCHAR"/>
<result column="id_card" property="idCard" jdbcType="VARCHAR"/>
<result column="gender" property="gender" jdbcType="INTEGER"/>
<result column="head_img" property="headImg" jdbcType="VARCHAR"/>
<result column="wechat" property="wechat" jdbcType="VARCHAR"/>
<result column="qq" property="qq" jdbcType="VARCHAR"/>
<result column="phone" property="phone" jdbcType="VARCHAR"/>
<result column="email" property="email" jdbcType="VARCHAR"/>
<result column="password" property="password" jdbcType="VARCHAR"/>
<result column="salt" property="salt" jdbcType="VARCHAR"/>
<result column="ver_pwd" property="verPwd" jdbcType="INTEGER"/>
<result column="wechat_open_id" property="wechatOpenId" jdbcType="VARCHAR"/>
<result column="wechat_union_id" property="wechatUnionId" jdbcType="VARCHAR"/>
<result column="create_dt" property="createDt" jdbcType="TIMESTAMP"/>
<result column="update_dt" property="updateDt" jdbcType="TIMESTAMP"/>
<result column="delete_flag" property="deleteFlag" jdbcType="INTEGER"/>
<result column="withdraw_password" property="withdrawPassword"/>
<result column="withdraw_password_salt" property="withdrawPasswordSalt"/>
<result column="id_card" property="idCard"/>
<result column="id_card_audit_status" property="idCardAuditStatus"/>
<result column="id_card_img_front" property="idCardImgFront"/>
<result column="id_card_img_back" property="idCardImgBack"/>
<result column="xws_member_id" property="xwsMemberId"/>
</resultMap>
<sql id="MemberInfoSql">
id,member_id,member_source,db_index,table_index,nick_name,true_name, gender, head_img, wechat, phone,
password, salt, wechat_open_id,ver_pwd, create_dt, update_dt,withdraw_password,withdraw_password_salt,id_card,id_card_audit_status,id_card_img_front,id_card_img_back
</sql>
<!--根据电话号码获取用户信息-->
<select id="selectMemberInfoByPhone" parameterType="java.lang.String" resultMap="MemberInfoResult">
select
<include refid="MemberInfoSql"/>
from t_member_info where phone = #{phone} limit 1
</select>
<!--根据新微商memberId获取用户信息-->
<select id="selectMemberInfoByMemberId" parameterType="java.lang.String" resultMap="MemberInfoResult">
select
<include refid="MemberInfoSql"/>,xws_member_id
from t_member_info where member_id = #{memberId} limit 1
</select>
<!--注册用户信息-->
<insert id="registerMember" parameterType="com.sibu.orderHelper.integral.vo.IMMemberBean">
insert into t_member_info(member_id, phone, password, salt, wechat_open_id, member_source)
value(#{memberId}, #{phone}, #{password}, #{salt}, #{wechatOpenId}, #{memberSource})
</insert>
<!--更新用户密码-->
<update id="updateMemberPassword" parameterType="java.util.Map">
update t_member_info set password = #{password}, salt = #{salt} where phone = #{phone} limit 1
</update>
<update id="updateHeadImage">
update t_member_info set head_img = #{headImg} where member_id = #{memberId} limit 1
</update>
<update id="updateGender">
update t_member_info set gender = #{gender} where member_id = #{memberId} limit 1
</update>
<update id="submitIdCardInfo" parameterType="com.sibu.orderHelper.integral.request.member.UpdateIdCardInfoRequest">
update t_member_info set
true_name = #{trueName},
id_card = #{idCard},
id_card_img_front = #{idCardImgFront},
id_card_img_back = #{idCardImgBack},
id_card_audit_status = 1
where member_id = #{memberId} limit 1
</update>
<update id="updateWechatAccount"
parameterType="com.sibu.orderHelper.integral.request.member.UpdateWechatAccountRequest">
update t_member_info set
wechat = #{wechat}
where member_id = #{memberId} limit 1
</update>
<update id="updateWithdrawPassword">
update t_member_info set
withdraw_password = #{withdrawPassword},
withdraw_password_salt = #{withdrawPasswordSalt}
where member_id = #{memberId} limit 1
</update>
</mapper>