select u.userID as userId,
u.clubID as clubId,
u.shopID as shopId,
u.userName as userName,
u.mobile as mobile,
u.bindMobile as bindMobile,
u.email as email,
u.userPermission as userPermission,
u.userIdentity as userIdentity,
u.password as password
from user u
where u.userID = #{userId}
limit 1
select u.userID as userId,
u.clubID as clubId,
u.shopID as shopId,
u.userName as userName,
u.mobile as mobile,
u.bindMobile as bindMobile,
u.email as email,
u.userPermission as userPermission,
u.userIdentity as userIdentity,
u.password as password,
case
when u.userIdentity = 3 then u.manufacturerStatus
when (u.userIdentity = 2 or u.userIdentity = 4) then u.clubStatus
else 0
end as status
from user u
left join cm_mall_operation_user cu on cu.userID = u.userID
where (u.bindMobile = #{mobileOrEmail}
or u.email = #{mobileOrEmail}
or (cu.mobile = #{mobileOrEmail} and cu.delFlag != 1)
) and u.userIdentity in (1,2,3,4)
limit 1
select o.userID as userId,
o.mobile as mobile,
o.clubID as clubId,
o.shopID as shopId,
o.unionId as unionId
from cm_mall_operation_user o
where o.mobile = #{mobile} and o.delFlag = '0'
limit 1
select u.userID as userId,
u.userName as userName,
u.mobile as mobile,
u.bindMobile as bindMobile,
u.email as email,
u.userPermission as userPermission,
u.userIdentity as userIdentity,
u.password as password
from serviceprovider s
left join user u on s.userID = u.userID
where s.openid = #{openid} and u.validFlag = 1
limit 1
select o.userID as userId,
o.mobile as mobile,
o.clubID as clubId,
o.shopID as shopId,
o.unionId as unionId,
o.pcOpenid as openId
o.crmOpenid as openId
o.openid as openId
from
cm_mall_operation_user o
where unionId = #{unionId} and delFlag = '0'
and (userOrganizeID='2' or userOrganizeID is null)
limit 1
select o.userID as userId,
o.mobile as mobile,
o.clubID as clubId,
o.shopID as shopId,
o.unionId as unionId,
o.pcOpenid as openId
o.crmOpenid as openId
o.openid as openId
from
cm_mall_operation_user o
where
pcOpenid = #{openId}
crmOpenid = #{openId}
openid = #{openId}
and delFlag = '0'
and (userOrganizeID='2' or userOrganizeID is null)
limit 1
update serviceprovider
set unionId = #{unionId}
where userID = #{userId}
update cm_mall_operation_user
set openid = #{openId}
where userID = #{userId}
update cm_mall_operation_user
set unionId = #{unionId}
where userID = #{userId}
select o.userID as userId
from
cm_mall_operation_user o
where
pcOpenid = #{openId}
crmOpenid = #{openId}
openid = #{openId}
and delFlag = '0'
and (userOrganizeID='2' or userOrganizeID is null)
limit 1