/*
 Navicat Premium Data Transfer

 Source Server         : 61.144.183.57
 Source Server Type    : PostgreSQL
 Source Server Version : 160003
 Source Host           : 61.144.183.57:15432
 Source Catalog        : themetis_app
 Source Schema         : themetis_scp

 Target Server Type    : PostgreSQL
 Target Server Version : 160003
 File Encoding         : 65001

 Date: 15/11/2025 13:08:16
*/


-- ----------------------------
-- Table structure for scp_simulation_scenario
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_simulation_scenario";
CREATE TABLE "themetis_scp"."scp_simulation_scenario" (
  "id" "pg_catalog"."int8" NOT NULL DEFAULT nextval('"themetis_scp".scp_simulation_scenario_id_seq'::regclass),
  "sim_scenario_code" "pg_catalog"."varchar" COLLATE "pg_catalog"."default" NOT NULL,
  "sim_scenario_name" "pg_catalog"."varchar" COLLATE "pg_catalog"."default" NOT NULL,
  "bl_workflow_id" "pg_catalog"."int8" NOT NULL,
  "bl_instance_id" "pg_catalog"."varchar" COLLATE "pg_catalog"."default" NOT NULL,
  "bl_run_batch_id" "pg_catalog"."int8" NOT NULL,
  "bl_period_code" "pg_catalog"."varchar" COLLATE "pg_catalog"."default" NOT NULL,
  "sim_workflow_id" "pg_catalog"."int8" NOT NULL,
  "sim_instance_id" "pg_catalog"."varchar" COLLATE "pg_catalog"."default" NOT NULL,
  "current_sim_period_code" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "delete_flag" "pg_catalog"."bool" NOT NULL DEFAULT false,
  "meta_attr01" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "meta_attr02" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "meta_attr03" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "meta_attr04" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "meta_attr05" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "meta_attr06" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "meta_attr07" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "meta_attr08" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "meta_attr09" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "meta_attr10" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "creation_date" "pg_catalog"."timestamp",
  "last_update_date" "pg_catalog"."timestamp",
  "created_by" "pg_catalog"."int4",
  "last_updated_by" "pg_catalog"."int4",
  "tenant_id" "pg_catalog"."int8" NOT NULL DEFAULT '-1'::integer,
  "meta_attr11" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "meta_attr12" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "meta_attr13" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "meta_attr14" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "meta_attr15" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "meta_attr16" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "meta_attr17" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "meta_attr18" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "meta_attr19" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "meta_attr20" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "meta_attr26" "pg_catalog"."numeric",
  "meta_attr27" "pg_catalog"."numeric",
  "meta_attr28" "pg_catalog"."numeric",
  "meta_attr29" "pg_catalog"."numeric",
  "meta_attr30" "pg_catalog"."numeric",
  "meta_attr31" "pg_catalog"."timestamp",
  "meta_attr32" "pg_catalog"."timestamp",
  "meta_attr33" "pg_catalog"."timestamp",
  "meta_attr34" "pg_catalog"."timestamp",
  "meta_attr35" "pg_catalog"."timestamp",
  "meta_attr36" "pg_catalog"."numeric",
  "meta_attr37" "pg_catalog"."numeric",
  "meta_attr38" "pg_catalog"."numeric",
  "meta_attr39" "pg_catalog"."numeric",
  "meta_attr40" "pg_catalog"."numeric",
  "meta_attr21" "pg_catalog"."timestamp",
  "meta_attr22" "pg_catalog"."timestamp",
  "meta_attr23" "pg_catalog"."timestamp",
  "meta_attr24" "pg_catalog"."timestamp",
  "meta_attr25" "pg_catalog"."timestamp",
  "lock_version" "pg_catalog"."int2" NOT NULL DEFAULT 0
)
;
COMMENT ON COLUMN "themetis_scp"."scp_simulation_scenario"."sim_scenario_code" IS '模拟场景代码';
COMMENT ON COLUMN "themetis_scp"."scp_simulation_scenario"."sim_scenario_name" IS '模拟场景名称';
COMMENT ON COLUMN "themetis_scp"."scp_simulation_scenario"."bl_workflow_id" IS '基线工作流ID';
COMMENT ON COLUMN "themetis_scp"."scp_simulation_scenario"."bl_instance_id" IS '基线引擎实例ID';
COMMENT ON COLUMN "themetis_scp"."scp_simulation_scenario"."bl_run_batch_id" IS '基线运行批次ID';
COMMENT ON COLUMN "themetis_scp"."scp_simulation_scenario"."bl_period_code" IS '基线期次代码';
COMMENT ON COLUMN "themetis_scp"."scp_simulation_scenario"."sim_workflow_id" IS '模拟工作流ID';
COMMENT ON COLUMN "themetis_scp"."scp_simulation_scenario"."sim_instance_id" IS '模拟引擎实例ID';
COMMENT ON COLUMN "themetis_scp"."scp_simulation_scenario"."current_sim_period_code" IS '当前期次代码';
COMMENT ON TABLE "themetis_scp"."scp_simulation_scenario" IS '模拟场景';

