123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284 |
- <?xml version="1.0" encoding="UTF-8" ?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.caimei365.user.mapper.RegisterMapper">
- <insert id="insertClubUser" parameterType="com.caimei365.user.model.po.UserPo" keyProperty="userId"
- useGeneratedKeys="true">
- insert into user(`userOrganizeID`, `registerTime`, `registerIP`, `ipAddress`, `source`, `registerUserTypeID`,
- `name`, `userName`, `bindMobile`, `email`, `userIdentity`, `guideFlag`,
- `password`, `agreeFlag`, `validFlag`, `serviceProviderID`, `serviceProviderStatus`, userBeans)
- values (#{organizeId}, #{registerTime}, #{registerIp}, #{ipAddress}, #{source}, #{registerUserTypeId}, #{name},
- #{userName}, #{bindMobile}, #{email}, #{userIdentity}, #{guideFlag}, #{password},
- #{agreeFlag}, #{validFlag}, #{serviceProviderId}, #{serviceProviderStatus}, #{userBeans})
- </insert>
- <select id="selUser" resultType="com.caimei365.user.model.po.UserPo">
- select *
- from user
- where registerTime = #{registerTime}
- </select>
- <insert id="insertOrgan">
- insert into cm_organ_value_system
- (userID, activeState, customerValue, stage, delType)
- values (#{userID}, "新增用户", "一般挽留客户", 0, 1)
- </insert>
- <insert id="insertClub" parameterType="com.caimei365.user.model.po.ClubPo" keyProperty="clubId"
- useGeneratedKeys="true">
- insert into club(`name`, `sname`, `contractMobile`, `linkMan`, `userID`, `addTime`, `status`, `spID`,
- `scanFlag`, provinceID, cityID, townID, address, headpic, businessLicenseImage,
- medicalPracticeLicenseImg, socialCreditCode)
- values (#{name}, #{shortName}, #{contractMobile}, #{linkMan}, #{userId}, #{addTime}, #{status},
- #{serviceProviderId}, #{scanFlag}, #{provinceId}, #{cityId}, #{townId}, #{address}, #{shopPhoto},
- #{businessLicense}, #{medicalPracticeLicense}, #{socialCreditCode})
- </insert>
- <insert id="insertUpgradeClub" parameterType="com.caimei365.user.model.po.ClubPo" keyProperty="clubId"
- useGeneratedKeys="true">
- insert into club(`name`, `sname`, `contractMobile`, `userID`, `addTime`, `status`, `spID`, `scanFlag`,
- `contractEmail`, `linkMan`, `provinceID`, `cityID`, `townID`, `address`, `headpic`,
- `businessLicenseImage`, `socialCreditCode`, `firstClubType`, `secondClubType`, `department`,
- `medicalPracticeLicenseImg`, `mainpro`)
- values (#{name}, #{shortName}, #{contractMobile}, #{userId}, #{addTime}, #{status}, #{serviceProviderId},
- #{scanFlag}, #{contractEmail}, #{linkMan}, #{provinceId}, #{cityId}, #{townId}, #{address},
- #{shopPhoto}, #{businessLicense}, #{socialCreditCode}, #{firstClubType}, #{secondClubType},
- #{department}, #{medicalPracticeLicense}, #{mainProduct})
- </insert>
- <insert id="insertOperation" parameterType="com.caimei365.user.model.po.OperationPo" keyProperty="id"
- useGeneratedKeys="true">
- insert into cm_mall_operation_user(`userID`, `clubID`, `shopID`, `userOrganizeID`, `linkName`, `nickName`,
- `headimgurl`, `userType`, `mobile`, `status`, `unionId`, `openid`,
- `pcOpenid`, `addTime`, `updateTime`, `bindTime`, `delFlag`)
- values (#{userId}, #{clubId}, #{shopId}, #{organizeId}, #{linkName}, #{nickName}, #{avatarUrl}, #{userType},
- #{mobile}, #{status}, #{unionId}, #{openId}, #{pcOpenId}, #{addTime}, #{updateTime}, #{bindTime},
- #{delFlag})
- </insert>
- <insert id="insertShopUser" parameterType="com.caimei365.user.model.po.UserPo" keyProperty="userId"
- useGeneratedKeys="true">
- insert into user(`userOrganizeID`, `registerTime`, `registerIP`, `ipAddress`, `source`, `registerUserTypeID`,
- `name`, `userName`, `bindMobile`, `email`, `userIdentity`,
- `manufacturerStatus`, `password`, `agreeFlag`, `validFlag`)
- values (#{organizeId}, #{registerTime}, #{registerIp}, #{ipAddress}, #{source}, #{registerUserTypeId}, #{name},
- #{userName}, #{bindMobile}, #{email}, #{userIdentity}, #{manufacturerStatus},
- #{password}, #{agreeFlag}, #{validFlag})
- </insert>
- <insert id="insertShop" parameterType="com.caimei365.user.model.po.ShopPo" keyProperty="shopId"
- useGeneratedKeys="true">
- insert into shop(`userID`, `name`, `sname`, `linkMan`, `contractMobile`, `contractEmail`, `provinceID`,
- `cityID`, `townID`, `address`, `socialCreditCode`, `businessLicenseImage`, `firstShopType`,
- `secondShopType`, `mainpro`, `productDesc`, `info`, `website`, `wxOfficialAccount`,
- `wxApplets`, `addTime`, `validFlag`, `status`, medicalPracticeLicenseImg1)
- values (#{userId}, #{name}, #{shortName}, #{linkMan}, #{contractMobile}, #{contractEmail}, #{provinceId},
- #{cityId}, #{townId}, #{address}, #{socialCreditCode}, #{businessLicense}, #{firstShopType},
- #{secondShopType}, #{mainProduct}, #{mainProductDesc}, #{shopDesc}, #{website}, #{wxOfficialAccount},
- #{wxApplets}, #{addTime}, #{validFlag}, #{status}, #{medicalPracticeLicenseImg1})
- </insert>
- <update id="updateUserClubId">
- update user
- set clubID = #{clubId}
- where userID = #{userId}
- </update>
- <update id="updateUserShopId">
- update user
- set shopID = #{shopId}
- where userID = #{userId}
- </update>
- <update id="updateClubUserByUpgrade">
- update user
- set registerIP = #{registerIp},
- email = #{email},
- name = #{name}
- where userID = #{userId}
- </update>
- <update id="updateShopUserByApply">
- update user set userName = #{userName}, name = #{name}, manufacturerStatus = #{manufacturerStatus}
- <if test="email != null and email != ''">
- , email = #{email}
- </if>
- where userID = #{userId}
- </update>
- <update id="updateClubByUpgrade">
- update club set userID = #{userId}, name = #{name}, sname = #{shortName}, contractEmail = #{contractEmail},
- <if test="contractPhone != null and contractPhone != ''">
- contractPhone = #{contractPhone},
- </if>
- <if test="linkMan != null and linkMan != ''">
- linkMan = #{linkMan},
- </if>
- <if test="linkManIdentity != null and linkManIdentity != ''">
- linkManIdentity = #{linkManIdentity},
- </if>
- provinceID = #{provinceId}, cityID = #{cityId}, townID = #{townId}, address = #{address},
- <if test="shopPhoto != null and shopPhoto != 'null' and shopPhoto != ''">
- headpic = #{shopPhoto},
- </if>
- businessLicenseImage = #{businessLicense}, socialCreditCode = #{socialCreditCode}, firstClubType =
- #{firstClubType},
- <if test="firstClubType == 1">
- secondClubType = #{secondClubType}, department = #{department}, medicalPracticeLicenseImg =
- #{medicalPracticeLicense},
- </if>
- <if test="mainProduct != null and mainProduct != ''">
- mainpro = #{mainProduct},
- </if>
- <if test="fax != null and fax != ''">
- fax = #{fax},
- </if>
- <if test="profile != null and profile != ''">
- info = #{profile},
- </if>
- status = #{status}
- where clubID = #{clubId}
- </update>
- <update id="updateShopInfoByApply">
- update shop set userID = #{userId}, name = #{name},
- <if test="shortName != null and shortName != ''">
- sname = #{shortName},
- </if>
- <if test="email != null and email != ''">
- contractEmail = #{email},
- </if>
- <if test="linkMan != null and linkMan != ''">
- linkMan = #{linkMan},
- </if>
- <if test="townId != null and townId != ''">
- provinceID = #{provinceId},cityID = #{cityId},townID = #{townId},address = #{address},
- </if>
- <if test="socialCreditCode != null and socialCreditCode != ''">
- socialCreditCode = #{socialCreditCode},
- </if>
- <if test="businessLicense != null and businessLicense != ''">
- businessLicenseImage = #{businessLicense},
- </if>
- <if test="firstShopType != null and firstShopType != ''">
- firstShopType = #{firstShopType},
- </if>
- <if test="secondShopType != null and secondShopType != ''">
- secondShopType = #{secondShopType},
- </if>
- <if test="mainProduct != null and mainProduct != ''">
- mainpro = #{mainProduct},
- </if>
- productDesc = #{mainProductDesc},
- info = #{shopDesc},
- website = #{website},
- wxOfficialAccount = #{wxOfficialAccount},
- wxApplets = #{wxApplets},
- status = #{status}
- where shopID = #{shopId}
- </update>
- <update id="updateGuideFlagByUserId">
- update user
- set guideFlag=1
- where userID = #{userId}
- </update>
- <insert id="insertClubTemporary" useGeneratedKeys="true" keyProperty="userId" keyColumn="id"
- parameterType="com.caimei365.user.model.dto.ClubOnlineDto">
- INSERT INTO `club_temporary` (`userId`, `name`, `shortName`, `bindMobile`,
- `contractEmail`, `linkMan`, `linkManIdentity`, `provinceId`,
- `cityId`, `townId`, `address`, `shopPhoto`,
- `businessLicense`, `socialCreditCode`,
- `firstClubType`, `secondClubType`,
- `department`, `medicalPracticeLicense`,
- `mainProduct`, `isAgreed`, addTime)
- VALUES (#{userId}, #{name}, #{shortName}, #{bindMobile},
- #{contractEmail}, #{linkMan}, #{linkManIdentity}, #{provinceId},
- #{cityId}, #{townId}, #{address}, #{shopPhoto},
- #{businessLicense}, #{socialCreditCode},
- #{firstClubType}, #{secondClubType},
- #{department}, #{medicalPracticeLicense},
- #{mainProduct}, #{isAgreed}, now())
- </insert>
- <select id="getTemporary" resultType="com.caimei365.user.model.vo.ClubTemporaryVo">
- SELECT `userId`,
- confirmUserId,
- `name`,
- `shortName`,
- `bindMobile`,
- `contractEmail`,
- `linkMan`,
- `provinceId`,
- `cityId`,
- `townId`,
- `address`,
- `shopPhoto`,
- `businessLicense`,
- `socialCreditCode`,
- `firstClubType`,
- `secondClubType`,
- `department`,
- `medicalPracticeLicense`,
- `mainProduct`,
- `isAgreed`
- FROM `club_temporary`
- WHERE id = #{id}
- </select>
- <insert id="insertBeansHistory">
- INSERT INTO `user_beans_history` (`userId`, `type`, `beansType`, `orderId`, `archiveId`,
- `num`, `pushStatus`, `addTime`, delFlag)
- VALUES (#{userId}, #{type}, #{beansType}, #{orderId}, #{archiveId},
- #{num}, #{pushStatus}, #{addTime}, 0)
- </insert>
- <update id="updateClubUser">
- UPDATE
- user
- SET bindMobile = #{bindMobile},
- userIdentity = #{userIdentity},
- email = #{email},
- userName = #{userName},
- source = #{source},
- password = #{password},
- registerUserTypeID = #{registerUserTypeId},
- name = #{name},
- registerTime = #{registerTime},
- registerIP = #{registerIp},
- ipAddress = #{ipAddress},
- serviceProviderStatus = #{serviceProviderStatus},
- serviceProviderID = #{serviceProviderId},
- guideFlag = #{guideFlag}
- WHERE userID = #{userId}
- </update>
- <update id="updateClub">
- UPDATE
- club
- SET name = #{name},
- sname = #{shortName},
- provinceID = #{provinceId},
- cityID = #{cityId},
- townID = #{townId},
- spID = #{serviceProviderId},
- address = #{address},
- linkMan = #{linkMan},
- contractPhone = #{contractPhone},
- contractMobile = #{contractMobile},
- fax = #{fax},
- contractEmail = #{contractEmail},
- info = #{profile},
- addTime = #{addTime},
- status = #{status},
- businessLicenseImage = #{businessLicense},
- defaultServiceProviderID = #{serviceProviderId},
- mainpro = #{mainProduct},
- headpic = #{shopPhoto},
- lastModify = NOW(),
- socialCreditCode = #{socialCreditCode},
- department = #{department},
- medicalPracticeLicenseImg = #{medicalPracticeLicense}
- WHERE userID = #{userId}
- </update>
- <select id="selProvince" resultType="java.lang.Integer">
- SELECT provinceID as provinceId
- FROM province
- WHERE NAME LIKE concat('%', #{regionPro}, '%')
- limit 1
- </select>
- <select id="selCity" resultType="java.lang.Integer">
- SELECT cityID as cityId
- FROM city
- WHERE NAME LIKE concat('%', #{regionCity}, '%')
- AND validFlag = 1
- limit 1
- </select>
- </mapper>
|