a.id AS "id",
a.title AS "title",
a.discount AS "discount",
a.status AS "status",
a.productType AS "productType",
a.addTime AS "addTime"
INSERT INTO cm_hehe_discount(
title,
discount,
status,
productType,
addTime
) VALUES (
#{title},
#{discount},
#{status},
#{productType},
NOW()
)
UPDATE cm_hehe_discount SET
title = #{title},
discount = #{discount},
status = #{status},
productType = #{productType}
WHERE id = #{id}
update cm_hehe_discount
set status = #{status}
where id = #{id}
DELETE FROM cm_hehe_discount
WHERE id = #{id}
INSERT INTO `cm_hehe_discount_product` (
`discountId`, `productId`, discountPrice, `status`,
`sort`, `addTime`
)
VALUES
(
#{discountId}, #{productId}, #{discountPrice}, #{status},
#{sort}, #{addTime}
)
insert into cm_hehe_discount_user (discountId, userId, addTime) values (#{discountId}, #{userId}, #{addTime})
UPDATE
`cm_hehe_discount_product`
`status` = #{status},
`sort` = #{sort},
discountPrice = #{discountPrice}
WHERE
`id` = #{id}
delete from cm_hehe_discount_product where id = #{id}
delete from cm_hehe_discount_user where id = #{id}
delete from cm_hehe_discount_user where discountId = #{id}