<<<<<<< HEAD
-- doc_inventory_item_static definition

-- Drop table

-- DROP TABLE doc_inventory_item_static;

CREATE TABLE doc_inventory_item_static ( id bigserial NOT NULL, category_code varchar(255) DEFAULT '0'::character varying NOT NULL, "name" varchar(255) DEFAULT ''::character varying NOT NULL, inventory_status_enum int4 DEFAULT 0 NOT NULL, supplier_id int8 NOT NULL, description_text varchar(2000) NULL, unit_code varchar(255) DEFAULT ''::character varying NOT NULL, quantity numeric(20, 6) DEFAULT 0 NOT NULL, lot_number varchar(255) DEFAULT ''::character varying NOT NULL, production_date timestamptz(6) NULL, expiration_date timestamptz(6) NULL, location_store_id int8 NULL, location_id int8 NOT NULL, trace_no varchar(50000) DEFAULT ''::character varying NOT NULL, packaging_levels int4 DEFAULT 1 NOT NULL, tenant_id int8 NOT NULL, delete_flag int4 DEFAULT 0 NOT NULL, create_by varchar(32) DEFAULT ''::character varying NOT NULL, create_time timestamptz(6) NOT NULL, update_by varchar(32) NULL, update_time timestamptz(6) NULL, item_table varchar(255) DEFAULT ''::character varying NOT NULL, item_id int8 NOT NULL, price numeric(20, 6) NULL, sale_price numeric(20, 6) NULL, bus_no varchar(255) DEFAULT ''::character varying NOT NULL, min_unit_code varchar(255) DEFAULT ''::character varying NOT NULL, part_percent numeric(20, 6) DEFAULT 0 NOT NULL, supplier_name varchar(255) DEFAULT ''::character varying NOT NULL, location_name varchar(255) DEFAULT ''::character varying NOT NULL, location_store_name varchar(255) DEFAULT ''::character varying NOT NULL, manufacturer_text varchar(2000) NULL, chrgitm_lv int4 DEFAULT 3 NOT NULL, total_volume varchar(255) DEFAULT ''::character varying NOT NULL, py_str varchar(255) DEFAULT ''::character varying NOT NULL, wb_str varchar(255) DEFAULT ''::character varying NOT NULL, CONSTRAINT doc_inventory_item_static_pkey PRIMARY KEY (id));
COMMENT ON TABLE doc_inventory_item_static IS '库存项目管理';

-- Column comments

