CREATE TABLE "lqbz"."T_CALCULATION_MODEL" (
                                              "CALCULATION_MODEL_ID" VARCHAR(32) NOT NULL,
                                              "FORMULA_NAME" VARCHAR(255) NULL,
                                              "FORMULA_SHOW" VARCHAR(255) NULL,
                                              "FORMULA_USE" VARCHAR(255) NULL,
                                              "VERSION_NUMBER" VARCHAR(50) NULL,
                                              "STATUS" TINYINT DEFAULT 1 NULL,
                                              "CREATE_BY" VARCHAR(50) NULL,
                                              "CREATE_TIME" TIMESTAMP(0) NOT NULL,
                                              "UPDATE_BY" VARCHAR(50) NULL,
                                              "UPDATE_TIME" TIMESTAMP(0) NULL,
                                              "IS_EDIT" VARCHAR(50) DEFAULT 1 NULL
);

CREATE TABLE "lqbz"."T_CALCULATION_MODEL_DICT" (
                                                   "DICT_CODE" BIGINT IDENTITY (20, 1) NOT NULL,
                                                   "DICT_SORT" INT DEFAULT 0 NULL,
                                                   "DICT_LABEL" VARCHAR(100) DEFAULT '' NULL,
                                                   "DICT_VALUE" VARCHAR(100) DEFAULT '' NULL,
                                                   "DICT_TYPE" VARCHAR(100) DEFAULT '' NULL,
                                                   "CSS_CLASS" VARCHAR(100) NULL,
                                                   "LIST_CLASS" VARCHAR(100) NULL,
                                                   "IS_DEFAULT" CHAR(1) DEFAULT 'N' NULL,
                                                   "STATUS" CHAR(1) DEFAULT '0' NULL,
                                                   "CREATE_BY" VARCHAR(64) DEFAULT '' NULL,
                                                   "CREATE_TIME" TIMESTAMP(0) NULL,
                                                   "UPDATE_BY" VARCHAR(64) DEFAULT '' NULL,
                                                   "UPDATE_TIME" TIMESTAMP(0) NULL,
                                                   "REMARK" VARCHAR(500) NULL
);

CREATE TABLE "lqbz"."T_CALCULATION_MODEL_VERSION" (
                                                      "CALCULATION_MODEL_VERSION_ID" VARCHAR(32) NOT NULL,
                                                      "CALCULATION_MODEL_ID" VARCHAR(32) NOT NULL,
                                                      "FORMULA_NAME" VARCHAR(255) NULL,
                                                      "FORMULA_SHOW" VARCHAR(255) NULL,
                                                      "FORMULA_USE" VARCHAR(255) NULL,
                                                      "VERSION_NUMBER" VARCHAR(50) NULL,
                                                      "STATUS" TINYINT DEFAULT 1 NULL,
                                                      "CREATE_BY" VARCHAR(50) NULL,
                                                      "CREATE_TIME" TIMESTAMP(0) NOT NULL,
                                                      "UPDATE_BY" VARCHAR(50) NULL,
                                                      "UPDATE_TIME" TIMESTAMP(0) NULL,
                                                      "IS_EDIT" VARCHAR(10) DEFAULT 1 NULL
);

SET
IDENTITY_INSERT "lqbz"."T_CALCULATION_MODEL_DICT" ON;

SET
IDENTITY_INSERT "lqbz"."T_CALCULATION_MODEL_DICT" OFF;

ALTER TABLE "lqbz"."T_CALCULATION_MODEL"
    ADD CONSTRAINT PRIMARY KEY ("CALCULATION_MODEL_ID");

ALTER TABLE "lqbz"."T_CALCULATION_MODEL_DICT"
    ADD CONSTRAINT PRIMARY KEY ("DICT_CODE");

ALTER TABLE "lqbz"."T_CALCULATION_MODEL_VERSION"
    ADD CONSTRAINT PRIMARY KEY ("CALCULATION_MODEL_VERSION_ID");

COMMENT ON TABLE "lqbz"."T_CALCULATION_MODEL" IS '携行计算模型';

COMMENT ON COLUMN "lqbz"."T_CALCULATION_MODEL"."CALCULATION_MODEL_ID" IS '计算模型id';

COMMENT ON COLUMN "lqbz"."T_CALCULATION_MODEL"."FORMULA_NAME" IS '公式名称';

COMMENT ON COLUMN "lqbz"."T_CALCULATION_MODEL"."FORMULA_SHOW" IS '公式（展示用）';

COMMENT ON COLUMN "lqbz"."T_CALCULATION_MODEL"."FORMULA_USE" IS '公式（实际使用）';

COMMENT ON COLUMN "lqbz"."T_CALCULATION_MODEL"."VERSION_NUMBER" IS '版本号';

