a.newvalidFlag,
ifnull(a.newProductType,2) as newProductType,
ifnull(a.announType,1) as announType,
a.productID AS "id",
a.productID AS "productID",
a.groundMall AS "groundMall",
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.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.beforeValidFlag AS "beforeValidFlag",
copi.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.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,
a.returnGoodsStutas,
a.labelIds
left join cm_organize_product_info copi on copi.productId = a.productID
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,
priceFlag,
beautyActFlag,
hasSkuFlag,
mainImage,
propertiesInfo,
addTime,
updateTime,
sellNumber,
-- weekSellNumber,
-- beforeValidFlag,
validFlag,
favoriteTimes,
commentScore,
commentTimes,
-- selfRecommendFlag,
-- sysRecommendFlag,
sortIndex,
featuredFlag,
featuredSortIndex,
productCode,
-- synToERPFlag,
allAreaFlag,
provinceIDs,
serviceNumber,
packageCount,
byFlag,
normalProductFlag,
-- wholeSaleProductFlag,
-- promotionProductFlag,
-- groupBuyProductFlag,
step,
actFlag,
actType,
onlineTime,
downlineTime,
freePostFlag,
-- precisehKey,
returnGoodsStutas)
VALUES (#{id},
#{brandID},
#{tinyTypeID},
#{productCategory},
-- #{selfTypeID},
#{shopID},
#{name},
#{searchKey},
#{priceFlag},
#{beautyActFlag},
#{hasSkuFlag},
#{mainImage},
#{propertiesInfo},
#{addTime},
#{updateTime},
#{sellNumber},
-- #{weekSellNumber},
-- #{beforeValidFlag},
#{validFlag},
#{favoriteTimes},
#{commentScore},
#{commentTimes},
-- #{selfRecommendFlag},
-- #{sysRecommendFlag},
#{sortIndex},
#{featuredFlag},
#{featuredSortIndex},
#{productCode},
-- #{synToERPFlag},
#{allAreaFlag},
#{provinceIDs},
#{serviceNumber},
#{packageCount},
#{byFlag},
#{normalProductFlag},
-- #{wholeSaleProductFlag},
-- #{promotionProductFlag},
-- #{groupBuyProductFlag},
#{step},
#{actFlag},
#{actType},
#{onlineTime},
#{downlineTime},
#{freePostFlag},
-- #{precisehKey},
#{returnGoodsStutas})
UPDATE product
SET productID = #{id},
brandID = #{brandID},
tinyTypeID = #{tinyTypeID},
productCategory = #{productCategory},
-- selfTypeID = #{selfTypeID},
shopID = #{shopID},
name = #{name},
searchKey = #{searchKey},
priceFlag = #{priceFlag},
beautyActFlag = #{beautyActFlag},
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},
-- synToERPFlag = #{synToERPFlag},
allAreaFlag = #{allAreaFlag},
provinceIDs = #{provinceIDs},
serviceNumber = #{serviceNumber},
packageCount = #{packageCount},
byFlag = #{byFlag},
normalProductFlag = #{normalProductFlag},
-- wholeSaleProductFlag = #{wholeSaleProductFlag},
-- promotionProductFlag = #{promotionProductFlag},
-- groupBuyProductFlag = #{groupBuyProductFlag},
step = #{step},
actFlag = #{actFlag},
actType = #{actType},
onlineTime = #{onlineTime},
downlineTime = #{downlineTime},
freePostFlag = #{freePostFlag},
-- precisehKey = #{precisehKey},
actSort = #{actSort},
productType = #{productType},
qualificationImg = #{qualificationImg},
includedTax = #{includedTax},
invoiceType = #{invoiceType},
taxPoint = #{taxPoint},
supplierTaxPoint = #{supplierTaxPoint}
WHERE 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},
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},
favoriteTimes = #{favoriteTimes},
commentScore = #{commentScore},
commentTimes = #{commentTimes},
sortIndex = #{sortIndex},
featuredFlag = #{featuredFlag},
featuredSortIndex = #{featuredSortIndex},
productCode = #{productCode},
unit = #{unit},
allAreaFlag = #{allAreaFlag},
provinceIDs = #{provinceIDs},
serviceNumber = #{serviceNumber},
maxBuyNumber = #{maxBuyNumber},
minBuyNumber = #{minBuyNumber},
packageCount = #{packageCount},
byFlag = #{byFlag},
normalProductFlag = #{normalProductFlag},
step = #{step},
actFlag = #{actFlag},
actSort = #{actSort},
actType = #{actType},
onlineTime = #{onlineTime},
downlineTime = #{downlineTime},
freePostFlag = #{freePostFlag},
costPrice = #{costPrice},
shopPercent = #{shopPercent},
costCheckFlag = #{costCheckFlag},
visibility = #{visibility},
endTimeStr = #{endTimeStr},
tags = #{tags},
recommendType = #{recommendType},
machineType = #{machineType},
commodityType = #{commodityType},
showTime=#{showTime},
newshowTime=#{newshowTime},
showFlag=1
showFlag=4
where productID = #{productID} LIMIT 1;
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 taxPoint = #{taxPoint},
supplierTaxPoint = #{supplierTaxPoint}
where productID = #{productId}