|
@@ -1,20 +1,43 @@
|
|
<?xml version="1.0" encoding="UTF-8" ?>
|
|
<?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">
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
<mapper namespace="com.caimei365.user.mapper.BaseUserDao">
|
|
<mapper namespace="com.caimei365.user.mapper.BaseUserDao">
|
|
- <select id="selectByMobileOrEmail" resultType="com.caimei365.user.model.BaseUser">
|
|
|
|
- select u.*,cu.mobile as operatorMobile from user u
|
|
|
|
|
|
+ <select id="getBaseUserByMobile" resultType="com.caimei365.user.model.BaseUser">
|
|
|
|
+ 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 user u
|
|
|
|
+ left join cm_mall_operation_user cu on cu.userID = u.userID
|
|
|
|
+ where (u.bindMobile = #{mobile}
|
|
|
|
+ or (cu.mobile = #{mobile} and cu.delFlag != 1)
|
|
|
|
+ ) AND u.userIdentity IN (1,2,3,4)
|
|
|
|
+ LIMIT 1
|
|
|
|
+ </select>
|
|
|
|
+ <select id="getBaseUserByMobileOrEmail" resultType="com.caimei365.user.model.BaseUser">
|
|
|
|
+ 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,
|
|
|
|
+ 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
|
|
left join cm_mall_operation_user cu on cu.userID = u.userID
|
|
where (u.bindMobile = #{mobileOrEmail}
|
|
where (u.bindMobile = #{mobileOrEmail}
|
|
- or u.email = #{mobileOrEmail}
|
|
|
|
- or (cu.mobile = #{mobileOrEmail} and cu.delFlag != 1))
|
|
|
|
- AND u.userIdentity IN (1,2,3,4)
|
|
|
|
- AND (u.userOrganizeID = '2' OR u.userOrganizeID IS NULL)
|
|
|
|
- <if test="source == 'www'">
|
|
|
|
- AND u.registerUserTypeID IN (1,3,4)
|
|
|
|
- </if>
|
|
|
|
- <if test="source == 'crm'">
|
|
|
|
- AND u.registerUserTypeID IN (1,2,3,32,4)
|
|
|
|
- </if>
|
|
|
|
|
|
+ or u.email = #{mobileOrEmail}
|
|
|
|
+ or (cu.mobile = #{mobileOrEmail} and cu.delFlag != 1)
|
|
|
|
+ ) AND u.userIdentity IN (1,2,3,4)
|
|
LIMIT 1
|
|
LIMIT 1
|
|
</select>
|
|
</select>
|
|
|
|
+
|
|
</mapper>
|
|
</mapper>
|