COMMENT ON COLUMN doc_inventory_item_static.id IS 'ID';
COMMENT ON COLUMN doc_inventory_item_static.category_code IS '物品类别';
COMMENT ON COLUMN doc_inventory_item_static."name" IS '名称';
COMMENT ON COLUMN doc_inventory_item_static.inventory_status_enum IS '库存状态';
COMMENT ON COLUMN doc_inventory_item_static.supplier_id IS '供应商id';
COMMENT ON COLUMN doc_inventory_item_static.description_text IS '说明书';
COMMENT ON COLUMN doc_inventory_item_static.unit_code IS '最小单位';
COMMENT ON COLUMN doc_inventory_item_static.quantity IS '当前库存数量(最小单位数量)';
COMMENT ON COLUMN doc_inventory_item_static.lot_number IS '产品批号';
COMMENT ON COLUMN doc_inventory_item_static.production_date IS '生产日期';
COMMENT ON COLUMN doc_inventory_item_static.expiration_date IS '失效日期';
COMMENT ON COLUMN doc_inventory_item_static.location_store_id IS '库位';
COMMENT ON COLUMN doc_inventory_item_static.location_id IS '仓库';
COMMENT ON COLUMN doc_inventory_item_static.trace_no IS '追溯码';
COMMENT ON COLUMN doc_inventory_item_static.packaging_levels IS '追溯码包装层级';
COMMENT ON COLUMN doc_inventory_item_static.tenant_id IS '租户ID';
COMMENT ON COLUMN doc_inventory_item_static.delete_flag IS '删除状态';
COMMENT ON COLUMN doc_inventory_item_static.create_by IS '创建人';
COMMENT ON COLUMN doc_inventory_item_static.create_time IS '创建时间';
COMMENT ON COLUMN doc_inventory_item_static.update_by IS '更新人';
COMMENT ON COLUMN doc_inventory_item_static.update_time IS '更新时间';
COMMENT ON COLUMN doc_inventory_item_static.item_table IS '项目';
COMMENT ON COLUMN doc_inventory_item_static.item_id IS '物品编码';
COMMENT ON COLUMN doc_inventory_item_static.price IS '采购单价(包装单位)';
COMMENT ON COLUMN doc_inventory_item_static.sale_price IS '销售单价(包装单位)';
COMMENT ON COLUMN doc_inventory_item_static.bus_no IS '项目编号';
COMMENT ON COLUMN doc_inventory_item_static.min_unit_code IS '最小单位';
COMMENT ON COLUMN doc_inventory_item_static.part_percent IS '拆零比';
COMMENT ON COLUMN doc_inventory_item_static.supplier_name IS '供应商名称';
COMMENT ON COLUMN doc_inventory_item_static.location_name IS '库房名称';
COMMENT ON COLUMN doc_inventory_item_static.location_store_name IS '货位名称';
COMMENT ON COLUMN doc_inventory_item_static.manufacturer_text IS '生产厂商文本';
COMMENT ON COLUMN doc_inventory_item_static.chrgitm_lv IS '医保等级';
COMMENT ON COLUMN doc_inventory_item_static.total_volume IS '规格';
COMMENT ON COLUMN doc_inventory_item_static.py_str IS '药品名称拼音码';
COMMENT ON COLUMN doc_inventory_item_static.wb_str IS '药品五笔码';
=======
-- public.doc_inventory_item_static definition

-- Drop table

-- DROP TABLE public.doc_inventory_item_static;

CREATE TABLE public.doc_inventory_item_static ( id bigserial NOT NULL, category_code varchar(255) DEFAULT '0'::character varying NOT NULL, "name" varchar(255) DEFAULT ''::character varying NOT NULL, inventory_status_enum int4 DEFAULT 0 NOT NULL, supplier_id int8 NOT NULL, description_text varchar(2000) NULL, unit_code varchar(255) DEFAULT ''::character varying NOT NULL, quantity numeric(20, 6) DEFAULT 0 NOT NULL, lot_number varchar(255) DEFAULT ''::character varying NOT NULL, production_date timestamptz(6) NULL, expiration_date timestamptz(6) NULL, location_store_id int8 NULL, location_id int8 NOT NULL, trace_no varchar(50000) DEFAULT ''::character varying NOT NULL, packaging_levels int4 DEFAULT 1 NOT NULL, tenant_id int8 NOT NULL, delete_flag int4 DEFAULT 0 NOT NULL, create_by varchar(32) DEFAULT ''::character varying NOT NULL, create_time timestamptz(6) NOT NULL, update_by varchar(32) NULL, update_time timestamptz(6) NULL, item_table varchar(255) DEFAULT ''::character varying NOT NULL, item_id int8 NOT NULL, price numeric(20, 6) NULL, sale_price numeric(20, 6) NULL, bus_no varchar(255) DEFAULT ''::character varying NOT NULL, min_unit_code varchar(255) DEFAULT ''::character varying NOT NULL, part_percent numeric(20, 6) DEFAULT 0 NOT NULL, supplier_name varchar(255) DEFAULT ''::character varying NOT NULL, location_name varchar(255) DEFAULT ''::character varying NOT NULL, location_store_name varchar(255) DEFAULT ''::character varying NOT NULL, manufacturer_text varchar(2000) NULL, chrgitm_lv int4 DEFAULT 3 NOT NULL, total_volume varchar(255) DEFAULT ''::character varying NOT NULL, py_str varchar(255) DEFAULT ''::character varying NOT NULL, wb_str varchar(255) DEFAULT ''::character varying NOT NULL, CONSTRAINT doc_inventory_item_static_pkey PRIMARY KEY (id));
COMMENT ON TABLE public.doc_inventory_item_static IS '库存项目管理';

