12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- <?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.caimei365.user.mapper.BaseUserDao">
- <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
- 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>
- </mapper>
|