-- ----------------------------
-- Table structure for scp_sop_bucket_data
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_sop_bucket_data";
CREATE TABLE "themetis_scp"."scp_sop_bucket_data" (
  "id" "pg_catalog"."int8" NOT NULL DEFAULT nextval('"themetis_scp".scp_sop_bucket_data_id_seq'::regclass),
  "workbench_code" "pg_catalog"."varchar" COLLATE "pg_catalog"."default" NOT NULL,
  "planning_item_code" "pg_catalog"."varchar" COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_type_code" "pg_catalog"."varchar" COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_code" "pg_catalog"."varchar" COLLATE "pg_catalog"."default" NOT NULL,
  "demand_unit_code" "pg_catalog"."varchar" COLLATE "pg_catalog"."default" NOT NULL,
  "supply_unit_code" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "supply_center_code" "pg_catalog"."varchar" COLLATE "pg_catalog"."default" NOT NULL,
  "attribute_code" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "planner_code" "pg_catalog"."varchar" COLLATE "pg_catalog"."default" NOT NULL,
  "figure_code" "pg_catalog"."varchar" COLLATE "pg_catalog"."default" NOT NULL,
  "product_hierarchy_code" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "product_category_code" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "product_hierarchy_path" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "approval_instance_id" "pg_catalog"."int8",
  "source_workbench_code" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "source_figure_group_code" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "source_figure_code" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "source_period_type_code" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "source_period_code" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "aggregated_type" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "customer_no" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "contract_no" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "project_code" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "supplier_no" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "production_delivery_method" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "bk_qty_001" "pg_catalog"."numeric",
  "bk_qty_002" "pg_catalog"."numeric",
  "bk_qty_003" "pg_catalog"."numeric",
  "bk_qty_004" "pg_catalog"."numeric",
  "bk_qty_005" "pg_catalog"."numeric",
  "bk_qty_006" "pg_catalog"."numeric",
  "bk_qty_007" "pg_catalog"."numeric",
  "bk_qty_008" "pg_catalog"."numeric",
  "bk_qty_009" "pg_catalog"."numeric",
  "bk_qty_010" "pg_catalog"."numeric",
  "bk_qty_011" "pg_catalog"."numeric",
  "bk_qty_012" "pg_catalog"."numeric",
  "bk_qty_013" "pg_catalog"."numeric",
  "bk_qty_014" "pg_catalog"."numeric",
  "bk_qty_015" "pg_catalog"."numeric",
  "bk_qty_016" "pg_catalog"."numeric",
  "bk_qty_017" "pg_catalog"."numeric",
  "bk_qty_018" "pg_catalog"."numeric",
  "bk_qty_019" "pg_catalog"."numeric",
  "bk_qty_020" "pg_catalog"."numeric",
  "bk_qty_021" "pg_catalog"."numeric",
  "bk_qty_022" "pg_catalog"."numeric",
  "bk_qty_023" "pg_catalog"."numeric",
  "bk_qty_024" "pg_catalog"."numeric",
  "bk_qty_025" "pg_catalog"."numeric",
  "bk_qty_026" "pg_catalog"."numeric",
  "bk_qty_027" "pg_catalog"."numeric",
  "bk_qty_028" "pg_catalog"."numeric",
  "bk_qty_029" "pg_catalog"."numeric",
  "bk_qty_030" "pg_catalog"."numeric",
  "bk_qty_031" "pg_catalog"."numeric",
  "bk_qty_032" "pg_catalog"."numeric",
  "bk_qty_033" "pg_catalog"."numeric",
  "bk_qty_034" "pg_catalog"."numeric",
  "bk_qty_035" "pg_catalog"."numeric",
  "bk_qty_036" "pg_catalog"."numeric",
  "bk_qty_037" "pg_catalog"."numeric",
  "bk_qty_038" "pg_catalog"."numeric",
  "bk_qty_039" "pg_catalog"."numeric",
  "bk_qty_040" "pg_catalog"."numeric",
  "bk_qty_041" "pg_catalog"."numeric",
  "bk_qty_042" "pg_catalog"."numeric",
  "bk_qty_043" "pg_catalog"."numeric",
  "bk_qty_044" "pg_catalog"."numeric",
  "bk_qty_045" "pg_catalog"."numeric",
  "bk_qty_046" "pg_catalog"."numeric",
  "bk_qty_047" "pg_catalog"."numeric",
  "bk_qty_048" "pg_catalog"."numeric",
  "bk_qty_049" "pg_catalog"."numeric",
  "bk_qty_050" "pg_catalog"."numeric",
  "bk_qty_051" "pg_catalog"."numeric",
  "bk_qty_052" "pg_catalog"."numeric",
  "bk_qty_053" "pg_catalog"."numeric",
  "bk_qty_054" "pg_catalog"."numeric",
  "bk_qty_055" "pg_catalog"."numeric",
  "bk_qty_056" "pg_catalog"."numeric",
  "bk_qty_057" "pg_catalog"."numeric",
  "bk_qty_058" "pg_catalog"."numeric",
  "bk_qty_059" "pg_catalog"."numeric",
  "bk_qty_060" "pg_catalog"."numeric",
  "bk_qty_061" "pg_catalog"."numeric",
  "bk_qty_062" "pg_catalog"."numeric",
  "bk_qty_063" "pg_catalog"."numeric",
  "bk_qty_064" "pg_catalog"."numeric",
  "bk_qty_065" "pg_catalog"."numeric",
  "bk_qty_066" "pg_catalog"."numeric",
  "bk_qty_067" "pg_catalog"."numeric",
  "bk_qty_068" "pg_catalog"."numeric",
  "bk_qty_069" "pg_catalog"."numeric",
  "bk_qty_070" "pg_catalog"."numeric",
  "bk_qty_071" "pg_catalog"."numeric",
  "bk_qty_072" "pg_catalog"."numeric",
  "bk_qty_073" "pg_catalog"."numeric",
  "bk_qty_074" "pg_catalog"."numeric",
  "bk_qty_075" "pg_catalog"."numeric",
  "bk_qty_076" "pg_catalog"."numeric",
  "bk_qty_077" "pg_catalog"."numeric",
  "bk_qty_078" "pg_catalog"."numeric",
  "bk_qty_079" "pg_catalog"."numeric",
  "bk_qty_080" "pg_catalog"."numeric",
  "bk_qty_081" "pg_catalog"."numeric",
  "bk_qty_082" "pg_catalog"."numeric",
  "bk_qty_083" "pg_catalog"."numeric",
  "bk_qty_084" "pg_catalog"."numeric",
  "bk_qty_085" "pg_catalog"."numeric",
  "bk_qty_086" "pg_catalog"."numeric",
  "bk_qty_087" "pg_catalog"."numeric",
  "bk_qty_088" "pg_catalog"."numeric",
  "bk_qty_089" "pg_catalog"."numeric",
  "bk_qty_090" "pg_catalog"."numeric",
  "bk_qty_091" "pg_catalog"."numeric",
  "bk_qty_092" "pg_catalog"."numeric",
  "bk_qty_093" "pg_catalog"."numeric",
  "bk_qty_094" "pg_catalog"."numeric",
  "bk_qty_095" "pg_catalog"."numeric",
  "bk_qty_096" "pg_catalog"."numeric",
  "bk_qty_097" "pg_catalog"."numeric",
  "bk_qty_098" "pg_catalog"."numeric",
  "bk_qty_099" "pg_catalog"."numeric",
  "bk_qty_100" "pg_catalog"."numeric",
  "bk_qty_101" "pg_catalog"."numeric",
  "bk_qty_102" "pg_catalog"."numeric",
  "bk_qty_103" "pg_catalog"."numeric",
  "bk_qty_104" "pg_catalog"."numeric",
  "sum_qty_01" "pg_catalog"."numeric",
  "sum_qty_02" "pg_catalog"."numeric",
  "sum_qty_03" "pg_catalog"."numeric",
  "sum_qty_04" "pg_catalog"."numeric",
  "sum_qty_05" "pg_catalog"."numeric",
  "sum_qty_06" "pg_catalog"."numeric",
  "sum_qty_07" "pg_catalog"."numeric",
  "sum_qty_08" "pg_catalog"."numeric",
  "sum_qty_09" "pg_catalog"."numeric",
  "sum_qty_10" "pg_catalog"."numeric",
  "sum_qty_11" "pg_catalog"."numeric",
  "sum_qty_12" "pg_catalog"."numeric",
  "sum_qty_13" "pg_catalog"."numeric",
  "sum_qty_14" "pg_catalog"."numeric",
  "sum_qty_15" "pg_catalog"."numeric",
  "sum_qty_16" "pg_catalog"."numeric",
  "sum_qty_17" "pg_catalog"."numeric",
  "sum_qty_18" "pg_catalog"."numeric",
  "sum_qty_19" "pg_catalog"."numeric",
  "sum_qty_20" "pg_catalog"."numeric",
  "creation_date" "pg_catalog"."timestamp",
  "last_update_date" "pg_catalog"."timestamp",
  "created_by" "pg_catalog"."int4",
  "last_updated_by" "pg_catalog"."int4",
  "tenant_id" "pg_catalog"."int8" NOT NULL DEFAULT '-1'::integer,
  "head_id" "pg_catalog"."int8",
  "lock_version" "pg_catalog"."int2" NOT NULL DEFAULT 0
)
;
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."workbench_code" IS '工作台代码';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."planning_item_code" IS '计划对象编码';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."planning_period_type_code" IS '期次类型码';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."planning_period_code" IS '期次码';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."demand_unit_code" IS '需求计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."supply_unit_code" IS '供应计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."attribute_code" IS '属性码';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."planner_code" IS '计划员代码';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."figure_code" IS '数据维度码';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."product_hierarchy_code" IS '产品树编码';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."product_category_code" IS '产品编码';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."product_hierarchy_path" IS '产品树路径';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."approval_instance_id" IS '审批实例ID,editable_flag=TRUE的figure_code才需要审批流实例';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."source_workbench_code" IS '来源工作台代码';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."source_figure_group_code" IS '来源维度组';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."source_figure_code" IS '来源数据维度码';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."source_period_type_code" IS '来源期次类型码';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."source_period_code" IS '来源期次码';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."aggregated_type" IS 'NONE;MATERIAL_GROUP;PRODUCT_CATEGORY;SUPPLY_UNIT';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."customer_no" IS '客户代码';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."contract_no" IS '合同号';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."project_code" IS '项目编码';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."supplier_no" IS '供应商号';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."production_delivery_method" IS '生产交付模式：ETO,MTO,MTS';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_001" IS 'bucket数量1';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_002" IS 'bucket数量2';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_003" IS 'bucket数量3';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_004" IS 'bucket数量4';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_005" IS 'bucket数量5';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_006" IS 'bucket数量6';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_007" IS 'bucket数量7';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_008" IS 'bucket数量8';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_009" IS 'bucket数量9';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_010" IS 'bucket数量10';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_011" IS 'bucket数量11';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_012" IS 'bucket数量12';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_013" IS 'bucket数量13';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_014" IS 'bucket数量14';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_015" IS 'bucket数量15';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_016" IS 'bucket数量16';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_017" IS 'bucket数量17';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_018" IS 'bucket数量18';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_019" IS 'bucket数量19';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_020" IS 'bucket数量20';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_021" IS 'bucket数量21';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_022" IS 'bucket数量22';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_023" IS 'bucket数量23';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_024" IS 'bucket数量24';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_025" IS 'bucket数量25';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_026" IS 'bucket数量26';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_027" IS 'bucket数量27';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_028" IS 'bucket数量28';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_029" IS 'bucket数量29';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_030" IS 'bucket数量30';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_031" IS 'bucket数量31';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_032" IS 'bucket数量32';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_033" IS 'bucket数量33';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_034" IS 'bucket数量34';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_035" IS 'bucket数量35';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_036" IS 'bucket数量36';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_037" IS 'bucket数量37';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_038" IS 'bucket数量38';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_039" IS 'bucket数量39';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_040" IS 'bucket数量40';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_041" IS 'bucket数量41';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_042" IS 'bucket数量42';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_043" IS 'bucket数量43';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_044" IS 'bucket数量44';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_045" IS 'bucket数量45';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_046" IS 'bucket数量46';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_047" IS 'bucket数量47';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_048" IS 'bucket数量48';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_049" IS 'bucket数量49';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_050" IS 'bucket数量50';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_051" IS 'bucket数量51';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_052" IS 'bucket数量52';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_053" IS 'bucket数量53';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_054" IS 'bucket数量54';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_055" IS 'bucket数量55';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_056" IS 'bucket数量56';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_057" IS 'bucket数量57';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_058" IS 'bucket数量58';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_059" IS 'bucket数量59';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_060" IS 'bucket数量60';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_061" IS 'bucket数量61';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_062" IS 'bucket数量62';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_063" IS 'bucket数量63';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_064" IS 'bucket数量64';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_065" IS 'bucket数量65';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_066" IS 'bucket数量66';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_067" IS 'bucket数量67';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_068" IS 'bucket数量68';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_069" IS 'bucket数量69';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_070" IS 'bucket数量70';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_071" IS 'bucket数量71';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_072" IS 'bucket数量72';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_073" IS 'bucket数量73';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_074" IS 'bucket数量74';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_075" IS 'bucket数量75';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_076" IS 'bucket数量76';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_077" IS 'bucket数量77';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_078" IS 'bucket数量78';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_079" IS 'bucket数量79';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_080" IS 'bucket数量80';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_081" IS 'bucket数量81';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_082" IS 'bucket数量82';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_083" IS 'bucket数量83';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_084" IS 'bucket数量84';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_085" IS 'bucket数量85';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_086" IS 'bucket数量86';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_087" IS 'bucket数量87';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_088" IS 'bucket数量88';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_089" IS 'bucket数量89';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_090" IS 'bucket数量90';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_091" IS 'bucket数量91';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_092" IS 'bucket数量92';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_093" IS 'bucket数量93';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_094" IS 'bucket数量94';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_095" IS 'bucket数量95';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_096" IS 'bucket数量96';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_097" IS 'bucket数量97';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_098" IS 'bucket数量98';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_099" IS 'bucket数量99';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_100" IS 'bucket数量100';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_101" IS 'bucket数量101';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_102" IS 'bucket数量102';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_103" IS 'bucket数量103';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_104" IS 'bucket数量104';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."sum_qty_01" IS '汇总数量1';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."sum_qty_02" IS '汇总数量2';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."sum_qty_03" IS '汇总数量3';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."sum_qty_04" IS '汇总数量4';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."sum_qty_05" IS '汇总数量5';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."sum_qty_06" IS '汇总数量6';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."sum_qty_07" IS '汇总数量7';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."sum_qty_08" IS '汇总数量8';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."sum_qty_09" IS '汇总数量9';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."sum_qty_10" IS '汇总数量10';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."sum_qty_11" IS '汇总数量11';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."sum_qty_12" IS '汇总数量12';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."sum_qty_13" IS '汇总数量13';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."sum_qty_14" IS '汇总数量14';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."sum_qty_15" IS '汇总数量15';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."sum_qty_16" IS '汇总数量16';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."sum_qty_17" IS '汇总数量17';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."sum_qty_18" IS '汇总数量18';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."sum_qty_19" IS '汇总数量19';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."sum_qty_20" IS '汇总数量20';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."tenant_id" IS '租户ID';
COMMENT ON TABLE "themetis_scp"."scp_sop_bucket_data" IS 'DP需求预测bucket数据';

