<?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>
|