insert into mall_goods(
`merch_sn`,
third_party_merch_code,
`supplier_id`,
`goods_sn`,
`prod_barcode`,
`sku`,
`plu`,
`english_name`,
`cost_price`,
`daily_price`,
`goods_biz_type`,
`name`,
`unit_code`,
`brand`,
`brand_id`,
`category_id`,
attribute_category,
`goods_number`,
`keywords`,
`goods_brief`,
`goods_desc`,
`cus_goods_code`,
`ciq_prod_model`,
`ori_cnt_code`,
`cus_decl_ele`,
`cus_rec_code`,
`is_on_sale`,
`add_time`,
`sort_order`,
`is_delete`,
`counter_price`,
`extra_price`,
`is_new`,
`goods_unit`,
`primary_pic_url`,
`list_pic_url`,
`goods_rate`,
`sell_volume`,
`primary_product_id`,
`unit_price`,
`promotion_desc`,
`promotion_tag`,
`app_exclusive_price`,
`is_app_exclusive`,
`gross_weight`,
`net_weight`,
is_goods_share_stock,
`is_limited`,
`is_hot`,
`creater_sn`,
`create_time`,
`moder_sn`,
`mod_time`,
`mychem_id`,
`hs_code`,
`hs_code_name`,
`is_sync_hs_code`,
`is_sync_goods_rate`,
`imp_consum_tax_rate`,
`value_added_tax_rate`,
`legal_unit1_qty`,
`legal_unit2_qty`,
`cosm_threshold_value`,
`to_be_restored`,
`tstm`,
warehouse_sn,
consignor_sn,
warehous_sys_good_id,
inventory_type,
defective_products_grade
)
values(
#{merchSn},
#{thirdPartyMerchCode},
#{supplierId},
#{goodsSn},
#{prodBarcode},
#{sku},
#{plu},
#{englishName},
#{costPrice},
#{dailyPrice},
#{goodsBizType},
#{name},
#{unitCode},
#{brand},
#{brandId},
#{categoryId},
#{attributeCategory},
#{goodsNumber},
#{keywords},
#{goodsBrief},
#{goodsDesc},
#{cusGoodsCode},
#{ciqProdModel},
#{oriCntCode},
#{cusDeclEle},
#{cusRecCode},
#{isOnSale},
#{addTime},
#{sortOrder},
#{isDelete},
#{counterPrice},
#{extraPrice},
#{isNew},
#{goodsUnit},
#{primaryPicUrl},
#{listPicUrl},
#{goodsRate},
#{sellVolume},
#{primaryProductId},
#{unitPrice},
#{promotionDesc},
#{promotionTag},
#{appExclusivePrice},
#{isAppExclusive},
#{grossWeight},
#{netWeight},
#{isGoodsShareStock},
#{isLimited},
#{isHot},
#{createrSn},
#{createTime},
#{moderSn},
#{modTime},
#{mychemId},
#{hsCode},
#{hsCodeName},
'0',
'0',
#{impConsumTaxRate},
#{valueAddedTaxRate},
#{legalUnit1Qty},
#{legalUnit2Qty},
#{cosmThresholdValue},
0,
#{tstm},
#{warehouseSn},
#{consignorSn},
#{warehousSysGoodId},
#{inventoryType},
#{defectiveProductsGrade}
)
update mall_goods
`merch_sn` = #{merchSn},
`third_party_merch_code` = #{thirdPartyMerchCode},
`supplier_id` = #{supplierId},
`goods_sn` = #{goodsSn},
`prod_barcode` = #{prodBarcode},
`sku` = #{sku},
`plu` = #{plu},
`english_name` = #{englishName},
`cost_price` = #{costPrice},
`daily_price` = #{dailyPrice},
`goods_biz_type` = #{goodsBizType},
`name` = #{name},
`unit_code` = #{unitCode},
`brand` = #{brand},
`brand_id` = #{brandId},
`category_id` = #{categoryId},
`attribute_category` = #{attributeCategory},
`goods_number` = #{goodsNumber},
`keywords` = #{keywords},
`goods_brief` = #{goodsBrief},
`goods_desc` = #{goodsDesc},
`cus_goods_code` = #{cusGoodsCode},
`ciq_prod_model` = #{ciqProdModel},
`ori_cnt_code` = #{oriCntCode},
`cus_decl_ele` = #{cusDeclEle},
`cus_rec_code` = #{cusRecCode},
`is_on_sale` = #{isOnSale},
`add_time` = #{addTime},
`sort_order` = #{sortOrder},
`is_delete` = #{isDelete},
`counter_price` = #{counterPrice},
`extra_price` = #{extraPrice},
`is_new` = #{isNew},
`goods_unit` = #{goodsUnit},
`primary_pic_url` = #{primaryPicUrl},
`list_pic_url` = #{listPicUrl},
`goods_rate` = #{goodsRate},
`sell_volume` = #{sellVolume},
`primary_product_id` = #{primaryProductId},
`unit_price` = #{unitPrice},
`promotion_desc` = #{promotionDesc},
`promotion_tag` = #{promotionTag},
`app_exclusive_price` = #{appExclusivePrice},
`is_app_exclusive` = #{isAppExclusive},
`gross_weight` = #{grossWeight},
`net_weight` = #{netWeight},
`is_goods_share_stock` = #{isGoodsShareStock},
`is_limited` = #{isLimited},
`is_hot` = #{isHot},
`creater_sn` = #{createrSn},
`create_time` = #{createTime},
`moder_sn` = #{moderSn},
`mod_time` = #{modTime},
`tstm` = #{tstm},
`last_sale_time` = #{lastSaleTime},
`mychem_id` = #{mychemId},
`hs_code` = #{hsCode},
`hs_code_name` = #{hsCodeName},
`is_sync_hs_code` = #{isSyncHsCode},
`is_sync_goods_rate` = #{isSyncGoodsRate},
`imp_consum_tax_rate` = #{impConsumTaxRate},
`value_added_tax_rate` = #{valueAddedTaxRate},
`legal_unit1_qty` = #{legalUnit1Qty},
`legal_unit2_qty` = #{legalUnit2Qty},
`cosm_threshold_value` = #{cosmThresholdValue},
`to_be_restored` = #{toBeRestored},
`warehouse_sn` = #{warehouseSn},
`consignor_sn` = #{consignorSn},
`warehous_sys_good_id` = #{warehousSysGoodId},
`inventory_type` = #{inventoryType},
`defective_products_grade` = #{defectiveProductsGrade}
where id = #{id}
delete from mall_goods where id = #{value}
delete from mall_goods where id in
#{id}
insert into mall_goods(
`merch_sn`,
third_party_merch_code,
`supplier_id`,
`goods_sn`,
`prod_barcode`,
`sku`,
`plu`,
`english_name`,
`cost_price`,
`daily_price`,
`goods_biz_type`,
`name`,
`unit_code`,
`brand`,
`brand_id`,
`category_id`,
`goods_number`,
`keywords`,
`goods_brief`,
`goods_desc`,
`cus_goods_code`,
`ciq_prod_model`,
`ori_cnt_code`,
`cus_decl_ele`,
`cus_rec_code`,
`is_on_sale`,
`add_time`,
`sort_order`,
`is_delete`,
`counter_price`,
`extra_price`,
`is_new`,
`goods_unit`,
`primary_pic_url`,
`list_pic_url`,
`goods_rate`,
`sell_volume`,
`primary_product_id`,
`unit_price`,
`promotion_desc`,
`promotion_tag`,
`app_exclusive_price`,
`is_app_exclusive`,
`gross_weight`,
`net_weight`,
is_goods_share_stock,
`is_limited`,
`is_hot`,
`creater_sn`,
`create_time`,
`moder_sn`,
`mod_time`,
`mychem_id`,
`hs_code`,
`hs_code_name`,
`is_sync_hs_code`,
`is_sync_goods_rate`,
`imp_consum_tax_rate`,
`value_added_tax_rate`,
`legal_unit1_qty`,
`legal_unit2_qty`,
`cosm_threshold_value`,
`to_be_restored`,
`tstm`)
values
(
#{item.merchSn},
#{item.thirdPartyMerchCode},
#{item.supplierId},
#{item.goodsSn},
#{item.prodBarcode},
#{item.sku},
#{item.plu},
#{item.englishName},
#{item.costPrice},
#{item.dailyPrice},
#{item.goodsBizType},
#{item.name},
#{item.unitCode},
#{item.brand},
#{item.brandId},
#{item.categoryId},
#{item.goodsNumber},
#{item.keywords},
#{item.goodsBrief},
#{item.goodsDesc},
#{item.cusGoodsCode},
#{item.ciqProdModel},
#{item.oriCntCode},
#{item.cusDeclEle},
#{item.cusRecCode},
#{item.isOnSale},
#{item.addTime},
#{item.sortOrder},
#{item.isDelete},
#{item.counterPrice},
#{item.extraPrice},
#{item.isNew},
#{item.goodsUnit},
#{item.primaryPicUrl},
#{item.listPicUrl},
#{item.goodsRate},
#{item.sellVolume},
#{item.primaryProductId},
#{item.unitPrice},
#{item.promotionDesc},
#{item.promotionTag},
#{item.appExclusivePrice},
#{item.isAppExclusive},
#{item.grossWeight},
#{item.netWeight},
#{item.isGoodsShareStock},
#{item.isLimited},
#{item.isHot},
#{item.createrSn},
#{item.createTime},
#{item.moderSn},
#{item.modTime},
#{item.mychemId},
#{item.hsCode},
#{item.hsCodeName},
'0',
'0',
#{item.impConsumTaxRate},
#{item.valueAddedTaxRate},
#{item.legalUnit1Qty},
#{item.legalUnit2Qty},
#{item.cosmThresholdValue},
#{item.toBeRestored},
#{item.tstm})
update mall_goods
`merch_sn` = #{item.merchSn},
`third_party_merch_code` = #{item.thirdPartyMerchCode},
`supplier_id` = #{item.supplierId},
`goods_sn` = #{item.goodsSn},
`prod_barcode` = #{item.prodBarcode},
`sku` = #{item.sku},
`plu` = #{item.plu},
`english_name` = #{item.englishName},
`cost_price` = #{item.costPrice},
`daily_price` = #{item.dailyPrice},
`goods_biz_type` = #{item.goodsBizType},
`name` = #{item.name},
`unit_code` = #{item.unitCode},
`brand` = #{item.brand},
`brand_id` = #{item.brandId},
`category_id` = #{item.categoryId},
`goods_number` = #{item.goodsNumber},
`keywords` = #{item.keywords},
`goods_brief` = #{item.goodsBrief},
`goods_desc` = #{item.goodsDesc},
`cus_goods_code` = #{item.cusGoodsCode},
`ciq_prod_model` = #{item.ciqProdModel},
`ori_cnt_code` = #{item.oriCntCode},
`cus_decl_ele` = #{item.cusDeclEle},
`cus_rec_code` = #{item.cusRecCode},
`is_on_sale` = #{item.isOnSale},
`add_time` = #{item.addTime},
`sort_order` = #{item.sortOrder},
`is_delete` = #{item.isDelete},
`counter_price` = #{item.counterPrice},
`extra_price` = #{item.extraPrice},
`is_new` = #{item.isNew},
`goods_unit` = #{item.goodsUnit},
`primary_pic_url` = #{item.primaryPicUrl},
`list_pic_url` = #{item.listPicUrl},
`goods_rate` = #{item.goodsRate},
`sell_volume` = #{item.sellVolume},
`primary_product_id` = #{item.primaryProductId},
`unit_price` = #{item.unitPrice},
`promotion_desc` = #{item.promotionDesc},
`promotion_tag` = #{item.promotionTag},
`app_exclusive_price` = #{item.appExclusivePrice},
`is_app_exclusive` = #{item.isAppExclusive},
`gross_weight` = #{item.grossWeight},
`net_weight` = #{item.netWeight},
`is_goods_share_stock` = #{item.isGoodsShareStock},
`is_limited` = #{item.isLimited},
`is_hot` = #{item.isHot},
`creater_sn` = #{item.createrSn},
`create_time` = #{item.createTime},
`moder_sn` = #{item.moderSn},
`mod_time` = #{item.modTime},
`tstm` = #{item.tstm},
`last_sale_time` = #{item.lastSaleTime},
`mychem_id` = #{item.mychemId},
`hs_code` = #{item.hsCode},
`hs_code_name` = #{item.hsCodeName},
`is_sync_hs_code` = #{item.isSyncHsCode},
`is_sync_goods_rate` = #{item.isSyncGoodsRate},
`imp_consum_tax_rate` = #{item.impConsumTaxRate},
`value_added_tax_rate` = #{item.valueAddedTaxRate},
`legal_unit1_qty` = #{item.legalUnit1Qty},
`legal_unit2_qty` = #{item.legalUnit2Qty},
`cosm_threshold_value` = #{item.cosmThresholdValue},
`to_be_restored` = #{item.toBeRestored}
where id = #{item.id}
update mall_goods
goods_number=
when sku=#{item.sku} then goods_number+#{item.goodsNumber}
where
sku=#{item.sku}
update mall_goods
set goods_number = #{goodsNumber}
where
prod_barcode = #{prodBarcode} and sku = #{sku}
update mall_goods
goods_number =
when sku = #{item.sku} then goods_number - #{item.number}
where
sku = #{item.sku}
update mall_goods
goods_number =
when sku = #{item.sku} then goods_number + #{item.number}
where
sku = #{item.sku}