part1

  1. CREATE TABLE merchant_warehouse_rule(
  2. id INT NOT NULL AUTO_INCREMENT COMMENT 'id' ,
  3. merchant_id INT COMMENT '商户id' ,
  4. rule_type CHAR(1) COMMENT '分仓规则类型 1-按商品发货仓分仓2-按订单商品种类分仓' ,
  5. warehouse_id INT COMMENT '仓库id' ,
  6. create_at DATETIME COMMENT '创建时间' ,
  7. create_by INT COMMENT '创建人' ,
  8. update_at DATETIME COMMENT '更新时间' ,
  9. update_by INT COMMENT '更新人' ,
  10. PRIMARY KEY (id)
  11. ) COMMENT = '商户分仓规则 ';
  1. insert into merchant_warehouse_rule(merchant_id,rule_type,create_at,create_by)
  2. select id as merchant_id, '1' as rule_type, now() as create_at, create_by from merchant_info;

part2

  1. alter table mall_trade.order_info modify column `pay_way` char(1) COMMENT '支付方式: 1:微信2:对公3:礼品卡兑换4:生日券兑换5:节日券兑换6:积分兑换7:微信+积分混合支付8:特殊对公';
  2. alter table mall_trade.order_return modify column `pay_way` char(1) COMMENT '支付方式: 1:微信2:对公4:生日券兑换5:节日券兑换6:积分兑换7:微信+积分混合支付8:特殊对公';
  3. alter table mall_trade.pay_transaction modify column `pay_way` char(1) COMMENT '支付方式: 1:微信2:对公3:礼品卡兑换4:生日券兑换5:节日券兑换6:积分兑换7:微信+积分混合支付8:特殊对公';
  4. alter table mall_trade.pay_transaction_return modify column `pay_way` char(1) COMMENT '支付方式: 1:微信2:对公3:礼品卡兑换4:生日券兑换5:节日券兑换6:积分兑换7:微信+积分混合支付8:特殊对公';
  5. alter table mall_trade.payment_transaction_log modify column `pay_way` char(1) COMMENT '支付方式: 1:微信2:对公3:礼品卡兑换4:生日券兑换5:节日券兑换6:积分兑换7:微信+积分混合支付8:特殊对公';
  1. CREATE TABLE giftcard_batch_sku_detail(
  2. id INT NOT NULL AUTO_INCREMENT COMMENT 'id' ,
  3. batch_id VARCHAR(32) COMMENT '批次编号' ,
  4. spu_id INT COMMENT '可兑换商品编号' ,
  5. spu_name VARCHAR(128) COMMENT '可兑换商品名称' ,
  6. spu_sub_title VARCHAR(128) COMMENT '可兑换商品副标题' ,
  7. sku_id INT COMMENT '可兑换sku编号' ,
  8. sku_img VARCHAR(128) COMMENT '可兑换sku图片' ,
  9. sku_name VARCHAR(128) COMMENT '可兑换sku名称' ,
  10. sku_property VARCHAR(128) COMMENT '可兑换sku属性' ,
  11. num INT COMMENT '可兑换数量' ,
  12. ware_id VARCHAR(32) COMMENT '兑换商品发货仓库' ,
  13. status CHAR(1) COMMENT '状态 0-停用1-启用' ,
  14. create_by INT COMMENT '创建人' ,
  15. create_at DATETIME COMMENT '创建时间' ,
  16. update_by INT COMMENT '更新人' ,
  17. update_at DATETIME COMMENT '更新时间' ,
  18. PRIMARY KEY (id)
  19. ) COMMENT = '礼品卡可兑商品明细 ';
  1. insert into giftcard_batch_sku_detail (batch_id,spu_id,spu_name,spu_sub_title,sku_id,sku_img,sku_name,sku_property,num,ware_id,`status`,create_by,create_at) (
  2. select batch_id,spu_id,spu_name,spu_sub_title,sku_id,sku_img,sku_name,sku_property,num,ware_id,'1' as `status`,1 as create_by,now() as create_at
  3. from giftcard_batch
  4. where type = '1'
  5. )
  1. create index idx_bid_status on giftcard_batch_detail(`batch_id`, `status`);