-- ----------------------------
-- Table structure for scp_sop_planning_item
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_sop_planning_item";
CREATE TABLE "themetis_scp"."scp_sop_planning_item" (
  "id" "pg_catalog"."int8" NOT NULL DEFAULT nextval('"themetis_scp".scp_sop_planning_item_id_seq'::regclass),
  "workbench_code" "pg_catalog"."varchar" COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_type_code" "pg_catalog"."varchar" COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_code" "pg_catalog"."varchar" COLLATE "pg_catalog"."default" NOT NULL,
  "demand_unit_code" "pg_catalog"."varchar" COLLATE "pg_catalog"."default" NOT NULL,
  "supply_unit_code" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "supply_center_code" "pg_catalog"."varchar" COLLATE "pg_catalog"."default" NOT NULL,
  "planning_item_code" "pg_catalog"."varchar" COLLATE "pg_catalog"."default" NOT NULL,
  "planner_code" "pg_catalog"."varchar" COLLATE "pg_catalog"."default" NOT NULL,
  "status" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "product_hierarchy_code" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "product_category_code" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "product_hierarchy_path" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "customer_no" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "contract_no" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "order_no" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "project_code" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "supplier_no" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "production_delivery_method" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "attribute_code" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "aggregated_type" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "meta_attr01" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "meta_attr02" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "meta_attr03" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "meta_attr04" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "meta_attr05" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "meta_attr06" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "meta_attr07" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "meta_attr08" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "meta_attr09" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "meta_attr10" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "meta_attr11" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "meta_attr12" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "meta_attr13" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "meta_attr14" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "meta_attr15" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "meta_attr16" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "meta_attr17" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "meta_attr18" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "meta_attr19" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "meta_attr20" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "meta_attr21" "pg_catalog"."timestamp",
  "meta_attr22" "pg_catalog"."timestamp",
  "meta_attr23" "pg_catalog"."timestamp",
  "meta_attr24" "pg_catalog"."timestamp",
  "meta_attr25" "pg_catalog"."timestamp",
  "meta_attr26" "pg_catalog"."numeric",
  "meta_attr27" "pg_catalog"."numeric",
  "meta_attr28" "pg_catalog"."numeric",
  "meta_attr29" "pg_catalog"."numeric",
  "meta_attr30" "pg_catalog"."numeric",
  "creation_date" "pg_catalog"."timestamp",
  "last_update_date" "pg_catalog"."timestamp",
  "created_by" "pg_catalog"."int4",
  "last_updated_by" "pg_catalog"."int4",
  "tenant_id" "pg_catalog"."int8" NOT NULL,
  "submitter_id" "pg_catalog"."int4",
  "approver_id" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "meta_attr31" "pg_catalog"."timestamp",
  "meta_attr32" "pg_catalog"."timestamp",
  "meta_attr33" "pg_catalog"."timestamp",
  "meta_attr34" "pg_catalog"."timestamp",
  "meta_attr35" "pg_catalog"."timestamp",
  "meta_attr36" "pg_catalog"."numeric",
  "meta_attr37" "pg_catalog"."numeric",
  "meta_attr38" "pg_catalog"."numeric",
  "meta_attr39" "pg_catalog"."numeric",
  "meta_attr40" "pg_catalog"."numeric",
  "lock_version" "pg_catalog"."int2" NOT NULL DEFAULT 0
)
;
COMMENT ON COLUMN "themetis_scp"."scp_sop_planning_item"."workbench_code" IS '工作台代码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_sop_planning_item"."planning_period_type_code" IS '期次类型码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_sop_planning_item"."planning_period_code" IS '期次码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_sop_planning_item"."demand_unit_code" IS '需求计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_sop_planning_item"."supply_unit_code" IS '供应计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_sop_planning_item"."planning_item_code" IS '计划对象编码';
COMMENT ON COLUMN "themetis_scp"."scp_sop_planning_item"."planner_code" IS '计划员代码';
COMMENT ON COLUMN "themetis_scp"."scp_sop_planning_item"."status" IS '状态：Draft,In Approval Process,Published,Reject';
COMMENT ON COLUMN "themetis_scp"."scp_sop_planning_item"."product_hierarchy_code" IS '产品树编码';
COMMENT ON COLUMN "themetis_scp"."scp_sop_planning_item"."product_category_code" IS '产品编码';
COMMENT ON COLUMN "themetis_scp"."scp_sop_planning_item"."product_hierarchy_path" IS '产品树路径';
COMMENT ON COLUMN "themetis_scp"."scp_sop_planning_item"."customer_no" IS '客户代码';
COMMENT ON COLUMN "themetis_scp"."scp_sop_planning_item"."contract_no" IS '合同号';
COMMENT ON COLUMN "themetis_scp"."scp_sop_planning_item"."order_no" IS '订单号，针对订单拆分为需求计划场景';
COMMENT ON COLUMN "themetis_scp"."scp_sop_planning_item"."project_code" IS '项目编码';
COMMENT ON COLUMN "themetis_scp"."scp_sop_planning_item"."supplier_no" IS '供应商号';
COMMENT ON COLUMN "themetis_scp"."scp_sop_planning_item"."production_delivery_method" IS '生产交付模式：ETO,MTO,MTS';
COMMENT ON COLUMN "themetis_scp"."scp_sop_planning_item"."attribute_code" IS '属性码';
COMMENT ON COLUMN "themetis_scp"."scp_sop_planning_item"."aggregated_type" IS 'NONE;MATERIAL_GROUP;PRODUCT_CATEGORY;SUPPLY_UNIT';
COMMENT ON COLUMN "themetis_scp"."scp_sop_planning_item"."submitter_id" IS '提交人ID';
COMMENT ON COLUMN "themetis_scp"."scp_sop_planning_item"."approver_id" IS '审批人账号ID(当前审批人)';
COMMENT ON TABLE "themetis_scp"."scp_sop_planning_item" IS 'DP需求预测计划对象数据';

