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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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.bt_goods ADD introduction varchar(200) NULL COMMENT '简介';
  5. -- 新增表:组织 - 所属区域
  6. create table c_core_org_region
  7. (
  8. id bigint(20) not null comment '主键',
  9. org_id bigint(20) not null comment '组织机构ID',
  10. region_id bigint(20) not null comment '所属区域ID(数据字典项 - REGION)',
  11. create_time datetime not null comment '创建时间',
  12. create_user bigint(20) not null comment '创建人',
  13. primary key (id)
  14. ) DEFAULT CHARSET=utf8mb4 comment '组织 - 所属区域';
  15. -- 新增表:组织 - 所属区域
  16. create table bt_place_region
  17. (
  18. id bigint(20) not null comment '主键',
  19. place_id bigint(20) not null comment '场地ID',
  20. region_id bigint(20) not null comment '所属区域ID(数据字典项 - REGION)',
  21. create_time datetime not null comment '创建时间',
  22. create_user bigint(20) not null comment '创建人',
  23. primary key (id)
  24. ) DEFAULT CHARSET=utf8mb4 comment '场地 - 所属区域';
  25. -- 新增表:优惠券
  26. create table bt_coupon
  27. (
  28. id bigint(20) not null comment '主键',
  29. name varchar(100) not null comment '优惠券名称',
  30. preferential_amount decimal(20,2) not null comment '优惠金额',
  31. quantity int not null comment '数量',
  32. preferential_method char(1) not null comment '优惠方式: 0 -> 按月累计消费, 1 -> 历史消费累计',
  33. accumulated_amount decimal(20,2) not null comment '累计金额',
  34. end_date datetime not null comment '优惠结束时间',
  35. status char(1) not null comment '状态: 0 -> 冻结(结束) 1 -> 启用(进行中),默认为冻结',
  36. remark text comment '说明',
  37. create_time datetime not null comment '创建时间',
  38. create_user bigint(20) not null comment '创建人',
  39. update_time datetime not null comment '修改时间',
  40. update_user bigint(20) not null comment '修改人',
  41. delete_flag char(1) not null comment '删除标识: 0 -> 未删除, 1 -> 删除,落库是默认为0',
  42. primary key (id)
  43. ) DEFAULT CHARSET=utf8mb4 comment '优惠券';
  44. -- 新增表:会员优惠券
  45. create table bt_member_coupon
  46. (
  47. id bigint(20) not null comment '',
  48. member_id bigint(20) not null comment '会员ID,关联bt_member表主键',
  49. coupon_id bigint(20) not null comment '优惠券ID,关联bt_coupon表主键',
  50. receive_preferential_amount decimal(20,2) not null comment '领券优惠金额:对应优惠券领取时的即时金额,使用时,以即时金额为基准,确保对应优惠券的优惠金额变更时领券金额不受更新影响',
  51. status char(1) not null comment '使用状态: 0 -> 未使用, 1 -> 已使用',
  52. create_time datetime not null comment '创建时间',
  53. update_time datetime not null comment '修改时间',
  54. primary key (id)
  55. ) DEFAULT CHARSET=utf8mb4 comment '会员优惠券';