insert into user(`userOrganizeID`,`registerTime`,`registerIP`, `ipAddress`, `source`, `registerUserTypeID`, `name`, `userName`, `bindMobile`, `email`, `userIdentity`, `userPermission`,`guideFlag`,`clubStatus`, `password`, `agreeFlag`, `validFlag`, `serviceProviderID`, `serviceProviderStatus`, userBeans)
values(#{organizeId},#{registerTime},#{registerIp},#{ipAddress},#{source},#{registerUserTypeId},#{name},#{userName},#{bindMobile},#{email},#{userIdentity},#{userPermission},#{guideFlag},#{clubStatus},#{password},#{agreeFlag},#{validFlag},#{serviceProviderId},#{serviceProviderStatus}, #{userBeans})
insert into cm_organ_value_system
(userID, activeState, customerValue, stage, delType)
values(#{userID},"新增用户","一般挽留客户",0,1)
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 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 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 into user(`userOrganizeID`,`registerTime`, `registerIP`, `ipAddress`, `source`, `registerUserTypeID`, `name`, `userName`, `bindMobile`, `email`, `userIdentity`, `userPermission`, `manufacturerStatus` , `password`, `agreeFlag`, `validFlag`)
values(#{organizeId},#{registerTime},#{registerIp},#{ipAddress},#{source},#{registerUserTypeId},#{name},#{userName},#{bindMobile},#{email},#{userIdentity},#{userPermission},#{manufacturerStatus},#{password},#{agreeFlag},#{validFlag})
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})
update user set clubID = #{clubId} where userID = #{userId}
update user set shopID = #{shopId} where userID = #{userId}
update user set registerIP = #{registerIp},
email = #{email},
name = #{name},
clubStatus = #{clubStatus}
where userID = #{userId}
update user set userName = #{userName}, name = #{name}, manufacturerStatus = #{manufacturerStatus}
, email = #{email}
where userID = #{userId}
update club set userID = #{userId}, name = #{name}, sname = #{shortName}, contractEmail = #{contractEmail},
contractPhone = #{contractPhone},
linkMan = #{linkMan},
linkManIdentity = #{linkManIdentity},
provinceID = #{provinceId}, cityID = #{cityId}, townID = #{townId}, address = #{address},
headpic = #{shopPhoto},
businessLicenseImage = #{businessLicense}, socialCreditCode = #{socialCreditCode}, firstClubType = #{firstClubType},
secondClubType = #{secondClubType}, department = #{department}, medicalPracticeLicenseImg = #{medicalPracticeLicense},
mainpro = #{mainProduct},
fax = #{fax},
info = #{profile},
status = #{status}
where clubID = #{clubId}
update shop set userID = #{userId}, name = #{name},
sname = #{shortName},
contractEmail = #{email},
linkMan = #{linkMan},
provinceID = #{provinceId},cityID = #{cityId},townID = #{townId},address = #{address},
socialCreditCode = #{socialCreditCode},
businessLicenseImage = #{businessLicense},
firstShopType = #{firstShopType},
secondShopType = #{secondShopType},
mainpro = #{mainProduct},
productDesc = #{mainProductDesc},
info = #{shopDesc},
website = #{website},
wxOfficialAccount = #{wxOfficialAccount},
wxApplets = #{wxApplets},
status = #{status}
where shopID = #{shopId}
update user set guideFlag=1 where userID=#{userId}
INSERT INTO `club_temporary` (
`userId`, `name`, `shortName`, `bindMobile`,
`contractEmail`, `linkMan`, `linkManIdentity`, `provinceId`,
`cityId`, `townId`, `address`, `shopPhoto`,
`businessLicense`, `socialCreditCode`,
`firstClubType`, `secondClubType`,
`department`, `medicalPracticeLicense`,
`mainProduct`, `isAgreed`
)
VALUES
(
#{userId}, #{name}, #{shortName}, #{bindMobile},
#{contractEmail}, #{linkMan}, #{linkManIdentity}, #{provinceId},
#{cityId}, #{townId}, #{address}, #{shopPhoto},
#{businessLicense}, #{socialCreditCode},
#{firstClubType}, #{secondClubType},
#{department}, #{medicalPracticeLicense},
#{mainProduct}, #{isAgreed}
)
INSERT INTO `user_beans_history` (
`userId`, `type`, `beansType`, `orderId`, `archiveId`,
`num`, `pushStatus`, `addTime`, delFlag
)
VALUES
(
#{userId}, #{type}, #{beansType}, #{orderId}, #{archiveId},
#{num}, #{pushStatus}, #{addTime}, 0
)
UPDATE
user
SET
bindMobile = #{bindMobile},
userPermission = #{userPermission},
userIdentity = #{userIdentity},
email = #{email},
userName = #{userName},
source = #{source},
password = #{password},
registerUserTypeID = #{registerUserTypeId},
name = #{name},
registerTime = #{registerTime},
registerIP = #{registerIp},
ipAddress = #{ipAddress},
clubStatus = #{clubStatus},
serviceProviderStatus = #{serviceProviderStatus},
serviceProviderID = #{serviceProviderId},
guideFlag = #{guideFlag}
WHERE
userID = #{userId}
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}