RegisterMapper.xml 5.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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`,`userIdentity`, `userPermission`, `clubStatus`, `password`, `agreeFlag`, `validFlag`, `serviceProviderID`, `serviceProviderStatus`)
  6. values(#{registerTime},#{registerIp},#{source},#{registerUserTypeId},#{name},#{userName},#{bindMobile},#{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`)
  10. values(#{name},#{sName},#{contractMobile},#{linkMan},#{userId},#{addTime},#{status},#{serviceProviderId})
  11. </insert>
  12. <insert id="insertOperation" parameterType="com.caimei365.user.model.po.OperationPo" keyProperty="clubId" useGeneratedKeys="true">
  13. insert into cm_mall_operation_user(`userID`, `clubID`, `nickName`, `headimgurl`, `userType`, `mobile`, `linkName`, `status`, `unionId`, `openid`, `addTime`, `updateTime`, `bindTime`, `delFlag`)
  14. values(#{userId},#{clubId},#{nickName},#{avatarUrl},#{UserType},#{mobile},#{linkName},#{status},#{unionId},#{openid},#{addTime},#{updateTime},#{bindTime},#{delFlag})
  15. </insert>
  16. <insert id="insertShopUser" parameterType="com.caimei365.user.model.po.UserPo" keyProperty="userId" useGeneratedKeys="true">
  17. insert into user(`registerTime`, `registerIP`, `source`, `registerUserTypeID`, `name`, `userName`, `bindMobile`, `email`, `userIdentity`, `userPermission`, `manufacturerStatus` , `password`, `agreeFlag`, `validFlag`)
  18. values(#{registerTime},#{registerIp},#{source},#{registerUserTypeId},#{name},#{userName},#{bindMobile},#{email},#{userIdentity},#{userPermission},#{manufacturerStatus},#{password},#{agreeFlag},#{validFlag})
  19. </insert>
  20. <insert id="insertShop" parameterType="com.caimei365.user.model.po.ShopPo" keyProperty="shopId" useGeneratedKeys="true">
  21. insert into shop(`userID`, `name`, `sname`, `linkMan`, `contractMobile`, `contractEmail1`, `provinceID`, `cityID`, `townID`, `address`, `socialCreditCode`, `businessLicenseImage`, `firstShopType`, `secondShopType`, `mainpro`, `addTime`, `validFlag`, `status`)
  22. values(#{userId},#{name},#{sName},#{linkMan},#{contractMobile},#{contractEmail1},#{provinceId},#{cityId},#{townId},#{address},#{socialCreditCode},#{businessLicense},#{firstShopType},#{secondShopType},#{mainProduct},#{addTime},#{validFlag},#{status})
  23. </insert>
  24. <update id="updateUserClubId">
  25. update user set clubID = #{clubId} where userID = #{userId}
  26. </update>
  27. <update id="updateUserShopId">
  28. update user set shopID = #{shopId} where userID = #{userId}
  29. </update>
  30. <update id="updateClubUserByUpgrade">
  31. update user set registerIP = #{registerIp},
  32. email = #{contractEmail},
  33. name = #{name},
  34. clubStatus = #{clubStatus}
  35. where userID = #{userId}
  36. </update>
  37. <update id="updateClubByUpgrade">
  38. update club set userID = #{userId}, name = #{name}, sname = #{sName}, contractEmail1 = #{contractEmail},
  39. <if test="contractPhone != null">
  40. contractPhone = #{contractPhone},
  41. </if>
  42. <if test="linkMan != null">
  43. linkMan = #{linkMan},
  44. </if>
  45. provinceID = #{provinceId}, cityID = #{cityId}, townID = #{townId}, address = #{address},
  46. <if test="shopPhoto != null and shopPhoto != 'null' and shopPhoto != ''">
  47. headpic = #{shopPhoto},
  48. </if>
  49. businessLicenseImage = #{businessLicense}, socialCreditCode = #{socialCreditCode}, firstClubType = #{firstClubType},
  50. <if test="firstClubType == 1">
  51. secondClubType = #{secondClubType}, department = #{department}, medicalPracticeLicenseImg = #{medicalPracticeLicense},
  52. </if>
  53. <if test="mainProduct != null">
  54. mainpro = #{mainProduct},
  55. </if>
  56. <if test="fax != null">
  57. fax = #{fax},
  58. </if>
  59. <if test="profile != null">
  60. info = #{profile},
  61. </if>
  62. where clubID = #{clubId}
  63. </update>
  64. </mapper>