-- 将该建表 SQL 语句,添加到 yudao-module-ecw-impl 模块的 test/resources/sql/create_tables.sql 文件里
CREATE TABLE IF NOT EXISTS "ecw_currency" (
    "id" int NOT NULL GENERATED BY DEFAULT AS IDENTITY,
    "title_zh" varchar(100),
    "title_en" varchar(100),
    "fuhao" varchar(255),
    "show" tinyint,
    "huilv" float(11,9),
    "aorder" int,
    "create_at" datetime,
    "update_at" datetime,
    PRIMARY KEY ("id")
) COMMENT '货币单位管理';

-- 将该删表 SQL 语句,添加到 yudao-module-ecw-impl 模块的 test/resources/sql/clean.sql 文件里
DELETE FROM "ecw_currency";

-- 计量单位
-- 将该建表 SQL 语句,添加到 yudao-module-ecw-impl 模块的 test/resources/sql/create_tables.sql 文件里
CREATE TABLE IF NOT EXISTS "ecw_unit" (
                                          "id" int NOT NULL GENERATED BY DEFAULT AS IDENTITY,
                                          "title_zh" varchar(100),
    "title_en" varchar(100),
    "fuhao" varchar(255),
    "status" tinyint(1),
    "aorder" int,
    "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    "creator" varchar(255) DEFAULT '',
    "updater" varchar(255) DEFAULT '',
    "deleted" bit NOT NULL DEFAULT FALSE,
    PRIMARY KEY ("id")
    ) COMMENT '计量单位表';

-- 将该删表 SQL 语句,添加到 yudao-module-ecw-impl 模块的 test/resources/sql/clean.sql 文件里
DELETE FROM "ecw_unit";


-- 将该建表 SQL 语句,添加到 yudao-module-ecw-impl 模块的 test/resources/sql/create_tables.sql 文件里
CREATE TABLE IF NOT EXISTS "ecw_unit" (
                                          "id" int NOT NULL GENERATED BY DEFAULT AS IDENTITY,
                                          "title_zh" varchar(100),
    "title_en" varchar(100),
    "fuhao" varchar(255),
    "status" tinyint(1),
    "aorder" int,
    "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    "creator" varchar(255) DEFAULT '',
    "updater" varchar(255) DEFAULT '',
    "deleted" bit NOT NULL DEFAULT FALSE,
    PRIMARY KEY ("id")
    ) COMMENT '计量单位表';

-- 将该删表 SQL 语句,添加到 yudao-module-ecw-impl 模块的 test/resources/sql/clean.sql 文件里
DELETE FROM "ecw_unit";


-- 将该建表 SQL 语句,添加到 yudao-module-ecw-impl 模块的 test/resources/sql/create_tables.sql 文件里
CREATE TABLE IF NOT EXISTS "ecw_bank_account" (
                                                  "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY,
                                                  "ba_account_name" varchar(100) NOT NULL,
    "ba_bank_name" varchar(100) NOT NULL,
    "ba_account_num" varchar(100) NOT NULL,
    "ba_swift_code" varchar(30) NOT NULL,
    "ba_bank_add" varchar(30) NOT NULL,
    "ba_type" tinyint NOT NULL,
    "source" varchar(30) NOT NULL,
    "status" tinyint NOT NULL,
    "creator" varchar(64) DEFAULT '',
    "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "updater" varchar(64) DEFAULT '',
    "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    "deleted" bit NOT NULL DEFAULT FALSE,
    PRIMARY KEY ("id")
    ) COMMENT '银行账户表';

-- 将该删表 SQL 语句,添加到 yudao-module-ecw-impl 模块的 test/resources/sql/clean.sql 文件里
DELETE FROM "ecw_bank_account";


-- 将该建表 SQL 语句,添加到 yudao-module-ecw-impl 模块的 test/resources/sql/create_tables.sql 文件里
CREATE TABLE IF NOT EXISTS "ecw_region" (
                                            "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY,
                                            "title_zh" varchar(255) NOT NULL,
    "title_en" varchar(255) NOT NULL,
    "short_name" varchar(100) NOT NULL,
    "language" varchar(100) NOT NULL,
    "type" char(50) NOT NULL,
    "parent_id" bigint NOT NULL,
    "sort" int NOT NULL,
    "status" tinyint NOT NULL,
    "creator" varchar(64) DEFAULT '',
    "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "updater" varchar(64) DEFAULT '',
    "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    "deleted" bit NOT NULL DEFAULT FALSE,
    PRIMARY KEY ("id")
    ) COMMENT '区域设置表';

-- 将该删表 SQL 语句,添加到 yudao-module-ecw-impl 模块的 test/resources/sql/clean.sql 文件里
DELETE FROM "ecw_region";



-- 将该建表 SQL 语句,添加到 yudao-module-ecw-impl 模块的 test/resources/sql/create_tables.sql 文件里
CREATE TABLE IF NOT EXISTS "ecw_zhong_pao" (
                                               "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY,
                                               "pao_linjie" varchar(127),
                                               "pao_gs" varchar(127),
                                               "pao_ys_ids" varchar(255),
                                               "pao_is_open" tinyint(1) NOT NULL,
                                               "zhong_linjie" varchar(127),
                                               "zhong_gs" varchar(127),
                                               "zhong_ys_ids" varchar(255),
                                               "zhong_is_open" tinyint(1) NOT NULL,
                                               "creator" varchar(63) DEFAULT '',
                                               "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
                                               "updater" varchar(63) DEFAULT '',
                                               "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
                                               "deleted" bit NOT NULL DEFAULT FALSE,
                                               PRIMARY KEY ("id")
) COMMENT '重泡货配置';

