bt-2301-2月份需求.sql 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. -- 数据字典:所属区域【界面中手动添加】
  2. -- INSERT INTO zuihou_base_bt_0000.c_common_dictionary (id,type_,name,describe_,status_,create_user,create_time) VALUES (7,'REGION','所属区域','',1,3,'2023-02-20 15:06:33');
  3. -- 新增 所属区域 字段
  4. ALTER TABLE zuihou_base_bt_0000.c_core_org ADD region_id BIGINT(20) NULL COMMENT '所属区域ID(数据字典项 - REGION)';
  5. ALTER TABLE zuihou_base_bt_0000.bt_place ADD region_id BIGINT(20) NULL COMMENT '所属区域ID(数据字典项 - REGION)';
  6. -- 新增 简介 字段
  7. ALTER TABLE zuihou_base_bt_0000.bt_goods ADD introduction varchar(200) NULL COMMENT '简介';
  8. -- 新增 优惠券 表,承载优惠券数据
  9. create table bt_coupon
  10. (
  11. id bigint(20) not null comment '主键',
  12. name varchar(100) not null comment '优惠券名称',
  13. preferential_amount decimal(20,2) not null comment '优惠金额',
  14. quantity int not null comment '数量',
  15. preferential_method char(1) not null comment '优惠方式: 0 -> 按月累计消费, 1 -> 历史消费累计',
  16. accumulated_amount decimal(20,2) not null comment '累计金额',
  17. end_date datetime not null comment '优惠结束时间',
  18. status char(1) not null comment '状态: 0 -> 冻结(结束) 1 -> 启用(进行中),默认为冻结',
  19. remark text comment '说明',
  20. create_time datetime not null comment '创建时间',
  21. create_user bigint(20) not null comment '创建人',
  22. update_time datetime not null comment '修改时间',
  23. update_user bigint(20) not null comment '修改人',
  24. delete_flag char(1) not null comment '删除标识: 0 -> 未删除, 1 -> 删除,落库是默认为0',
  25. primary key (id)
  26. );
  27. alter table bt_coupon comment '优惠券';
  28. -- 新增 会员优惠券 表,承载会员领券记录
  29. create table bt_member_coupon
  30. (
  31. id bigint(20) not null comment '',
  32. member_id bigint(20) not null comment '会员ID,关联bt_member表主键',
  33. coupon_id bigint(20) not null comment '优惠券ID,关联bt_coupon表主键',
  34. receive_preferential_amount decimal(20,2) not null comment '领券优惠金额:对应优惠券领取时的即时金额,使用时,以即时金额为基准,确保对应优惠券的优惠金额变更时领券金额不受更新影响',
  35. status char(1) not null comment '使用状态: 0 -> 未使用, 1 -> 已使用',
  36. create_time datetime not null comment '创建时间',
  37. update_time datetime not null comment '修改时间',
  38. primary key (id)
  39. );
  40. alter table bt_member_coupon comment '会员优惠券';