旅游团sql
This commit is contained in:
99
doc/sql/pending/app_tour_info.sql
Normal file
99
doc/sql/pending/app_tour_info.sql
Normal file
@@ -0,0 +1,99 @@
|
|||||||
|
|
||||||
|
DROP TABLE IF EXISTS tour_product;
|
||||||
|
CREATE TABLE tour_product
|
||||||
|
(
|
||||||
|
id int8 NOT NULL PRIMARY KEY, -- 主键ID
|
||||||
|
product_name varchar(100) NOT NULL, -- 产品名称 (如:恩施硒茶文化之旅)
|
||||||
|
sub_title varchar(255) DEFAULT NULL, -- 副标题/亮点 (如:4天3晚 | 研学之旅)
|
||||||
|
thumbnail_url text, -- 缩略图
|
||||||
|
main_image_url text[] default '{}'::text[], -- 商家主图
|
||||||
|
detail_images text[] default '{}'::text[], -- 详情展示多图
|
||||||
|
city_code varchar(20) DEFAULT NULL, -- 目的地城市编码
|
||||||
|
duration_days int4 DEFAULT NULL, -- 行程天数
|
||||||
|
duration_nights int4 DEFAULT NULL, -- 住宿晚数
|
||||||
|
base_price decimal(10, 2) NOT NULL, -- 基础起售价
|
||||||
|
adult_price decimal(10, 2) DEFAULT NULL, -- 成人单价
|
||||||
|
child_price decimal(10, 2) DEFAULT NULL, -- 儿童单价
|
||||||
|
description text DEFAULT NULL, -- 产品详情描述
|
||||||
|
visit_count int4 DEFAULT 0, -- 已成团次数
|
||||||
|
create_user int8 NULL, -- 创建人ID
|
||||||
|
create_dept int8 NULL, -- 创建部门ID
|
||||||
|
create_time timestamp(6) NULL, -- 创建时间
|
||||||
|
update_user int8 NULL, -- 修改人ID
|
||||||
|
update_time timestamp(6) NULL, -- 修改时间
|
||||||
|
status int4 NULL DEFAULT 1, -- 状态:0=下架,1=上架
|
||||||
|
is_deleted int4 DEFAULT 0 NULL -- 是否已删除:0=未删除,1=已删除
|
||||||
|
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
COMMENT ON TABLE tour_product IS '旅游产品表';
|
||||||
|
|
||||||
|
COMMENT ON COLUMN tour_product.id IS '主键ID';
|
||||||
|
COMMENT ON COLUMN tour_product.product_name IS '产品名称 (如:恩施硒茶文化之旅)';
|
||||||
|
COMMENT ON COLUMN tour_product.sub_title IS '副标题/亮点 (如:4天3晚 | 研学之旅)';
|
||||||
|
COMMENT ON COLUMN tour_product.thumbnail_url IS '缩略图';
|
||||||
|
COMMENT ON COLUMN tour_product.main_image_url IS '商家主图';
|
||||||
|
COMMENT ON COLUMN tour_product.detail_images IS '详情图';
|
||||||
|
COMMENT ON COLUMN tour_product.city_code IS '目的地城市编码';
|
||||||
|
COMMENT ON COLUMN tour_product.duration_days IS '行程天数';
|
||||||
|
COMMENT ON COLUMN tour_product.duration_nights IS '住宿晚数';
|
||||||
|
COMMENT ON COLUMN tour_product.base_price IS '基础起售价';
|
||||||
|
COMMENT ON COLUMN tour_product.adult_price IS '成人单价';
|
||||||
|
COMMENT ON COLUMN tour_product.child_price IS '儿童单价';
|
||||||
|
COMMENT ON COLUMN tour_product.description IS '产品详情描述';
|
||||||
|
COMMENT ON COLUMN tour_product.visit_count IS '已成团次数';
|
||||||
|
COMMENT ON COLUMN tour_product.create_user IS '创建人ID';
|
||||||
|
COMMENT ON COLUMN tour_product.create_dept IS '创建部门ID';
|
||||||
|
COMMENT ON COLUMN tour_product.create_time IS '创建时间';
|
||||||
|
COMMENT ON COLUMN tour_product.update_user IS '修改人ID';
|
||||||
|
COMMENT ON COLUMN tour_product.update_time IS '修改时间';
|
||||||
|
COMMENT ON COLUMN tour_product.status IS '状态:0=下架,1=上架';
|
||||||
|
COMMENT ON COLUMN tour_product.is_deleted IS '是否已删除:0=未删除,1=已删除';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS tour_order_traveler;
|
||||||
|
CREATE TABLE tour_order_traveler
|
||||||
|
(
|
||||||
|
id int8 NOT NULL PRIMARY KEY, -- 主键ID
|
||||||
|
order_id int8 NOT NULL, -- 关联订单ID
|
||||||
|
traveler_type int4 NOT NULL, -- 人员类型:1=成人,2=儿童
|
||||||
|
user_name varchar(50) NOT NULL, -- 姓名
|
||||||
|
id_card_no varchar(20) DEFAULT NULL, -- 身份证号
|
||||||
|
passport_no varchar(20) DEFAULT NULL, -- 护照号码(证件预留)
|
||||||
|
hk_macau_pass_no varchar(20) DEFAULT NULL, -- 港澳通行证号码
|
||||||
|
gender int4 DEFAULT NULL, -- 性别:1=男,2=女
|
||||||
|
contact_phone varchar(20) DEFAULT NULL, -- 出行人本人手机
|
||||||
|
create_user int8 NULL, -- 创建人ID
|
||||||
|
create_dept int8 NULL, -- 创建部门ID
|
||||||
|
create_time timestamp(6) NULL, -- 创建时间
|
||||||
|
update_user int8 NULL, -- 修改人ID
|
||||||
|
update_time timestamp(6) NULL, -- 修改时间
|
||||||
|
status int4 NULL DEFAULT 1, -- 状态:0=无效,1=有效
|
||||||
|
is_deleted int4 DEFAULT 0 NULL -- 是否已删除:0=未删除,1=已删除
|
||||||
|
|
||||||
|
);
|
||||||
|
|
||||||
|
COMMENT ON TABLE tour_order_traveler IS '订单出行人明细表';
|
||||||
|
COMMENT ON COLUMN tour_order_traveler.id IS '主键ID';
|
||||||
|
COMMENT ON COLUMN tour_order_traveler.order_id IS '关联订单ID';
|
||||||
|
COMMENT ON COLUMN tour_order_traveler.traveler_type IS '人员类型:1=成人,2=儿童';
|
||||||
|
COMMENT ON COLUMN tour_order_traveler.user_name IS '姓名';
|
||||||
|
COMMENT ON COLUMN tour_order_traveler.id_card_no IS '身份证号';
|
||||||
|
COMMENT ON COLUMN tour_order_traveler.passport_no IS '护照号码';
|
||||||
|
COMMENT ON COLUMN tour_order_traveler.hk_macau_pass_no IS '港澳通行证号码';
|
||||||
|
COMMENT ON COLUMN tour_order_traveler.gender IS '性别:1=男,2=女';
|
||||||
|
COMMENT ON COLUMN tour_order_traveler.contact_phone IS '出行人本人手机';
|
||||||
|
COMMENT ON COLUMN tour_order_traveler.create_user IS '创建人ID';
|
||||||
|
COMMENT ON COLUMN tour_order_traveler.create_dept IS '创建部门ID';
|
||||||
|
COMMENT ON COLUMN tour_order_traveler.create_time IS '创建时间';
|
||||||
|
COMMENT ON COLUMN tour_order_traveler.update_user IS '修改人ID';
|
||||||
|
COMMENT ON COLUMN tour_order_traveler.update_time IS '修改时间';
|
||||||
|
COMMENT ON COLUMN tour_order_traveler.status IS '状态:0=无效,1=有效';
|
||||||
|
COMMENT ON COLUMN tour_order_traveler.is_deleted IS '是否已删除:0=未删除,1=已删除';
|
||||||
|
|
||||||
|
CREATE INDEX idx_order_id ON tour_order_traveler(order_id);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user