-- 将该删表 SQL 语句,添加到 yudao-module-ecw-impl 模块的 test/resources/sql/clean.sql 文件里
DELETE FROM "ecw_zhong_pao";


-- 将该建表 SQL 语句,添加到 yudao-module-ecw-impl 模块的 test/resources/sql/create_tables.sql 文件里
CREATE TABLE IF NOT EXISTS "ecw_order_code" (
                                                "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY,
                                                "title" varchar(127) NOT NULL,
                                                "start_code" bigint NOT NULL,
                                                "end_code" bigint,
                                                "creator" varchar(63) DEFAULT '',
                                                "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
                                                "updater" varchar(63) DEFAULT '',
                                                "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
                                                "deleted" bit NOT NULL DEFAULT FALSE,
                                                PRIMARY KEY ("id")
) COMMENT '单号配置';

-- 将该删表 SQL 语句,添加到 yudao-module-ecw-impl 模块的 test/resources/sql/clean.sql 文件里
DELETE FROM "ecw_order_code";





-- 将该建表 SQL 语句,添加到 yudao-module-ecw-impl 模块的 test/resources/sql/create_tables.sql 文件里
CREATE TABLE IF NOT EXISTS "ecw_cabinet" (
                                             "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY,
                                             "name" varchar(127) NOT NULL,
                                             "volume" decimal(10,2),
                                             "weight" decimal(10,2),
                                             "status" tinyint NOT NULL,
                                             "sort" int NOT NULL,
                                             "creator" varchar(63) DEFAULT '',
                                             "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
                                             "updater" varchar(63) DEFAULT '',
                                             "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
                                             "deleted" bit NOT NULL DEFAULT FALSE,
                                             PRIMARY KEY ("id")
) COMMENT '柜型配置';

-- 将该删表 SQL 语句,添加到 yudao-module-ecw-impl 模块的 test/resources/sql/clean.sql 文件里
DELETE FROM "ecw_cabinet";



-- 将该建表 SQL 语句,添加到 yudao-module-ecw-impl 模块的 test/resources/sql/create_tables.sql 文件里
CREATE TABLE IF NOT EXISTS "ecw_currency_ecash" (
                                                    "id" int NOT NULL GENERATED BY DEFAULT AS IDENTITY,
                                                    "title_zh" varchar(100),
    "title_en" varchar(100),
    "fuhao" varchar(255),
    "status" tinyint(1),
    "huilv" float(13,4),
    "aorder" int,
    "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    "creator" varchar(255) DEFAULT '',
    "updater" varchar(255) DEFAULT '',
    "deleted" bit NOT NULL DEFAULT FALSE,
    PRIMARY KEY ("id")
    ) COMMENT 'E-Cash汇率单位表';

-- 将该删表 SQL 语句,添加到 yudao-module-ecw-impl 模块的 test/resources/sql/clean.sql 文件里
DELETE FROM "ecw_currency_ecash";

-- 将该建表 SQL 语句,添加到 yudao-module-ecw-impl 模块的 test/resources/sql/create_tables.sql 文件里
CREATE TABLE IF NOT EXISTS "ecw_busi_pwd" (
                                              "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY,
                                              "busi_type" varchar(5),
    "pwd" varchar(64),
    "creator" varchar(32) DEFAULT '',
    "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "updater" varchar(32) DEFAULT '',
    "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    "deleted" bit NOT NULL DEFAULT FALSE,
    PRIMARY KEY ("id")
    ) COMMENT '业务密码表,存储一些业务中使用的密码';

DELETE FROM "ecw_busi_pwd";

-- 将该建表 SQL 语句,添加到 yudao-module-ecw-impl 模块的 test/resources/sql/create_tables.sql 文件里
CREATE TABLE IF NOT EXISTS "ecw_product_brank" (
                                                   "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY,
                                                   "title_zh" varchar(255),
    "title_en" varchar(255),
    "aorder" int,
    "filing" char(20),
    "creator" varchar(32) DEFAULT '',
    "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "updater" varchar(32) DEFAULT '',
    "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    "deleted" bit NOT NULL DEFAULT FALSE,
    PRIMARY KEY ("id")
    ) COMMENT '品牌表';

-- 将该删表 SQL 语句,添加到 yudao-module-ecw-impl 模块的 test/resources/sql/clean.sql 文件里
DELETE FROM "ecw_product_brank";

-- 将该建表 SQL 语句,添加到 yudao-module-ecw-impl 模块的 test/resources/sql/create_tables.sql 文件里
CREATE TABLE IF NOT EXISTS "ecw_product_brand_empower" (
                                                           "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY,
                                                           "product_brand_id" bigint NOT NULL,
                                                           "customer_id" bigint NOT NULL,
                                                           "customer_contacts_id" bigint NOT NULL,
                                                           "start_time" datetime,
                                                           "end_time" datetime,
                                                           "file_url" varchar(255) NOT NULL,
    "fee_scale" tinyint NOT NULL,
    "status" tinyint NOT NULL,
    "create_user_id" bigint NOT NULL,
    "create_username" varchar(255) NOT NULL,
    "creator" varchar(32) DEFAULT '',
    "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "updater" varchar(32) DEFAULT '',
    "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    "deleted" bit NOT NULL DEFAULT FALSE,
    PRIMARY KEY ("id")
    ) COMMENT '商品品牌授权表';

-- 将该删表 SQL 语句,添加到 yudao-module-ecw-impl 模块的 test/resources/sql/clean.sql 文件里
DELETE FROM "ecw_product_brand_empower";