RegisterMapper.xml 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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.RegisterMapper">
  4. <insert id="insertClubUser" parameterType="com.caimei365.user.model.po.UserPo" keyProperty="userId" useGeneratedKeys="true">
  5. insert into user(`registerTime`, `registerIP`, `source`, `registerUserTypeID`, `name`, `userName`, `bindMobile`, `email`, `userIdentity`, `userPermission`, `clubStatus`, `password`, `agreeFlag`, `validFlag`, `serviceProviderID`, `serviceProviderStatus`)
  6. values(#{registerTime},#{registerIp},#{source},#{registerUserTypeId},#{name},#{userName},#{bindMobile},#{email},#{userIdentity},#{userPermission},#{clubStatus},#{password},#{agreeFlag},#{validFlag},#{serviceProviderId},#{serviceProviderStatus})
  7. </insert>
  8. <insert id="insertClub" parameterType="com.caimei365.user.model.po.ClubPo" keyProperty="clubId" useGeneratedKeys="true">
  9. insert into club(`name`, `sname`, `contractMobile`, `linkMan`, `userID`, `addTime`, `status`, `spID`, `scanFlag`)
  10. values(#{name},#{shortName},#{contractMobile},#{linkMan},#{userId},#{addTime},#{status},#{serviceProviderId},#{scanFlag})
  11. </insert>
  12. <insert id="insertUpgradeClub" parameterType="com.caimei365.user.model.po.ClubPo" keyProperty="clubId" useGeneratedKeys="true">
  13. insert into club(`name`, `sname`, `contractMobile`, `linkMan`, `userID`, `addTime`, `status`, `spID`, `scanFlag`,`contractEmail1`,`linkMan`, `provinceID`, `cityID`,`townID`, `address`, `headpic`, `businessLicenseImage`,`socialCreditCode`,`firstClubType`,`secondClubType`,`department`,`medicalPracticeLicenseImg`,`mainpro`)
  14. values(#{name},#{shortName},#{contractMobile},#{linkMan},#{userId},#{addTime},#{status},#{serviceProviderId},#{scanFlag},#{contractEmail},#{linkMan},#{provinceId},#{cityId},#{townId},#{address},#{shopPhoto},#{businessLicense},#{socialCreditCode},#{firstClubType},#{secondClubType},#{department},#{medicalPracticeLicense},#{mainProduct})
  15. </insert>
  16. <insert id="insertOperation" parameterType="com.caimei365.user.model.po.OperationPo" keyProperty="id" useGeneratedKeys="true">
  17. insert into cm_mall_operation_user(`userID`, `clubID`, `userOrganizeID`, `nickName`, `headimgurl`, `userType`, `mobile`, `linkName`, `status`, `unionId`, `openid`, `addTime`, `updateTime`, `bindTime`, `delFlag`)
  18. values(#{userId},#{clubId},#{organizeId},#{nickName},#{avatarUrl},#{userType},#{mobile},#{linkName},#{status},#{unionId},#{openId},#{addTime},#{updateTime},#{bindTime},#{delFlag})
  19. </insert>
  20. <insert id="insertShopUser" parameterType="com.caimei365.user.model.po.UserPo" keyProperty="userId" useGeneratedKeys="true">
  21. insert into user(`registerTime`, `registerIP`, `source`, `registerUserTypeID`, `name`, `userName`, `bindMobile`, `email`, `userIdentity`, `userPermission`, `manufacturerStatus` , `password`, `agreeFlag`, `validFlag`)
  22. values(#{registerTime},#{registerIp},#{source},#{registerUserTypeId},#{name},#{userName},#{bindMobile},#{email},#{userIdentity},#{userPermission},#{manufacturerStatus},#{password},#{agreeFlag},#{validFlag})
  23. </insert>
  24. <insert id="insertShop" parameterType="com.caimei365.user.model.po.ShopPo" keyProperty="shopId" useGeneratedKeys="true">
  25. insert into shop(`userID`, `name`, `sname`, `linkMan`, `contractMobile`, `contractEmail1`, `provinceID`, `cityID`, `townID`, `address`, `socialCreditCode`, `businessLicenseImage`, `firstShopType`, `secondShopType`, `mainpro`, `addTime`, `validFlag`, `status`)
  26. values(#{userId},#{name},#{shortName},#{linkMan},#{contractMobile},#{contractEmail},#{provinceId},#{cityId},#{townId},#{address},#{socialCreditCode},#{businessLicense},#{firstShopType},#{secondShopType},#{mainProduct},#{addTime},#{validFlag},#{status})
  27. </insert>
  28. <update id="updateUserClubId">
  29. update user set clubID = #{clubId} where userID = #{userId}
  30. </update>
  31. <update id="updateUserShopId">
  32. update user set shopID = #{shopId} where userID = #{userId}
  33. </update>
  34. <update id="updateClubUserByUpgrade">
  35. update user set registerIP = #{registerIp},
  36. email = #{email},
  37. name = #{name},
  38. clubStatus = #{clubStatus}
  39. where userID = #{userId}
  40. </update>
  41. <update id="updateShopUserByApply">
  42. update user set userName = #{userName}, name = #{name}, manufacturerStatus = #{manufacturerStatus}
  43. <if test="email != null">
  44. , email = #{email}
  45. </if>
  46. where userID = #{userId}
  47. </update>
  48. <update id="updateClubByUpgrade">
  49. update club set userID = #{userId}, name = #{name}, sname = #{shortName}, contractEmail1 = #{contractEmail},
  50. <if test="contractPhone != null">
  51. contractPhone = #{contractPhone},
  52. </if>
  53. <if test="linkMan != null">
  54. linkMan = #{linkMan},
  55. </if>
  56. provinceID = #{provinceId}, cityID = #{cityId}, townID = #{townId}, address = #{address},
  57. <if test="shopPhoto != null and shopPhoto != 'null' and shopPhoto != ''">
  58. headpic = #{shopPhoto},
  59. </if>
  60. businessLicenseImage = #{businessLicense}, socialCreditCode = #{socialCreditCode}, firstClubType = #{firstClubType},
  61. <if test="firstClubType == 1">
  62. secondClubType = #{secondClubType}, department = #{department}, medicalPracticeLicenseImg = #{medicalPracticeLicense},
  63. </if>
  64. <if test="mainProduct != null">
  65. mainpro = #{mainProduct},
  66. </if>
  67. <if test="fax != null">
  68. fax = #{fax},
  69. </if>
  70. <if test="profile != null">
  71. info = #{profile},
  72. </if>
  73. status = #{status}
  74. where clubID = #{clubId}
  75. </update>
  76. <update id="updateShopInfoByApply">
  77. update shop set userID = #{userId}, name = #{name},
  78. <if test="shortName != null">
  79. sname = #{shortName},
  80. </if>
  81. <if test="email != null">
  82. contractEmail1 = #{email},
  83. </if>
  84. <if test="linkMan != null">
  85. linkMan = #{linkMan},
  86. </if>
  87. <if test="provinceId != null">
  88. provinceID = #{provinceId},
  89. </if>
  90. <if test="cityId != null">
  91. cityID = #{cityId},
  92. </if>
  93. <if test="townId != null">
  94. townID = #{townId},
  95. </if>
  96. <if test="address != null">
  97. address = #{address},
  98. </if>
  99. <if test="socialCreditCode != null">
  100. socialCreditCode = #{socialCreditCode},
  101. </if>
  102. <if test="businessLicense != null">
  103. businessLicenseImage = #{businessLicense},
  104. </if>
  105. <if test="firstShopType != null">
  106. firstShopType = #{firstShopType},
  107. </if>
  108. <if test="secondShopType != null">
  109. secondShopType = #{secondShopType},
  110. </if>
  111. <if test="mainProduct != null">
  112. mainpro = #{mainProduct},
  113. </if>
  114. status = #{status}
  115. where shopID = #{shopId}
  116. </update>
  117. </mapper>