a.id AS "id",
a.userId AS "userId",
a.confirmUserId AS "confirmUserId",
a.name AS "name",
a.shortName AS "shortName",
a.bindMobile AS "bindMobile",
a.contractEmail AS "contractEmail",
a.linkMan AS "linkMan",
a.linkManIdentity AS "linkManIdentity",
a.provinceId AS "provinceId",
a.cityId AS "cityId",
a.townId AS "townId",
a.address AS "address",
a.shopPhoto AS "shopPhoto",
a.businessLicense AS "businessLicense",
a.socialCreditCode AS "socialCreditCode",
a.firstClubType AS "firstClubType",
a.secondClubType AS "secondClubType",
a.department AS "department",
a.medicalPracticeLicense AS "medicalPracticeLicense",
a.mainProduct AS "mainProduct",
a.isAgreed AS "isAgreed",
a.addTime AS "addTime",
IFNULL(s.name,s.linkMan) AS "spName",
if(csu.delFlag = '0' and now() csu.endTime,1,0) as svipUserFlag
LEFT JOIN serviceprovider s ON s.userID = a.userId
LEFT JOIN cm_svip_user csu ON csu.userId = a.userId
INSERT INTO club_temporary(
id,
userId,
name,
shortName,
bindMobile,
contractEmail,
linkMan,
linkManIdentity,
provinceId,
cityId,
townId,
address,
shopPhoto,
businessLicense,
socialCreditCode,
firstClubType,
secondClubType,
department,
medicalPracticeLicense,
mainProduct,
isAgreed,
addTime
) VALUES (
#{id},
#{userId},
#{name},
#{shortName},
#{bindMobile},
#{contractEmail},
#{linkMan},
#{linkManIdentity},
#{provinceId},
#{cityId},
#{townId},
#{address},
#{shopPhoto},
#{businessLicense},
#{socialCreditCode},
#{firstClubType},
#{secondClubType},
#{department},
#{medicalPracticeLicense},
#{mainProduct},
#{isAgreed},
#{addTime}
)
UPDATE club_temporary SET
userId = #{userId},
confirmUserId = #{confirmUserId},
name = #{name},
shortName = #{shortName},
bindMobile = #{bindMobile},
contractEmail = #{contractEmail},
linkMan = #{linkMan},
linkManIdentity = #{linkManIdentity},
provinceId = #{provinceId},
cityId = #{cityId},
townId = #{townId},
address = #{address},
shopPhoto = #{shopPhoto},
businessLicense = #{businessLicense},
socialCreditCode = #{socialCreditCode},
firstClubType = #{firstClubType},
secondClubType = #{secondClubType},
department = #{department},
medicalPracticeLicense = #{medicalPracticeLicense},
mainProduct = #{mainProduct},
isAgreed = #{isAgreed},
addTime = #{addTime}
WHERE id = #{id}
DELETE FROM club_temporary
WHERE id = #{id}
INSERT INTO `club_confirm_record` (
`userId`,
`systemUserId`,
`images`,
`remarks`,
`confirmTime`
)
VALUES
(
#{userId},
#{systemUserId},
#{images},
#{remarks},
#{confirmTime}
)