a.id AS "id",
a.productId AS "productId",
ifnull(a.bigTypeId,0) AS "bigTypeId",
ifnull(a.smallTypeId,0) AS "smallTypeId",
a.validFlag AS "validFlag",
a.includedTax AS "includedTax",
a.invoiceType AS "invoiceType",
a.clubTaxPoint AS "clubTaxPoint",
a.shopTaxPoint AS "shopTaxPoint",
a.oldProductId,
a.addTime AS "addTime",
p.name AS "name",
p.mainImage AS "mainImage",
s.name AS "shopName",
chap.activityId,
group_concat(chfp.floorId) as floorIds
LEFT JOIN product p ON a.productId = p.productID
LEFT JOIN shop s ON s.shopID = p.shopID
left join cm_hehe_activity_product chap on a.productId = chap.productId
left join cm_hehe_floor_product chfp on a.productId = chfp.productId
INSERT INTO cm_hehe_product(productId,
bigTypeId,
smallTypeId,
validFlag,
includedTax,
invoiceType,
clubTaxPoint,
shopTaxPoint,
addTime)
VALUES (#{productId},
#{bigTypeId},
#{smallTypeId},
#{validFlag},
#{includedTax},
#{invoiceType},
#{clubTaxPoint},
#{shopTaxPoint},
NOW())
insert into cm_hehe_activity_product (activityId, productId, addTime, delFlag)
values (#{activityId}, #{productId}, NOW(), 0)
insert into cm_hehe_floor_product(floorId, productId, validFlag, recommend, sort, addTime)
VALUES (#{floorId}, #{productId}, 1, 0, 1, NOW())
insert into cm_hehe_sku(skuid, productid, price)
values (#{skuId}, #{productId}, #{price})
UPDATE cm_hehe_product
SET productId = #{productId},
bigTypeId = #{bigTypeId},
smallTypeId = #{smallTypeId},
validFlag = #{validFlag},
includedTax = #{includedTax},
invoiceType = #{invoiceType},
clubTaxPoint = #{clubTaxPoint},
shopTaxPoint = #{shopTaxPoint}
WHERE id = #{id}
DELETE
FROM cm_hehe_product
WHERE id = #{id}
UPDATE cm_hehe_activity_product
SET delFlag = 1
WHERE productId = #{productId}
delete from cm_hehe_sku
WHERE productId = #{productId}
update cm_hehe_product
set oldProductId = #{oldProductId},
productId = #{newProductId}
where productId = #{oldProductId}
update cm_hehe_sku
set price=#{price}
where skuId = #{skuId}