COMMENT ON COLUMN "lqbz"."T_CALCULATION_MODEL"."STATUS" IS '状态 (0禁用 1启用)';

COMMENT ON COLUMN "lqbz"."T_CALCULATION_MODEL"."CREATE_BY" IS '创建者';

COMMENT ON COLUMN "lqbz"."T_CALCULATION_MODEL"."CREATE_TIME" IS '创建时间';

COMMENT ON COLUMN "lqbz"."T_CALCULATION_MODEL"."UPDATE_BY" IS '更新者';

COMMENT ON COLUMN "lqbz"."T_CALCULATION_MODEL"."UPDATE_TIME" IS '更新时间';

COMMENT ON COLUMN "lqbz"."T_CALCULATION_MODEL"."IS_EDIT" IS '是否允许修改';

COMMENT ON TABLE "lqbz"."T_CALCULATION_MODEL_DICT" IS '计算模型字典';

COMMENT ON COLUMN "lqbz"."T_CALCULATION_MODEL_DICT"."DICT_CODE" IS '字典编码';

COMMENT ON COLUMN "lqbz"."T_CALCULATION_MODEL_DICT"."DICT_SORT" IS '字典排序';

COMMENT ON COLUMN "lqbz"."T_CALCULATION_MODEL_DICT"."DICT_LABEL" IS '字典标签';

COMMENT ON COLUMN "lqbz"."T_CALCULATION_MODEL_DICT"."DICT_VALUE" IS '字典键值';

COMMENT ON COLUMN "lqbz"."T_CALCULATION_MODEL_DICT"."DICT_TYPE" IS '字典类型';

COMMENT ON COLUMN "lqbz"."T_CALCULATION_MODEL_DICT"."CSS_CLASS" IS '样式属性（其他样式扩展）';

COMMENT ON COLUMN "lqbz"."T_CALCULATION_MODEL_DICT"."LIST_CLASS" IS '表格回显样式';

COMMENT ON COLUMN "lqbz"."T_CALCULATION_MODEL_DICT"."IS_DEFAULT" IS '是否默认（Y是 N否）';

COMMENT ON COLUMN "lqbz"."T_CALCULATION_MODEL_DICT"."STATUS" IS '状态（0正常 1停用）';

COMMENT ON COLUMN "lqbz"."T_CALCULATION_MODEL_DICT"."CREATE_BY" IS '创建者';

COMMENT ON COLUMN "lqbz"."T_CALCULATION_MODEL_DICT"."CREATE_TIME" IS '创建时间';

COMMENT ON COLUMN "lqbz"."T_CALCULATION_MODEL_DICT"."UPDATE_BY" IS '更新者';

COMMENT ON COLUMN "lqbz"."T_CALCULATION_MODEL_DICT"."UPDATE_TIME" IS '更新时间';

COMMENT ON COLUMN "lqbz"."T_CALCULATION_MODEL_DICT"."REMARK" IS '备注';

COMMENT ON TABLE "lqbz"."T_CALCULATION_MODEL_VERSION" IS '携行计算模型版本';

COMMENT ON COLUMN "lqbz"."T_CALCULATION_MODEL_VERSION"."CALCULATION_MODEL_VERSION_ID" IS '计算模型版本id';

COMMENT ON COLUMN "lqbz"."T_CALCULATION_MODEL_VERSION"."CALCULATION_MODEL_ID" IS '计算模型id';

COMMENT ON COLUMN "lqbz"."T_CALCULATION_MODEL_VERSION"."FORMULA_NAME" IS '公式名称';

COMMENT ON COLUMN "lqbz"."T_CALCULATION_MODEL_VERSION"."FORMULA_SHOW" IS '公式（展示用）';

COMMENT ON COLUMN "lqbz"."T_CALCULATION_MODEL_VERSION"."FORMULA_USE" IS '公式（实际使用）';

COMMENT ON COLUMN "lqbz"."T_CALCULATION_MODEL_VERSION"."VERSION_NUMBER" IS '版本号';

COMMENT ON COLUMN "lqbz"."T_CALCULATION_MODEL_VERSION"."STATUS" IS '状态 (0禁用 1启用)';

COMMENT ON COLUMN "lqbz"."T_CALCULATION_MODEL_VERSION"."CREATE_BY" IS '创建者';

COMMENT ON COLUMN "lqbz"."T_CALCULATION_MODEL_VERSION"."CREATE_TIME" IS '创建时间';

COMMENT ON COLUMN "lqbz"."T_CALCULATION_MODEL_VERSION"."UPDATE_BY" IS '更新者';

COMMENT ON COLUMN "lqbz"."T_CALCULATION_MODEL_VERSION"."UPDATE_TIME" IS '更新时间';

COMMENT ON COLUMN "lqbz"."T_CALCULATION_MODEL_VERSION"."IS_EDIT" IS '是否允许修改';
