BaseUserMapper.xml 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.caimei365.user.mapper.BaseUserDao">
  4. <select id="getBaseUserByMobile" resultType="com.caimei365.user.model.BaseUser">
  5. select u.userID as userId,
  6. u.userName as userName,
  7. u.mobile as mobile,
  8. u.bindMobile as bindMobile,
  9. u.email as email,
  10. u.userPermission as userPermission,
  11. u.userIdentity as userIdentity,
  12. u.password as password
  13. from user u
  14. left join cm_mall_operation_user cu on cu.userID = u.userID
  15. where (u.bindMobile = #{mobile}
  16. or (cu.mobile = #{mobile} and cu.delFlag != 1)
  17. ) AND u.userIdentity IN (1,2,3,4)
  18. LIMIT 1
  19. </select>
  20. <select id="getBaseUserByMobileOrEmail" resultType="com.caimei365.user.model.BaseUser">
  21. select u.userID as userId,
  22. u.userName as userName,
  23. u.mobile as mobile,
  24. u.bindMobile as bindMobile,
  25. u.email as email,
  26. u.userPermission as userPermission,
  27. u.userIdentity as userIdentity,
  28. u.password as password,
  29. case
  30. when u.userIdentity = 3 then u.manufacturerStatus
  31. when (u.userIdentity = 2 or u.userIdentity = 4) then u.clubStatus
  32. else 0
  33. end as status
  34. from user u
  35. left join cm_mall_operation_user cu on cu.userID = u.userID
  36. where (u.bindMobile = #{mobileOrEmail}
  37. or u.email = #{mobileOrEmail}
  38. or (cu.mobile = #{mobileOrEmail} and cu.delFlag != 1)
  39. ) AND u.userIdentity IN (1,2,3,4)
  40. LIMIT 1
  41. </select>
  42. </mapper>