-- ----------------------------
-- Table structure for scp_sop_waterfall_bucket_data
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_sop_waterfall_bucket_data";
CREATE TABLE "themetis_scp"."scp_sop_waterfall_bucket_data" (
  "id" "pg_catalog"."int8" NOT NULL DEFAULT nextval('"themetis_scp".scp_sop_waterfall_bucket_data_id_seq'::regclass),
  "workbench_code" "pg_catalog"."varchar" COLLATE "pg_catalog"."default" NOT NULL,
  "planning_item_code" "pg_catalog"."varchar" COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_type_code" "pg_catalog"."varchar" COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_code" "pg_catalog"."varchar" COLLATE "pg_catalog"."default" NOT NULL,
  "demand_unit_code" "pg_catalog"."varchar" COLLATE "pg_catalog"."default" NOT NULL,
  "supply_unit_code" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "attribute_code" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "planner_code" "pg_catalog"."varchar" COLLATE "pg_catalog"."default" NOT NULL,
  "figure_code" "pg_catalog"."varchar" COLLATE "pg_catalog"."default" NOT NULL,
  "compare_planning_period_type_code" "pg_catalog"."varchar" COLLATE "pg_catalog"."default" NOT NULL,
  "compare_planning_period_code" "pg_catalog"."varchar" COLLATE "pg_catalog"."default" NOT NULL,
  "product_hierarchy_code" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "product_category_code" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "product_hierarchy_path" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "config_part_code" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "approval_instance_id" "pg_catalog"."int8",
  "source_workbench_code" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "source_figure_group_code" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "source_figure_code" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "source_period_type_code" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "source_period_code" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "aggregated_type" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "customer_no" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "contract_no" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "project_code" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "supplier_no" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "production_delivery_method" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "bk_qty_001" "pg_catalog"."numeric",
  "bk_qty_002" "pg_catalog"."numeric",
  "bk_qty_003" "pg_catalog"."numeric",
  "bk_qty_004" "pg_catalog"."numeric",
  "bk_qty_005" "pg_catalog"."numeric",
  "bk_qty_006" "pg_catalog"."numeric",
  "bk_qty_007" "pg_catalog"."numeric",
  "bk_qty_008" "pg_catalog"."numeric",
  "bk_qty_009" "pg_catalog"."numeric",
  "bk_qty_010" "pg_catalog"."numeric",
  "bk_qty_011" "pg_catalog"."numeric",
  "bk_qty_012" "pg_catalog"."numeric",
  "bk_qty_013" "pg_catalog"."numeric",
  "bk_qty_014" "pg_catalog"."numeric",
  "bk_qty_015" "pg_catalog"."numeric",
  "bk_qty_016" "pg_catalog"."numeric",
  "bk_qty_017" "pg_catalog"."numeric",
  "bk_qty_018" "pg_catalog"."numeric",
  "bk_qty_019" "pg_catalog"."numeric",
  "bk_qty_020" "pg_catalog"."numeric",
  "bk_qty_021" "pg_catalog"."numeric",
  "bk_qty_022" "pg_catalog"."numeric",
  "bk_qty_023" "pg_catalog"."numeric",
  "bk_qty_024" "pg_catalog"."numeric",
  "bk_qty_025" "pg_catalog"."numeric",
  "bk_qty_026" "pg_catalog"."numeric",
  "bk_qty_027" "pg_catalog"."numeric",
  "bk_qty_028" "pg_catalog"."numeric",
  "bk_qty_029" "pg_catalog"."numeric",
  "bk_qty_030" "pg_catalog"."numeric",
  "bk_qty_031" "pg_catalog"."numeric",
  "bk_qty_032" "pg_catalog"."numeric",
  "bk_qty_033" "pg_catalog"."numeric",
  "bk_qty_034" "pg_catalog"."numeric",
  "bk_qty_035" "pg_catalog"."numeric",
  "bk_qty_036" "pg_catalog"."numeric",
  "bk_qty_037" "pg_catalog"."numeric",
  "bk_qty_038" "pg_catalog"."numeric",
  "bk_qty_039" "pg_catalog"."numeric",
  "bk_qty_040" "pg_catalog"."numeric",
  "bk_qty_041" "pg_catalog"."numeric",
  "bk_qty_042" "pg_catalog"."numeric",
  "bk_qty_043" "pg_catalog"."numeric",
  "bk_qty_044" "pg_catalog"."numeric",
  "bk_qty_045" "pg_catalog"."numeric",
  "bk_qty_046" "pg_catalog"."numeric",
  "bk_qty_047" "pg_catalog"."numeric",
  "bk_qty_048" "pg_catalog"."numeric",
  "bk_qty_049" "pg_catalog"."numeric",
  "bk_qty_050" "pg_catalog"."numeric",
  "bk_qty_051" "pg_catalog"."numeric",
  "bk_qty_052" "pg_catalog"."numeric",
  "bk_qty_053" "pg_catalog"."numeric",
  "bk_qty_054" "pg_catalog"."numeric",
  "bk_qty_055" "pg_catalog"."numeric",
  "bk_qty_056" "pg_catalog"."numeric",
  "bk_qty_057" "pg_catalog"."numeric",
  "bk_qty_058" "pg_catalog"."numeric",
  "bk_qty_059" "pg_catalog"."numeric",
  "bk_qty_060" "pg_catalog"."numeric",
  "bk_qty_061" "pg_catalog"."numeric",
  "bk_qty_062" "pg_catalog"."numeric",
  "bk_qty_063" "pg_catalog"."numeric",
  "bk_qty_064" "pg_catalog"."numeric",
  "bk_qty_065" "pg_catalog"."numeric",
  "bk_qty_066" "pg_catalog"."numeric",
  "bk_qty_067" "pg_catalog"."numeric",
  "bk_qty_068" "pg_catalog"."numeric",
  "bk_qty_069" "pg_catalog"."numeric",
  "bk_qty_070" "pg_catalog"."numeric",
  "bk_qty_071" "pg_catalog"."numeric",
  "bk_qty_072" "pg_catalog"."numeric",
  "bk_qty_073" "pg_catalog"."numeric",
  "bk_qty_074" "pg_catalog"."numeric",
  "bk_qty_075" "pg_catalog"."numeric",
  "bk_qty_076" "pg_catalog"."numeric",
  "bk_qty_077" "pg_catalog"."numeric",
  "bk_qty_078" "pg_catalog"."numeric",
  "bk_qty_079" "pg_catalog"."numeric",
  "bk_qty_080" "pg_catalog"."numeric",
  "bk_qty_081" "pg_catalog"."numeric",
  "bk_qty_082" "pg_catalog"."numeric",
  "bk_qty_083" "pg_catalog"."numeric",
  "bk_qty_084" "pg_catalog"."numeric",
  "bk_qty_085" "pg_catalog"."numeric",
  "bk_qty_086" "pg_catalog"."numeric",
  "bk_qty_087" "pg_catalog"."numeric",
  "bk_qty_088" "pg_catalog"."numeric",
  "bk_qty_089" "pg_catalog"."numeric",
  "bk_qty_090" "pg_catalog"."numeric",
  "bk_qty_091" "pg_catalog"."numeric",
  "bk_qty_092" "pg_catalog"."numeric",
  "bk_qty_093" "pg_catalog"."numeric",
  "bk_qty_094" "pg_catalog"."numeric",
  "bk_qty_095" "pg_catalog"."numeric",
  "bk_qty_096" "pg_catalog"."numeric",
  "bk_qty_097" "pg_catalog"."numeric",
  "bk_qty_098" "pg_catalog"."numeric",
  "bk_qty_099" "pg_catalog"."numeric",
  "bk_qty_100" "pg_catalog"."numeric",
  "bk_qty_101" "pg_catalog"."numeric",
  "bk_qty_102" "pg_catalog"."numeric",
  "bk_qty_103" "pg_catalog"."numeric",
  "bk_qty_104" "pg_catalog"."numeric",
  "sum_qty_01" "pg_catalog"."numeric",
  "sum_qty_02" "pg_catalog"."numeric",
  "sum_qty_03" "pg_catalog"."numeric",
  "sum_qty_04" "pg_catalog"."numeric",
  "sum_qty_05" "pg_catalog"."numeric",
  "sum_qty_06" "pg_catalog"."numeric",
  "sum_qty_07" "pg_catalog"."numeric",
  "sum_qty_08" "pg_catalog"."numeric",
  "sum_qty_09" "pg_catalog"."numeric",
  "sum_qty_10" "pg_catalog"."numeric",
  "sum_qty_11" "pg_catalog"."numeric",
  "sum_qty_12" "pg_catalog"."numeric",
  "sum_qty_13" "pg_catalog"."numeric",
  "sum_qty_14" "pg_catalog"."numeric",
  "sum_qty_15" "pg_catalog"."numeric",
  "sum_qty_16" "pg_catalog"."numeric",
  "sum_qty_17" "pg_catalog"."numeric",
  "sum_qty_18" "pg_catalog"."numeric",
  "sum_qty_19" "pg_catalog"."numeric",
  "sum_qty_20" "pg_catalog"."numeric",
  "creation_date" "pg_catalog"."timestamp",
  "last_update_date" "pg_catalog"."timestamp",
  "created_by" "pg_catalog"."int4",
  "last_updated_by" "pg_catalog"."int4",
  "tenant_id" "pg_catalog"."int8" NOT NULL DEFAULT '-1'::integer,
  "supply_center_code" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "head_id" "pg_catalog"."int8",
  "lock_version" "pg_catalog"."int2" NOT NULL DEFAULT 0
)
;
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."workbench_code" IS '工作台代码';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."planning_item_code" IS '计划对象编码';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."planning_period_type_code" IS '期次类型码';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."planning_period_code" IS '期次码';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."demand_unit_code" IS '需求计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."supply_unit_code" IS '供应计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."attribute_code" IS '属性码';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."planner_code" IS '计划员代码';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."figure_code" IS '数据维度码';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."product_hierarchy_code" IS '产品树编码';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."product_category_code" IS '产品编码';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."product_hierarchy_path" IS '产品树路径';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."config_part_code" IS '配置项编码';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."approval_instance_id" IS '审批实例ID,editable_flag=TRUE的figure_code才需要审批流实例';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."source_workbench_code" IS '来源工作台代码';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."source_figure_group_code" IS '来源维度组';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."source_figure_code" IS '来源数据维度码';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."source_period_type_code" IS '来源期次类型码';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."source_period_code" IS '来源期次码';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."aggregated_type" IS 'NONE;MATERIAL_GROUP;PRODUCT_CATEGORY;SUPPLY_UNIT';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."customer_no" IS '客户代码';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."contract_no" IS '合同号';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."project_code" IS '项目编码';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."supplier_no" IS '供应商号';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."production_delivery_method" IS '生产交付模式：ETO,MTO,MTS';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_001" IS 'bucket数量1';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_002" IS 'bucket数量2';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_003" IS 'bucket数量3';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_004" IS 'bucket数量4';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_005" IS 'bucket数量5';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_006" IS 'bucket数量6';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_007" IS 'bucket数量7';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_008" IS 'bucket数量8';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_009" IS 'bucket数量9';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_010" IS 'bucket数量10';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_011" IS 'bucket数量11';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_012" IS 'bucket数量12';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_013" IS 'bucket数量13';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_014" IS 'bucket数量14';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_015" IS 'bucket数量15';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_016" IS 'bucket数量16';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_017" IS 'bucket数量17';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_018" IS 'bucket数量18';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_019" IS 'bucket数量19';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_020" IS 'bucket数量20';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_021" IS 'bucket数量21';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_022" IS 'bucket数量22';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_023" IS 'bucket数量23';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_024" IS 'bucket数量24';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_025" IS 'bucket数量25';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_026" IS 'bucket数量26';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_027" IS 'bucket数量27';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_028" IS 'bucket数量28';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_029" IS 'bucket数量29';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_030" IS 'bucket数量30';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_031" IS 'bucket数量31';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_032" IS 'bucket数量32';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_033" IS 'bucket数量33';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_034" IS 'bucket数量34';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_035" IS 'bucket数量35';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_036" IS 'bucket数量36';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_037" IS 'bucket数量37';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_038" IS 'bucket数量38';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_039" IS 'bucket数量39';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_040" IS 'bucket数量40';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_041" IS 'bucket数量41';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_042" IS 'bucket数量42';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_043" IS 'bucket数量43';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_044" IS 'bucket数量44';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_045" IS 'bucket数量45';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_046" IS 'bucket数量46';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_047" IS 'bucket数量47';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_048" IS 'bucket数量48';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_049" IS 'bucket数量49';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_050" IS 'bucket数量50';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_051" IS 'bucket数量51';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_052" IS 'bucket数量52';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_053" IS 'bucket数量53';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_054" IS 'bucket数量54';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_055" IS 'bucket数量55';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_056" IS 'bucket数量56';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_057" IS 'bucket数量57';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_058" IS 'bucket数量58';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_059" IS 'bucket数量59';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_060" IS 'bucket数量60';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_061" IS 'bucket数量61';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_062" IS 'bucket数量62';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_063" IS 'bucket数量63';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_064" IS 'bucket数量64';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_065" IS 'bucket数量65';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_066" IS 'bucket数量66';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_067" IS 'bucket数量67';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_068" IS 'bucket数量68';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_069" IS 'bucket数量69';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_070" IS 'bucket数量70';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_071" IS 'bucket数量71';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_072" IS 'bucket数量72';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_073" IS 'bucket数量73';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_074" IS 'bucket数量74';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_075" IS 'bucket数量75';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_076" IS 'bucket数量76';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_077" IS 'bucket数量77';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_078" IS 'bucket数量78';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_079" IS 'bucket数量79';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_080" IS 'bucket数量80';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_081" IS 'bucket数量81';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_082" IS 'bucket数量82';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_083" IS 'bucket数量83';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_084" IS 'bucket数量84';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_085" IS 'bucket数量85';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_086" IS 'bucket数量86';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_087" IS 'bucket数量87';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_088" IS 'bucket数量88';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_089" IS 'bucket数量89';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_090" IS 'bucket数量90';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_091" IS 'bucket数量91';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_092" IS 'bucket数量92';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_093" IS 'bucket数量93';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_094" IS 'bucket数量94';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_095" IS 'bucket数量95';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_096" IS 'bucket数量96';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_097" IS 'bucket数量97';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_098" IS 'bucket数量98';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_099" IS 'bucket数量99';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_100" IS 'bucket数量100';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_101" IS 'bucket数量101';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_102" IS 'bucket数量102';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_103" IS 'bucket数量103';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_104" IS 'bucket数量104';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."sum_qty_01" IS '汇总数量1';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."sum_qty_02" IS '汇总数量2';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."sum_qty_03" IS '汇总数量3';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."sum_qty_04" IS '汇总数量4';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."sum_qty_05" IS '汇总数量5';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."sum_qty_06" IS '汇总数量6';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."sum_qty_07" IS '汇总数量7';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."sum_qty_08" IS '汇总数量8';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."sum_qty_09" IS '汇总数量9';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."sum_qty_10" IS '汇总数量10';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."sum_qty_11" IS '汇总数量11';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."sum_qty_12" IS '汇总数量12';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."sum_qty_13" IS '汇总数量13';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."sum_qty_14" IS '汇总数量14';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."sum_qty_15" IS '汇总数量15';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."sum_qty_16" IS '汇总数量16';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."sum_qty_17" IS '汇总数量17';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."sum_qty_18" IS '汇总数量18';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."sum_qty_19" IS '汇总数量19';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."sum_qty_20" IS '汇总数量20';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."tenant_id" IS '租户ID';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."supply_center_code" IS '供应中心';
COMMENT ON TABLE "themetis_scp"."scp_sop_waterfall_bucket_data" IS 'DP需求预测bucket数据';

