xiaoyong931011
2021-06-30 b9857b9a19ae585d342b74fca6ee26277019e65c
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
<?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.xzx.gc.order.mapper.UserMapper">
 
    <select id="findHaveAddr" resultType="com.xzx.gc.entity.UserInfo">
        SELECT
            a.user_id "userId",
            a.nick_name "nickName",
            a.mobile_phone "mobilePhone",
            b.address_id "addressId",
            b.detail_address "detailAddress",
            b.address_area "addressArea",
            b.rela_name "relaName"
 
        FROM
            xzx_user_info a
            RIGHT JOIN xzx_user_address_info b ON a.user_id = b.user_id
                                                  AND b.flag = '1'
        WHERE
            a.del_flag = 0
            AND is_prohibit =0
    </select>
 
    <update id="updatePartnerId">
        update xzx_user_info set partner_id=concat(partner_id,',',#{partnerId}) where  user_id=#{userId} and locate(#{partnerId},partner_id)=0
    </update>
 
    <select id="queryUserByUsertypeList" resultType="com.xzx.gc.model.admin.UserModel">
        select * from xzx_user_info
        where 1=1
        <if test="delFlag != null">
            and del_flag=#{delFlag}
        </if>
        <if test="phone != null and phone != ''">
            and (mobile_phone like concat("%",#{phone},"%") or nick_name =#{nickName})
        </if>
        <if test="userType != null and userType != ''">
            and user_type=#{userType}
        </if>
        <if test="normal != null">
            and regist_type=3
        </if>
    </select>
 
    <select id="queryUserByUsertype" resultType="com.xzx.gc.model.admin.UserModel">
        select * from xzx_user_info
        where 1=1
        <if test="delFlag != null">
            and del_flag=#{delFlag}
        </if>
        <if test="phone != null and phone != ''">
            and (mobile_phone like concat("%",#{phone},"%") or nick_name =#{nickName})
        </if>
        <if test="userType != null and userType != ''">
            and user_type=#{userType}
        </if>
        <if test="normal != null">
            and regist_type=3
        </if>
    </select>
 
    <update id="updateUserInfo" parameterType="com.xzx.gc.model.admin.UserModel">
        update xzx_user_info set
            nick_name=#{nickName},longitude=#{longitude},
            latitude=#{latitude} where user_id=#{userId}
    </update>
 
    <insert id="insertUserInfo" parameterType="com.xzx.gc.model.admin.UserModel">
        insert into xzx_user_info (user_id,mobile_phone, avatar, login_account, password, salt, name, nick_name,birthday,sex,user_type,open_id,country,province,city,longitude,latitude,regist_time,del_flag,regist_type,is_prohibit,partner_id)
        values (
            #{userId}, #{mobilePhone},
                       #{avatar}, #{loginAccount}, #{password}, #{salt}, #{name},#{nickName},#{birthday},#{sex},1,null,'China',#{province},#{city},#{longitude},#{latitude},SYSDATE(),0,3,0,#{partnerId}
        )
    </insert>
</mapper>