BaseMapper.xml 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  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.BaseMapper">
  4. <update id="updatePasswordByUserId">
  5. update user set password = #{password}
  6. where userID = #{userId}
  7. </update>
  8. <update id="updateMobileByUserId">
  9. update user set bindMobile = #{mobile}
  10. where userID = #{userId}
  11. </update>
  12. <update id="updateShopMobileByShopId">
  13. update shop set contractMobile = #{mobile}
  14. where shopID = #{shopId}
  15. </update>
  16. <update id="updateClubMobileByClubId">
  17. update club set contractMobile = #{mobile}
  18. where clubID = #{clubId}
  19. </update>
  20. <select id="getUserIdByEmail" resultType="java.lang.Integer">
  21. select userID from user
  22. where email = #{email} and userIdentity in (1,2,3,4)
  23. limit 1
  24. </select>
  25. <select id="getUserIdByUserId" resultType="java.lang.Integer">
  26. select userID from user
  27. where userID = #{userId} and userIdentity in (1,2,3,4)
  28. limit 1
  29. </select>
  30. <select id="getUserIdByMobile" resultType="java.lang.Integer">
  31. SELECT u.userID FROM USER u
  32. LEFT JOIN cm_mall_operation_user cu ON cu.userID = u.userID
  33. WHERE u.bindMobile = #{mobile} and u.userIdentity in (1,2,3,4)
  34. UNION
  35. SELECT u.userID FROM USER u
  36. LEFT JOIN cm_mall_operation_user cu ON cu.userID = u.userID
  37. WHERE cu.mobile = #{mobile} AND cu.delFlag != 1
  38. AND u.userIdentity IN (1,2,3,4)
  39. LIMIT 1
  40. </select>
  41. <select id="getOperationUserIdByMobile" resultType="java.lang.Integer">
  42. select userID from cm_mall_operation_user
  43. where mobile = #{mobile} and delFlag = '0'
  44. limit 1
  45. </select>
  46. <select id="getClubStatusByUserId" resultType="java.lang.Integer">
  47. select clubStatus
  48. from user
  49. where userID = #{userId}
  50. </select>
  51. <select id="getShopStatusByUserId" resultType="java.lang.Integer">
  52. select manufacturerStatus
  53. from user
  54. where userID = #{userId}
  55. </select>
  56. <select id="getOperationIdByMobile" resultType="java.lang.Integer">
  57. select id from cm_mall_operation_user
  58. where mobile = #{mobile} and delFlag = '0'
  59. limit 1
  60. </select>
  61. <select id="getProvince" resultType="com.caimei365.user.model.vo.ProvinceVo">
  62. select provinceID as provinceId, name, validFlag, deliveryFee, freeMinTotalPrice
  63. from province where provinceID = #{provinceId}
  64. </select>
  65. <select id="getCity" resultType="com.caimei365.user.model.vo.CityVo">
  66. select cityID as cityId, provinceID as provinceId, name, validFlag
  67. from city where cityID = #{cityId}
  68. </select>
  69. <select id="getTown" resultType="com.caimei365.user.model.vo.TownVo">
  70. select townID as townId, cityID as cityId, name, zip, telZip, validFlag
  71. from town where townID = #{townID}
  72. </select>
  73. <select id="getUserByUserId" resultType="com.caimei365.user.model.vo.UserVo">
  74. select userID as userId,
  75. registerUserTypeID as registerUserTypeId,
  76. source,
  77. clubID as clubId,
  78. shopID as shopId,
  79. serviceProviderID as serviceProviderId,
  80. name,
  81. userName,
  82. email,
  83. mobile,
  84. bindMobile,
  85. password,
  86. userIdentity,
  87. userPermission,
  88. clubStatus,
  89. manufacturerStatus,
  90. serviceProviderStatus,
  91. auditNote,
  92. auditStatus,
  93. agreeFlag,
  94. registerTime,
  95. registerIP as registerIp,
  96. guideFlag,
  97. validFlag,
  98. userBeans,
  99. ableUserMoney,
  100. image
  101. from user
  102. where userID = #{userId}
  103. </select>
  104. <select id="getUserNameByUserId" resultType="java.lang.String">
  105. select userName from user where userID = #{userId}
  106. </select>
  107. <select id="getAfterSalesPhone" resultType="java.lang.String">
  108. select contactNumber from cm_mall_organize where id = 0 and delFlag = '0'
  109. </select>
  110. <select id="getSensitiveWords" resultType="java.lang.String">
  111. select words
  112. from cm_sensitive_words
  113. where id = 1 and status = 1
  114. <if test="checkPoint != null">
  115. and checkPoints like concat('%',#{checkPoint},'%')
  116. </if>
  117. </select>
  118. <select id="findLabelsByLableIds" resultType="java.lang.String">
  119. select keyword
  120. from cm_user_search_frequency
  121. where trueStatus=1
  122. and delStatus=1
  123. and id in (#{labelIds})
  124. </select>
  125. </mapper>