select id, goods_id, is_default, product_name, price, price_n, price_m, purchase_price, stock, up_at, down_at, num_sale, status, create_at, del_flag, num, price_vip, copy_id from mall_goods_product
insert into mall_goods_product
goods_id,
is_default,
product_name,
price,
price_n,
price_m,
purchase_price,
stock,
up_at,
down_at,
num_sale,
status,
create_at,
del_flag,
num,
price_vip,
copy_id,
#{goodsId},
#{isDefault},
#{productName},
#{price},
#{priceN},
#{priceM},
#{purchasePrice},
#{stock},
#{upAt},
#{downAt},
#{numSale},
#{status},
#{createAt},
#{delFlag},
#{num},
#{priceVip},
#{copyId},
update mall_goods_product
goods_id = #{goodsId},
is_default = #{isDefault},
product_name = #{productName},
price = #{price},
price_n = #{priceN},
price_m = #{priceM},
purchase_price = #{purchasePrice},
stock = #{stock},
up_at = #{upAt},
down_at = #{downAt},
num_sale = #{numSale},
status = #{status},
create_at = #{createAt},
del_flag = #{delFlag},
num = #{num},
price_vip = #{priceVip},
copy_id = #{copyId},
where id = #{id}
update mall_goods_product
set del_flag = '1'
where goods_id = #{goodsId}
update mall_goods_product
set stock = stock + #{total}, num_sale = num_sale - #{total}
where id = #{productId}
update mall_goods_product
set stock = stock - #{total}, num_sale = num_sale + #{total}
where id = #{productId}
delete from mall_goods_product where id = #{id}
delete from mall_goods_product where id in
#{id}
insert into mall_goods_product(goods_id, is_default, product_name, price, price_vip, purchase_price, num, status, copy_id, create_at, del_flag) values
(#{item.goodsId},'0',#{item.productName},#{item.price},#{item.priceVip},#{item.purchasePrice},#{item.num}, 0, #{item.copyId}, sysdate(), '0')
update mall_goods_product
product_name = #{item.productName},
price = #{item.price},
price_vip = #{item.priceVip},
num = #{item.num},
where id = #{item.id}
delete from mall_goods_product
where id = #{item.id}
update mall_goods_product
is_default = '0',
where goods_id = #{goodsId}
update mall_goods_product
is_default = '1',
where goods_id = #{goodsId}
order by price asc
limit 1
insert into mall_goods_product(goods_id, is_default, product_name, price, price_vip, num, status, copy_id, create_at, del_flag) values
(#{item.goodsId},#{item.isDefault},#{item.productName},#{item.price} + 4,#{item.priceVip},#{item.num}, 0, #{item.copyId}, sysdate(), '0')
delete from mall_goods_product
where goods_id = #{item.id}
update mall_goods_product
price = #{item.price},
copy_id = #{item.copyId},
where id = #{item.id}