SellerMapper.xml 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  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.SellerMapper">
  4. <select id="getLoginSellerByMobile" resultType="com.caimei365.user.model.vo.UserLoginVo">
  5. select u.userID as userId,
  6. u.clubID as clubId,
  7. u.shopID as shopId,
  8. u.userName as userName,u.name as name,
  9. u.mobile as mobile,
  10. u.bindMobile as bindMobile,
  11. u.email as email,
  12. u.guideFlag as guideFlag,
  13. u.userPermission as userPermission,
  14. u.userIdentity as userIdentity,
  15. u.password as password
  16. from user u
  17. where
  18. u.mobile = #{mobile}
  19. and u.userIdentity = 1
  20. and u.userPermission = 4
  21. and u.validFlag = 1
  22. </select>
  23. <update id="updateServiceProviderByUserId">
  24. update serviceprovider
  25. set openid = #{openId}, unionId = #{unionId}
  26. where userID = #{userId}
  27. </update>
  28. <select id="findClubTemporary" resultType="com.caimei365.user.model.vo.ClubTemporaryVo">
  29. SELECT
  30. `id`,
  31. `userId`,
  32. `name`,
  33. `shortName`,
  34. `bindMobile`,
  35. `contractEmail`,
  36. `linkMan`,
  37. `provinceId`,
  38. `cityId`,
  39. `townId`,
  40. `address`,
  41. `shopPhoto`,
  42. `businessLicense`,
  43. `socialCreditCode`,
  44. `firstClubType`,
  45. `secondClubType`,
  46. `department`,
  47. `medicalPracticeLicense`,
  48. `mainProduct`,
  49. `isAgreed`
  50. FROM
  51. club_temporary
  52. WHERE
  53. userId = #{userId}
  54. <if test="searchName != null and searchName != ''">
  55. AND (name LIKE CONCAT('%',#{searchName},'%') OR linkMan LIKE CONCAT('%',#{searchName},'%'))
  56. </if>
  57. ORDER BY
  58. id DESC
  59. </select>
  60. <update id="updateClubTemporary">
  61. UPDATE
  62. `club_temporary`
  63. SET
  64. `name` = #{name},
  65. `shortName` = #{shortName},
  66. `bindMobile` = #{bindMobile},
  67. `contractEmail` = #{contractEmail},
  68. `linkMan` = #{linkMan},
  69. `provinceId` = #{provinceId},
  70. `cityId` = #{cityId},
  71. `townId` = #{townId},
  72. `address` = #{address},
  73. `shopPhoto` = #{shopPhoto},
  74. `businessLicense` = #{businessLicense},
  75. `socialCreditCode` = #{socialCreditCode},
  76. `firstClubType` = #{firstClubType},
  77. `secondClubType` = #{secondClubType},
  78. `department` = #{department},
  79. `medicalPracticeLicense` = #{medicalPracticeLicense},
  80. `mainProduct` = #{mainProduct},
  81. `isAgreed` = #{isAgreed}
  82. WHERE `id` = #{id}
  83. </update>
  84. <delete id="deleteTemporaryClub">
  85. DELETE FROM `club_temporary` WHERE `id` = #{id}
  86. </delete>
  87. <select id="findOrderNum" resultType="integer">
  88. SELECT
  89. COUNT(*)
  90. FROM
  91. cm_order
  92. WHERE
  93. userID = #{userId}
  94. AND orderSubmitType IN (0, 1, 2)
  95. <if test="lastCheckOrderDate != null">
  96. AND orderTime > #{lastCheckOrderDate}
  97. </if>
  98. </select>
  99. <select id="findClubs" resultType="com.caimei365.user.model.vo.ClubVo">
  100. select c.clubID as clubId, c.userID as userId, c.name, c.sname as shortName, c.contractMobile, c.contractEmail1 as contractEmail,
  101. c.contractPhone, c.linkMan, c.provinceID as proviceId, c.cityID as cityId, c.townID as townId,
  102. c.address, c.headpic as shopPhoto, c.businessLicenseImage as businessLicense, c.socialCreditCode,
  103. c.firstClubType, c.secondClubType, c.department, c.medicalPracticeLicenseImg as medicalPracticeLicense,
  104. c.mainpro as mainProduct, c.fax, c.info as profile, c.spID as serviceProviderId, c.addTime, c.status,
  105. u.userIdentity
  106. from club c
  107. left join user u on c.userID = u.userID
  108. where c.spID = #{serviceProviderId}
  109. <if test="status != null and status != 66">
  110. AND c.status = #{status}
  111. </if>
  112. <if test="status == 66">
  113. AND c.status IN (1,90,92,93)
  114. </if>
  115. <if test="name != null and name != ''">
  116. AND (c.name LIKE CONCAT('%',#{name},'%') OR c.linkMan LIKE CONCAT('%',#{name},'%'))
  117. </if>
  118. <if test="userIdentity != null">
  119. AND u.userIdentity = #{userIdentity}
  120. </if>
  121. order by c.clubID desc
  122. </select>
  123. <select id="getAllClubList" resultType="com.caimei365.user.model.vo.ClubVo">
  124. SELECT c.clubID as clubId, c.userID as userId, c.name, c.sname as shortName, c.contractMobile, c.contractEmail1 as contractEmail,
  125. c.contractPhone, c.linkMan, c.provinceID as proviceId, c.cityID as cityId, c.townID as townId,
  126. c.address, c.headpic as shopPhoto, c.businessLicenseImage as businessLicense, c.socialCreditCode,
  127. c.firstClubType, c.secondClubType, c.department, c.medicalPracticeLicenseImg as medicalPracticeLicense,
  128. c.mainpro as mainProduct, c.fax, c.info as profile, c.spID as serviceProviderId, c.addTime, c.status,
  129. u.userIdentity
  130. FROM club c
  131. LEFT JOIN user u ON c.userID=u.userID
  132. WHERE u.userOrganizeID = 0 AND c.status = '90'
  133. <if test="searchWord != null and searchWord != ''">
  134. and (
  135. c.name LIKE CONCAT('%',#{searchWord},'%') or
  136. c.linkMan1 LIKE CONCAT('%',#{searchWord},'%') or
  137. c.contractMobile1 LIKE CONCAT('%',#{searchWord},'%')
  138. )
  139. </if>
  140. </select>
  141. <select id="getSellerByUserId" resultType="com.caimei365.user.model.po.ServiceProviderPo">
  142. select serviceProviderID AS serviceProviderId, status, userID AS userId, openid, unionId, name, contractMobile,
  143. linkMan1, duty1, contractMobile1, auditStatus, auditTime, auditNote, validFlag, addTime,
  144. mainServiceProviderID AS mainServiceProviderId
  145. from serviceprovider where userID = #{userId}
  146. </select>
  147. </mapper>