a.id AS "id",
a.name AS "name",
a.couponAmount AS "couponAmount",
a.touchPrice AS "touchPrice",
a.startDate AS "startDate",
a.endDate AS "endDate",
a.status AS "status",
a.couponType AS "couponType",
a.vipFlag AS "vipFlag",
a.userId AS "userId",
a.shopId AS "shopId",
a.productType AS "productType",
a.pcBanner AS "pcBanner",
a.appletsBanner AS "appletsBanner",
a.categoryType AS "categoryType",
a.couponsMode AS "couponsMode",
a.createDate AS "createDate",
a.delFlag AS "delFlag"
a.shopID AS "shopID",
a.checkMan as "checkMan",
a.userID AS "userID",
a.name AS "name",
u.userName AS "sname",
a.logo AS "logo",
a.legalPerson AS "legalPerson",
a.businessLicense AS "businessLicense",
a.businessLicenseImage AS "businessLicenseImage",
a.taxCertificate AS "taxCertificate",
a.taxCertificateImage AS "taxCertificateImage",
a.townID AS "townID",
d.provinceID AS "provinceID",
c.cityID AS "cityID",
a.address AS "address",
a.registeredCapital AS "registeredCapital",
a.nature AS "nature",
a.turnover AS "turnover",
a.linkMan AS "linkMan",
a.contractPhone AS "contractPhone",
ifnull(u.bindMobile,a.contractMobile) AS "contractMobile",
a.contractEmail AS "contractEmail",
a.fax AS "fax",
a.zipCode AS "zipCode",
a.info AS "info",
a.productDesc AS "productDesc",
a.website,
a.wxOfficialAccount,
a.wxApplets,
a.addTime AS "addTime",
a.auditStatus AS "auditStatus",
a.auditTime AS "auditTime",
a.auditNote AS "auditNote",
a.validFlag AS "validFlag",
a.status AS "status",
a.maintenanceFee AS "maintenanceFee",
a.maintenanceDate AS "maintenanceDate",
a.businessScope AS "businessScope",
u.account AS "account",
u.registerTime AS "registerTime",
a.firstShopType AS "firstShopType",
a.secondShopType AS "secondShopType",
a.medicalPracticeLicenseImg1 AS "medicalPracticeLicenseImg1",
a.medicalPracticeLicenseImg2 AS "medicalPracticeLicenseImg2",
a.medicalPracticeLicenseImg3 AS "medicalPracticeLicenseImg3",
a.mainpro AS "mainpro",
a.bankAccount AS "bankAccount",
a.ableRebateAmount AS "ableRebateAmount",
a.rebateAmount AS "rebateAmount",
a.bankAccountName AS "bankAccountName",
a.bankName AS "bankName",
a.socialCreditCode AS "socialCreditCode",
u.email,
u.source AS "source",
a.shopType AS "shopType",
a.cardNumber AS "cardNumber",
a.chargeSupport AS "chargeSupport",
d.name AS "province",c.name AS "city",b.name AS "town"
a.productID AS "id",
a.productID AS "productId",
a.brandID AS "brandID",
a.bigTypeID AS "bigTypeID",
ifnull(a.smallTypeID,-1) AS "smallTypeID",
ifnull(a.tinyTypeID,-1) AS "tinyTypeID",
a.selfTypeID AS "selfTypeID",
a.preferredFlag AS "preferredFlag",
a.shopID AS "shopId",
a.name AS "name",
a.searchKey AS "searchKey",
a.combinationID AS "combinationID",
a.productRemarks AS "productRemarks",
a.priceFlag AS "priceFlag",
a.beautyActFlag AS "beautyActFlag",
a.hasSkuFlag AS "hasSkuFlag",
a.mainImage AS "mainImage",
a.propertiesInfo AS "propertiesInfo",
a.addTime AS "addTime",
a.updateTime AS "updateTime",
a.sellNumber AS "sellNumber",
a.weekSellNumber AS "weekSellNumber",
a.beforeValidFlag AS "beforeValidFlag",
a.validFlag AS "validFlag",
a.favoriteTimes AS "favoriteTimes",
a.commentScore AS "commentScore",
a.commentTimes AS "commentTimes",
a.selfRecommendFlag AS "selfRecommendFlag",
a.sysRecommendFlag AS "sysRecommendFlag",
a.sortIndex AS "sortIndex",
a.featuredFlag AS "featuredFlag",
a.featuredSortIndex AS "featuredSortIndex",
a.productCode AS "productCode",
a.synToERPFlag AS "synToERPFlag",
a.allAreaFlag AS "allAreaFlag",
a.provinceIDs AS "provinceIDs",
a.serviceNumber AS "serviceNumber",
a.packageCount AS "packageCount",
a.byFlag AS "byFlag",
a.normalProductFlag AS "normalProductFlag",
a.wholeSaleProductFlag AS "wholeSaleProductFlag",
a.promotionProductFlag AS "promotionProductFlag",
a.groupBuyProductFlag AS "groupBuyProductFlag",
a.step AS "step",
a.actStatus AS "actStatus",
a.actFlag AS "actFlag",
a.actType AS "actType",
a.onlineTime AS "onlineTime",
a.downlineTime AS "downlineTime",
a.freePostFlag AS "freePostFlag",
a.precisehKey AS "precisehKey",
s.name AS "shopName",
a.actSort AS "actSort",
a.recommendType AS "recommendType",
a.aliasName as "aliasName",
a.visibility as "visibility",
# a.commodityDetailsFlag as "commodityDetailsFlag",
a.productType as "productType",
a.qualificationImg as "qualificationImg",
a.includedTax as "includedTax",
a.invoiceType as "invoiceType",
a.taxPoint as "taxPoint",
a.tags as "tags",
a.machineType as "machineType",
a.trainingMethod as "trainingMethod",
a.trainingType as "trainingType",
a.trainingFee as "trainingFee",
a.commodityType as "commodityType",
a.splitCode,
a.announType,
ifnull(a.newvalidFlag,0),
ifnull(a.newProductType,2),
a.showFlag,
a.showTime,
a.newshowTime,
a.recommend,
a.qualificationNo,
a.productName,
a.qualificationTime,
a.qualificationLink,
a.labelIds
LEFT JOIN user u ON u.userID = a.userID
LEFT JOIN town b ON b.townID=a.townID
LEFT JOIN city c ON c.cityID=b.cityID
LEFT JOIN province d ON d.provinceID=c.provinceID
INSERT INTO message_center (shopID, clubID, userType, messageType, content, time, accountType, couponType,
couponFee, couponMessageType, orderID, orderMessageType, shopMessType, productID)
VALUES (#{shopId}, #{clubId}, #{userType}, #{messageType}, #{content}, #{time}, #{accountType}, #{couponType},
#{couponFee}, #{couponMessageType}, #{orderId}, #{orderMessageType}, #{shopMessType}, #{productId})
insert into cm_svip_history(userId, packageId, beginTime, endTime, payStatus, payWay, price, userBeans, payTime)
values (#{userId}, 0, #{beginTime}, #{endTime}, 1, #{payWay}, 0, 0, #{payTime})
UPDATE cm_svip_user
SET
beginTime = #{beginTime},
endTime = #{endTime},
updateTime = now()
WHERE userId = #{userId}
insert into cm_svip_user (userId, beginTime, endTime, delFlag, updateTime)
values (#{userId}, #{beginTime}, #{endTime}, 0, #{beginTime})
UPDATE cm_coupon SET delFlag = 1 WHERE id = #{couponId}
UPDATE cm_coupon_product SET delFlag = 1 WHERE couponId = #{couponId}
UPDATE cm_svip_coupon_month SET useTime=#{useTime}, updateTime=#{updateTime}, status=#{status}, delFlag=#{delFlag}
WHERE id=#{id}
UPDATE cm_svip_coupon SET delFlag=1 WHERE montId = #{montId}
INSERT INTO `cm_coupon_product` (
`couponId`, `productId`, `pcStatus`,
`appletsStatus`,
`sort`, `addTime`, `delFlag`
)
VALUES
(
#{couponId}, #{productId}, #{pcStatus},
#{appletsStatus},
#{sort}, #{addTime}, #{delFlag}
)
UPDATE
`cm_coupon_product`
`pcStatus` = #{pcStatus},
`appletsStatus` = #{appletsStatus},
`sort` = #{sort},
WHERE
`id` = #{id}
UPDATE cm_coupon_product SET delFlag = 1 WHERE id = #{id}
INSERT INTO cm_coupon(
name,
couponPayWay,
couponAmount,
touchPrice,
startDate,
endDate,
receivePeriod,
receiveFlag,
useTimeFlag,
usePeriod,
status,
couponType,
vipFlag,
userId,
shopId,
productType,
pcBanner,
appletsBanner,
categoryType,
couponsMode,
createDate,
moneyCouponPrice,
moneyCouponFlag,
moneyCouponType,
delFlag,
configure
) VALUES (
#{name},
#{couponPayWay},
#{couponAmount},
#{touchPrice},
#{startDate},
#{endDate},
#{receivePeriod},
#{receiveFlag},
#{useTimeFlag},
#{usePeriod},
#{status},
#{couponType},
#{vipFlag},
#{userId},
#{shopId},
#{productType},
#{pcBanner},
#{appletsBanner},
#{categoryType},
#{couponsMode},
#{createDate},
#{moneyCouponPrice},
#{moneyCouponFlag},
#{moneyCouponType},
#{delFlag},
#{configure}
)
UPDATE cm_coupon SET
name = #{name},
couponPayWay = #{couponPayWay},
couponAmount = #{couponAmount},
touchPrice = #{touchPrice},
startDate = #{startDate},
endDate = #{endDate},
receivePeriod = #{receivePeriod},
receiveFlag = #{receiveFlag},
useTimeFlag = #{useTimeFlag},
usePeriod = #{usePeriod},
status = #{status},
couponType = #{couponType},
vipFlag = #{vipFlag},
userId = #{userId},
shopId = #{shopId},
productType = #{productType},
pcBanner = #{pcBanner},
appletsBanner = #{appletsBanner},
categoryType = #{categoryType},
couponsMode = #{couponsMode},
moneyCouponPrice = #{moneyCouponPrice},
moneyCouponType = #{moneyCouponType},
configure = #{configure}
WHERE id = #{id}
update cm_svip_package
set
price = #{price},
proportion = #{proportion}
where duration = #{duration}