-- Column comments

COMMENT ON COLUMN public.doc_inventory_item_static.id IS 'ID';
COMMENT ON COLUMN public.doc_inventory_item_static.category_code IS '物品类别';
COMMENT ON COLUMN public.doc_inventory_item_static."name" IS '名称';
COMMENT ON COLUMN public.doc_inventory_item_static.inventory_status_enum IS '库存状态';
COMMENT ON COLUMN public.doc_inventory_item_static.supplier_id IS '供应商id';
COMMENT ON COLUMN public.doc_inventory_item_static.description_text IS '说明书';
COMMENT ON COLUMN public.doc_inventory_item_static.unit_code IS '最小单位';
COMMENT ON COLUMN public.doc_inventory_item_static.quantity IS '当前库存数量(最小单位数量)';
COMMENT ON COLUMN public.doc_inventory_item_static.lot_number IS '产品批号';
COMMENT ON COLUMN public.doc_inventory_item_static.production_date IS '生产日期';
COMMENT ON COLUMN public.doc_inventory_item_static.expiration_date IS '失效日期';
COMMENT ON COLUMN public.doc_inventory_item_static.location_store_id IS '库位';
COMMENT ON COLUMN public.doc_inventory_item_static.location_id IS '仓库';
COMMENT ON COLUMN public.doc_inventory_item_static.trace_no IS '追溯码';
COMMENT ON COLUMN public.doc_inventory_item_static.packaging_levels IS '追溯码包装层级';
COMMENT ON COLUMN public.doc_inventory_item_static.tenant_id IS '租户ID';
COMMENT ON COLUMN public.doc_inventory_item_static.delete_flag IS '删除状态';
COMMENT ON COLUMN public.doc_inventory_item_static.create_by IS '创建人';
COMMENT ON COLUMN public.doc_inventory_item_static.create_time IS '创建时间';
COMMENT ON COLUMN public.doc_inventory_item_static.update_by IS '更新人';
COMMENT ON COLUMN public.doc_inventory_item_static.update_time IS '更新时间';
COMMENT ON COLUMN public.doc_inventory_item_static.item_table IS '项目';
COMMENT ON COLUMN public.doc_inventory_item_static.item_id IS '物品编码';
COMMENT ON COLUMN public.doc_inventory_item_static.price IS '采购单价(包装单位)';
COMMENT ON COLUMN public.doc_inventory_item_static.sale_price IS '销售单价(包装单位)';
COMMENT ON COLUMN public.doc_inventory_item_static.bus_no IS '项目编号';
COMMENT ON COLUMN public.doc_inventory_item_static.min_unit_code IS '最小单位';
COMMENT ON COLUMN public.doc_inventory_item_static.part_percent IS '拆零比';
COMMENT ON COLUMN public.doc_inventory_item_static.supplier_name IS '供应商名称';
COMMENT ON COLUMN public.doc_inventory_item_static.location_name IS '库房名称';
COMMENT ON COLUMN public.doc_inventory_item_static.location_store_name IS '货位名称';
COMMENT ON COLUMN public.doc_inventory_item_static.manufacturer_text IS '生产厂商文本';
COMMENT ON COLUMN public.doc_inventory_item_static.chrgitm_lv IS '医保等级';
COMMENT ON COLUMN public.doc_inventory_item_static.total_volume IS '规格';
COMMENT ON COLUMN public.doc_inventory_item_static.py_str IS '药品名称拼音码';
COMMENT ON COLUMN public.doc_inventory_item_static.wb_str IS '药品五笔码';
>>>>>>> v1.3
   -- 插入为tmp_activity_device表添加列的迁移记录
INSERT INTO __MigrationsHistory (MigrationId, ProductVersion)
VALUES ('202511041214 add_table doc_inventory_item_static', '1.0.0');