ClubMapper.xml 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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.ClubMapper">
  4. <update id="updateClubUserByUpdateInfo">
  5. update user set
  6. <if test="name != null and name != ''">
  7. name = #{name},
  8. </if>
  9. <if test="email != null and email != ''">
  10. email = #{email},
  11. </if>
  12. userName = #{userName}
  13. where userID = #{userId}
  14. </update>
  15. <update id="updateClubByUpdateInfo">
  16. update club set
  17. <if test="name != null and name != ''">
  18. name = #{name},
  19. </if>
  20. <if test="shortName != null and shortName != ''">
  21. sname = #{shortName},
  22. </if>
  23. <if test="contractEmail != null and contractEmail != ''">
  24. contractEmail1 = #{contractEmail},
  25. </if>
  26. <if test="contractPhone != null and contractPhone != ''">
  27. contractPhone = #{contractPhone},
  28. </if>
  29. <if test="linkMan != null and linkMan != ''">
  30. linkMan = #{linkMan},
  31. </if>
  32. <if test="townId != null and townId != ''">
  33. provinceID = #{provinceId}, cityID = #{cityId}, townID = #{townId}, address = #{address},
  34. </if>
  35. <if test="shopPhoto != null and shopPhoto != 'null' and shopPhoto != ''">
  36. headpic = #{shopPhoto},
  37. </if>
  38. <if test="businessLicense != null and businessLicense != ''">
  39. businessLicenseImage = #{businessLicense},
  40. </if>
  41. <if test="socialCreditCode != null and socialCreditCode != ''">
  42. socialCreditCode = #{socialCreditCode},
  43. </if>
  44. <if test="firstClubType != null and firstClubType != ''">
  45. firstClubType = #{firstClubType},
  46. </if>
  47. <if test="firstClubType == 1">
  48. secondClubType = #{secondClubType}, department = #{department}, medicalPracticeLicenseImg = #{medicalPracticeLicense},
  49. </if>
  50. <if test="mainProduct != null and mainProduct != ''">
  51. mainpro = #{mainProduct},
  52. </if>
  53. <if test="fax != null and fax != ''">
  54. fax = #{fax},
  55. </if>
  56. <if test="profile != null and profile != ''">
  57. info = #{profile},
  58. </if>
  59. lastModify = NOW()
  60. where clubID = #{clubId}
  61. </update>
  62. <select id="getClubById" resultType="com.caimei365.user.model.vo.ClubVo">
  63. select clubID as clubId, userID as userId, name, sname as shortName, contractMobile, contractEmail1 as contractEmail,
  64. contractPhone, linkMan, provinceID as proviceId, cityID as cityId, townID as townId,
  65. address, headpic as shopPhoto, businessLicenseImage as businessLicense, socialCreditCode,
  66. firstClubType, secondClubType, department, medicalPracticeLicenseImg as medicalPracticeLicense,
  67. mainpro as mainProduct, fax, info as profile, spID as serviceProviderId, addTime, status
  68. from club
  69. where clubID = #{clubId}
  70. </select>
  71. <select id="getOrderCount" resultType="com.caimei365.user.model.vo.OrderCountVo">
  72. select userID as userId,
  73. (select COUNT(*) from cm_order where userID = #{userId} and delFlag = '0') as orderCount,
  74. (select COUNT(*) from cm_order where userID = #{userId} and delFlag = '0' and status = '0') as confirmedCount,
  75. (select COUNT(*) from cm_order where userID = #{userId} and delFlag = '0' and status in(11,12,13,21,22,23)) as paymentCount,
  76. (select COUNT(*) from cm_order where userID = #{userId} and delFlag = '0' and status in(11,12,21,22,31,32)) as waitShipmentsCount,
  77. (select COUNT(*) from cm_order where userID = #{userId} and delFlag = '0' and status in(12,13,22,23,32,33)) as shipmentsCount,
  78. (select COUNT(*) from cm_order where userID = #{userId} and delFlag = '0' and status in(1,2)) as salesReturnCount
  79. from cm_order
  80. where userID = #{userId} and delFlag = '0'
  81. limit 1
  82. </select>
  83. </mapper>