-- ----------------------------
-- Indexes structure for table scp_simulation_scenario
-- ----------------------------
CREATE UNIQUE INDEX "scp_simulation_scenario_idx" ON "themetis_scp"."scp_simulation_scenario" USING btree (
  "sim_scenario_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table scp_simulation_scenario
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_simulation_scenario" ADD CONSTRAINT "scp_simulation_scenario_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table scp_sop_bucket_data
-- ----------------------------
CREATE INDEX "scp_sop_bucket_data_idx01" ON "themetis_scp"."scp_sop_bucket_data" USING btree (
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "head_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE INDEX "scp_sop_bucket_data_idx1" ON "themetis_scp"."scp_sop_bucket_data" USING btree (
  "planning_item_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_sop_bucket_data_idx2" ON "themetis_scp"."scp_sop_bucket_data" USING btree (
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_sop_bucket_data_uidx" ON "themetis_scp"."scp_sop_bucket_data" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "demand_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_center_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_item_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "attribute_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "customer_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "contract_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "project_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supplier_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "production_delivery_method" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_sop_bucket_data_uidx_n" ON "themetis_scp"."scp_sop_bucket_data" USING btree (
  COALESCE(attribute_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(contract_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(customer_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(planning_item_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(product_category_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(product_hierarchy_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(production_delivery_method, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(project_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(supplier_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(supply_unit_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_center_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "demand_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table scp_sop_bucket_data
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_sop_bucket_data" ADD CONSTRAINT "scp_sop_bucket_data_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table scp_sop_planning_item
-- ----------------------------
CREATE INDEX "scp_sop_planning_item_idx1" ON "themetis_scp"."scp_sop_planning_item" USING btree (
  "planner_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_sop_planning_item_idx2" ON "themetis_scp"."scp_sop_planning_item" USING btree (
  "planning_item_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_sop_planning_item_idx3" ON "themetis_scp"."scp_sop_planning_item" USING btree (
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_sop_planning_item_uidx" ON "themetis_scp"."scp_sop_planning_item" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "demand_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_center_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_item_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "attribute_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "customer_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "contract_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supplier_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supplier_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "production_delivery_method" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "project_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_sop_planning_item_uidx_n" ON "themetis_scp"."scp_sop_planning_item" USING btree (
  COALESCE(attribute_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(contract_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(project_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(customer_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(planning_item_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(product_category_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(product_hierarchy_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(production_delivery_method, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(supplier_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(supply_unit_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_center_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "demand_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table scp_sop_planning_item
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_sop_planning_item" ADD CONSTRAINT "scp_sop_planning_item_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table scp_sop_waterfall_bucket_data
-- ----------------------------
CREATE INDEX "scp_sop_waterfall_bucket_data_idx01" ON "themetis_scp"."scp_sop_waterfall_bucket_data" USING btree (
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "head_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE INDEX "scp_sop_waterfall_bucket_data_idx1" ON "themetis_scp"."scp_sop_waterfall_bucket_data" USING btree (
  "planning_item_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_sop_waterfall_bucket_data_idx2" ON "themetis_scp"."scp_sop_waterfall_bucket_data" USING btree (
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_sop_waterfall_bucket_data_uidx" ON "themetis_scp"."scp_sop_waterfall_bucket_data" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "demand_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_item_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "attribute_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "customer_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "contract_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "project_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supplier_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "production_delivery_method" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_center_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "aggregated_type" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_sop_waterfall_bucket_data_uidx_n" ON "themetis_scp"."scp_sop_waterfall_bucket_data" USING btree (
  COALESCE(attribute_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(contract_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(customer_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(planning_item_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(product_category_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(product_hierarchy_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(production_delivery_method, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(project_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(supplier_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(supply_unit_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "demand_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "aggregated_type" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_center_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table scp_sop_waterfall_bucket_data
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_sop_waterfall_bucket_data" ADD CONSTRAINT "scp_sop_waterfall_bucket_data_pkey" PRIMARY KEY ("id");
