CREATE TABLE IF NOT EXISTS "configure_trace_template" (
    "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY,
    "template_id" varchar,
    "template_name" varchar,
    "goods_id" varchar,
    "goods_name" varchar,
    "belong_business_id" bigint NOT NULL,
    "belong_business_name" varchar NOT NULL,
    "tenant_id" bigint NOT NULL,
    "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    "creator" varchar DEFAULT '',
    "updater" varchar DEFAULT '',
    PRIMARY KEY ("id")
) COMMENT '溯源模板';
CREATE TABLE IF NOT EXISTS "configure_trace_link" (
    "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY,
    "trace_template_id" varchar,
    "trace_template_name" varchar,
    "link_id" varchar,
    "link_name" varchar,
    "link_type" int,
    "belong_business_id" bigint NOT NULL,
    "belong_business_name" varchar NOT NULL,
    "tenant_id" bigint NOT NULL,
    "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    "deleted" bit NOT NULL DEFAULT FALSE,
    "creator" varchar DEFAULT '',
    "updater" varchar DEFAULT '',
    PRIMARY KEY ("id")
) COMMENT '溯源模板-环节';
CREATE TABLE IF NOT EXISTS "configure_trace_link_item" (
    "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY,
    "title" varchar,
    "type" int,
    "content" varchar,
    "add_time" datetime,
    "link_name" varchar,
    "link_id" varchar,
    "belong_business_id" bigint NOT NULL,
    "belong_business_name" varchar NOT NULL,
    "tenant_id" bigint NOT NULL,
    "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    "creator" varchar DEFAULT '',
    "updater" varchar DEFAULT '',
    PRIMARY KEY ("id")
) COMMENT '溯源模板环节item';
CREATE TABLE IF NOT EXISTS "configure_inspection_template" (
    "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY,
    "template_name" varchar NOT NULL,
    "template_id" varchar NOT NULL,
    "belong_business_id" bigint NOT NULL,
    "belong_business_name" varchar NOT NULL,
    "tenant_id" bigint NOT NULL,
    "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    "deleted" bit NOT NULL DEFAULT FALSE,
    "creator" varchar DEFAULT '',
    "updater" varchar DEFAULT '',
    PRIMARY KEY ("id")
) COMMENT '检测报告模板';
CREATE TABLE IF NOT EXISTS "configure_inspection_item" (
    "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY,
    "template_id" varchar NOT NULL,
    "template_name" varchar NOT NULL,
    "inspection_item" varchar NOT NULL,
    "inspection_item_id" varchar NOT NULL,
    "inspection_unit" varchar NOT NULL,
    "inspection_require" varchar NOT NULL,
    "belong_business_id" bigint NOT NULL,
    "belong_business_name" varchar NOT NULL,
    "tenant_id" bigint NOT NULL,
    "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    "deleted" bit NOT NULL DEFAULT FALSE,
    "creator" varchar DEFAULT '',
    "updater" varchar DEFAULT '',
    PRIMARY KEY ("id")
) COMMENT '检测报告模板检测项目';
CREATE TABLE IF NOT EXISTS "configure_device_env_type" (
    "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY,
    "land_id" varchar NOT NULL,
    "env_type_id" bigint NOT NULL,
    "tenant_id" bigint NOT NULL,
    "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    "deleted" bit NOT NULL DEFAULT FALSE,
    "creator" varchar DEFAULT '',
    "updater" varchar DEFAULT '',
    PRIMARY KEY ("id")
) COMMENT '小程序设备环境类型配置';
