a.newvalidFlag,
ifnull(a.newProductType,2) as newProductType,
ifnull(a.announType,1) as announType,
a.productID AS "id",
a.productID AS "productID",
a.brandID AS "brandID",
ifnull(a.bigTypeID,0) AS "bigTypeID",
ifnull(a.smallTypeID,0) AS "smallTypeID",
ifnull(a.tinyTypeID,0) AS "tinyTypeID",
a.productCategory AS "productCategory",
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.normalPrice AS "normalPrice",
a.price AS "price",
a.priceFlag AS "priceFlag",
a.beautyActFlag AS "beautyActFlag",
a.ladderPriceFlag AS "ladderPriceFlag",
a.stock AS "stock",
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.unit AS "unit",
a.synToERPFlag AS "synToERPFlag",
a.allAreaFlag AS "allAreaFlag",
a.provinceIDs AS "provinceIDs",
a.serviceNumber AS "serviceNumber",
a.maxBuyNumber AS "maxBuyNumber",
a.minBuyNumber AS "minBuyNumber",
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.costPrice AS "costPrice",
a.costProportional AS "costProportional",
a.costCheckFlag AS "costCheckFlag",
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.productType as "productType",
a.qualificationImg as "qualificationImg",
a.includedTax as "includedTax",
a.invoiceType as "invoiceType",
a.taxPoint as "taxPoint",
a.supplierTaxPoint as "supplierTaxPoint",
a.tags as "tags",
a.machineType as "machineType",
a.commodityType as "commodityType",
a.trainingMethod as "trainingMethod",
a.trainingType as "trainingType",
a.trainingFee as "trainingFee",
a.splitCode as "splitCode",
a.productDescribe as "productDescribe",
cshd.secondHandType as "secondHandType",
cshd.instrumentType as "instrumentType",
cshd.sold as "sold",
cshd.payStatus as "payStatus",
cshd.contactName as "contactName",
cshd.originalPrice as "originalPrice",
cshd.submitDate AS "submitDate",
cshd.reviewedDate AS "reviewedDate",
cshd.onLineDate AS "onLineDate",
cshd.brandName AS "otherBrandName",
cshd.publisher AS "publisher",
cshd.source AS "source",
cshd.dockingPeopleName AS "dockingPeopleName",
cb.name as "brandName",
if(csp.id is not null,1,0) as "svipFlag",
cshd.companyName as "companyName",
cshd.publishIdentity as "publishIdentity",
a.qualificationNo,
a.productName,
a.qualificationTime,
a.qualificationLink
LEFT JOIN shop s ON s.shopID = a.shopID
LEFT JOIN cm_second_hand_detail cshd ON cshd.productID = a.productID
LEFT JOIN cm_brand cb ON a.brandID = cb.id
LEFT JOIN cm_svip_product csp on a.productID = csp.productId
LEFT JOIN shop s on s.shopID = a.shopID
INNER JOIN tinytype AS b ON a.`tinyTypeID` = b.`tinyTypeID`
INNER JOIN smalltype AS c ON b.`smallTypeID` = c.`smallTypeID`
INNER JOIN bigtype AS d ON c.`bigTypeID` = d.`bigTypeID`
INSERT INTO product(productID,
brandID,
tinyTypeID,
productCategory,
selfTypeID,
shopID,
name,
searchKey,
normalPrice,
price,
priceFlag,
beautyActFlag,
ladderPriceFlag,
stock,
hasSkuFlag,
mainImage,
propertiesInfo,
addTime,
updateTime,
sellNumber,
weekSellNumber,
beforeValidFlag,
validFlag,
favoriteTimes,
commentScore,
commentTimes,
selfRecommendFlag,
sysRecommendFlag,
sortIndex,
featuredFlag,
featuredSortIndex,
productCode,
unit,
synToERPFlag,
allAreaFlag,
provinceIDs,
serviceNumber,
maxBuyNumber,
minBuyNumber,
packageCount,
byFlag,
normalProductFlag,
wholeSaleProductFlag,
promotionProductFlag,
groupBuyProductFlag,
step,
actFlag,
actType,
onlineTime,
downlineTime,
freePostFlag,
costPrice,
costProportional,
costCheckFlag,
precisehKey)
VALUES (#{id},
#{brandID},
#{tinyTypeID},
#{productCategory},
#{selfTypeID},
#{shopID},
#{name},
#{searchKey},
#{normalPrice},
#{price},
#{priceFlag},
#{beautyActFlag},
#{ladderPriceFlag},
#{stock},
#{hasSkuFlag},
#{mainImage},
#{propertiesInfo},
#{addTime},
#{updateTime},
#{sellNumber},
#{weekSellNumber},
#{beforeValidFlag},
#{validFlag},
#{favoriteTimes},
#{commentScore},
#{commentTimes},
#{selfRecommendFlag},
#{sysRecommendFlag},
#{sortIndex},
#{featuredFlag},
#{featuredSortIndex},
#{productCode},
#{unit},
#{synToERPFlag},
#{allAreaFlag},
#{provinceIDs},
#{serviceNumber},
#{maxBuyNumber},
#{minBuyNumber},
#{packageCount},
#{byFlag},
#{normalProductFlag},
#{wholeSaleProductFlag},
#{promotionProductFlag},
#{groupBuyProductFlag},
#{step},
#{actFlag},
#{actType},
#{onlineTime},
#{downlineTime},
#{freePostFlag},
#{costPrice},
#{costProportional},
#{costCheckFlag},
#{precisehKey})
UPDATE product
SET productID = #{id},
brandID = #{brandID},
tinyTypeID = #{tinyTypeID},
productCategory = #{productCategory},
selfTypeID = #{selfTypeID},
shopID = #{shopID},
name = #{name},
searchKey = #{searchKey},
normalPrice = #{normalPrice},
price = #{price},
priceFlag = #{priceFlag},
beautyActFlag = #{beautyActFlag},
ladderPriceFlag = #{ladderPriceFlag},
stock = #{stock},
hasSkuFlag = #{hasSkuFlag},
mainImage = #{mainImage},
propertiesInfo = #{propertiesInfo},
addTime = #{addTime},
updateTime = #{updateTime},
sellNumber = #{sellNumber},
weekSellNumber = #{weekSellNumber},
beforeValidFlag = #{beforeValidFlag},
validFlag = #{validFlag},
favoriteTimes = #{favoriteTimes},
commentScore = #{commentScore},
commentTimes = #{commentTimes},
selfRecommendFlag = #{selfRecommendFlag},
sysRecommendFlag = #{sysRecommendFlag},
sortIndex = #{sortIndex},
featuredFlag = #{featuredFlag},
featuredSortIndex = #{featuredSortIndex},
productCode = #{productCode},
unit = #{unit},
synToERPFlag = #{synToERPFlag},
allAreaFlag = #{allAreaFlag},
provinceIDs = #{provinceIDs},
serviceNumber = #{serviceNumber},
maxBuyNumber = #{maxBuyNumber},
minBuyNumber = #{minBuyNumber},
packageCount = #{packageCount},
byFlag = #{byFlag},
normalProductFlag = #{normalProductFlag},
wholeSaleProductFlag = #{wholeSaleProductFlag},
promotionProductFlag = #{promotionProductFlag},
groupBuyProductFlag = #{groupBuyProductFlag},
step = #{step},
actFlag = #{actFlag},
actType = #{actType},
onlineTime = #{onlineTime},
downlineTime = #{downlineTime},
freePostFlag = #{freePostFlag},
costPrice = #{costPrice},
costProportional = #{costProportional},
costCheckFlag = #{costCheckFlag},
precisehKey = #{precisehKey},
actSort = #{actSort},
productType = #{productType},
qualificationImg = #{qualificationImg},
includedTax = #{includedTax},
invoiceType = #{invoiceType},
taxPoint = #{taxPoint},
supplierTaxPoint = #{supplierTaxPoint}
WHERE productID = #{id}
update cm_syntolucenedoc set synFlag = 0,synType = 2
productID=#{id}
insert into productimage (productID, shopID, addTime, image, mainFlag, sortIndex)
values (#{productID}, #{shopID}, #{addTime}, #{image}, #{mainFlag}, #{sortIndex});
update product
floorId=#{floorId},
newvalidFlag=#{newvalidFlag},
brandID = #{brandID},
bigTypeID = #{bigTypeID},
smallTypeID = #{smallTypeID},
tinyTypeID = #{tinyTypeID},
preferredFlag = #{preferredFlag},
selfTypeID = #{selfTypeID},
shopID = #{shopID},
`name` = #{name},
aliasName = #{aliasName},
searchKey = #{searchKey},
productRemarks = #{productRemarks},
combinationID = #{combinationID},
normalPrice = #{normalPrice},
price = #{price},
priceFlag = #{priceFlag},
beautyActFlag = #{beautyActFlag},
ladderPriceFlag = #{ladderPriceFlag},
stock = #{stock},
hasSkuFlag = #{hasSkuFlag},
mainImage = #{mainImage},
propertiesInfo = #{propertiesInfo},
addTime = #{addTime},
updateTime = #{updateTime},
sellNumber = #{sellNumber},
weekSellNumber = #{weekSellNumber},
beforeValidFlag = #{beforeValidFlag},
validFlag = #{validFlag},
favoriteTimes = #{favoriteTimes},
commentScore = #{commentScore},
commentTimes = #{commentTimes},
selfRecommendFlag = #{selfRecommendFlag},
sysRecommendFlag = #{sysRecommendFlag},
sortIndex = #{sortIndex},
featuredFlag = #{featuredFlag},
featuredSortIndex = #{featuredSortIndex},
productCode = #{productCode},
unit = #{unit},
synToERPFlag = #{synToERPFlag},
allAreaFlag = #{allAreaFlag},
provinceIDs = #{provinceIDs},
serviceNumber = #{serviceNumber},
maxBuyNumber = #{maxBuyNumber},
minBuyNumber = #{minBuyNumber},
packageCount = #{packageCount},
byFlag = #{byFlag},
normalProductFlag = #{normalProductFlag},
wholeSaleProductFlag = #{wholeSaleProductFlag},
promotionProductFlag = #{promotionProductFlag},
groupBuyProductFlag = #{groupBuyProductFlag},
step = #{step},
actFlag = #{actFlag},
actSort = #{actSort},
actType = #{actType},
onlineTime = #{onlineTime},
downlineTime = #{downlineTime},
freePostFlag = #{freePostFlag},
costPrice = #{costPrice},
costProportional = #{costProportional},
costCheckFlag = #{costCheckFlag},
precisehKey = #{precisehKey},
visibility = #{visibility},
endTimeStr = #{endTimeStr},
tags = #{tags},
recommendType = #{recommendType},
machineType = #{machineType},
commodityType = #{commodityType},
showTime=#{showTime},
newshowTime=#{newshowTime},
showFlag=1
showFlag=4
where productID = #{productID}
update productimage
set sortIndex = #{sortIndex}
where productImageID = #{productImageID}
update productimage
set mainFlag = 0
where productID = #{productID}
and mainFlag = 1
update productimage
set mainFlag = 1
where productImageID = #{productImageID}
UPDATE product
SET mainImage = #{mainImage}
WHERE productID = #{productID}
DELETE
FROM productimage
WHERE productImageID = #{productImageID}
DELETE FROM productimage
WHERE productImageID IN
#{productImageID}
DELETE
FROM cm_product_related_parameters
WHERE productId = #{productId}
DELETE
FROM productimage
WHERE productID = #{productID}
insert into cm_product_related_parameters
(productId,
paramsName,
paramsContent,
delFlag)
values (#{productId},
#{paramsName},
#{paramsContent},
#{delFlag})
INSERT INTO `product_status_record` (`productId`,
`modifyUserId`,
`validFlag`,
`remarks`,
`addTime`)
VALUES (#{productId},
#{modifyUserId},
#{validFlag},
#{remarks},
#{addTime})
update product
set costPrice = #{costPrice},
costProportional = #{costProportional},
taxPoint = #{taxPoint},
supplierTaxPoint = #{supplierTaxPoint}
where productID = #{productId}