You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
DSWMS/DB/sqlserver/库存及库存相关表.sql

992 lines
34 KiB
Transact-SQL

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

--drop table OP_WMS
if exists (select 1
from sysobjects
where id = object_id('OP_WMS')
and type = 'U')
drop table OP_WMS
go
/*==============================================================*/
/* Table: OP_WMS */
/*==============================================================*/
create table OP_WMS (
WMSID uniqueidentifier not null,
BSNO varchar(50) null,
BILLTYPE varchar(50) null,
REMARK varchar(50) null,
CORPID uniqueidentifier null,
ModifyID uniqueidentifier null,
Modifier varchar(50) null,
ModifyDate datetime null,
CreateID uniqueidentifier null,
Creator varchar(50) null,
CreateDate datetime null,
CUSTOMERNAME varchar(50) null,
MATERIALNO varchar(50) null,
GOODSCODE varchar(50) null,
GOODSNAME varchar(50) null,
GOODSHSCODE varchar(50) null,
KGS numeric(18,3) null,
CBM numeric(18,3) null,
PKGS numeric(18,3) null,
KINDPKGS varchar(50) null,
STORAGEUNIT varchar(50) null,
STORAGEUNITCOUNT numeric(18,3) null,
RULEUNIT varchar(50) null,
RULEUNITCOUNT numeric(18,3) null,
ISCLEAR bit null,
BSSTATUS bit null,
FEESTATUS bit null,
TIMEMARK timestamp null,
constraint PK_OP_WMS primary key (WMSID)
)
go
if exists (select 1 from sys.extended_properties
where major_id = object_id('OP_WMS') and minor_id = 0)
begin
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description',
'user', @CurrentUser, 'table', 'OP_WMS'
end
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD><EFBFBD>',
'user', @CurrentUser, 'table', 'OP_WMS'
go
if exists (select 1
from sysobjects
where id = object_id('Vw_Op_Wms')
and type = 'V')
drop view Vw_Op_Wms
go
/****** Object: View [dbo].[Vw_Op_Wms] Script Date: 2020/8/21 11:30:59 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
create view [dbo].[Vw_Op_Wms]
as
select *
,(select name from company where gid= CONVERT(varchar(36),CORPID)) COMPANYNAME
,convert(numeric(18,6) ,KGS/1000)TONS
from OP_WMS
GO
------------------
if exists (select 1
from sysobjects
where id = object_id('OP_WMS_PHYSICS')
and type = 'U')
drop table OP_WMS_PHYSICS
go
/*==============================================================*/
/* Table: OP_WMS_PHYSICS */
/*==============================================================*/
create table OP_WMS_PHYSICS (
WMSPHYSICSID uniqueidentifier not null,
WMSID uniqueidentifier null,
STOREMAN varchar(50) null,
AREACODE varchar(50) null,
KGS numeric(18,3) null default 0,
CBM numeric(18,3) null default 0,
PKGS numeric(18,3) null default 0,
KINDPKGS varchar(50) null,
STORAGEUNIT varchar(50) null,
STORAGEUNITCOUNT numeric(18,3) null default 0,
RULEUNIT varchar(50) null,
RULEUNITCOUNT numeric(18,3) null default 0,
STARTDATE datetime null,
FEEENDDATE datetime null,
constraint PK_OP_WMS_PHYSICS primary key (WMSPHYSICSID)
)
go
if exists (select 1 from sys.extended_properties
where major_id = object_id('OP_WMS_PHYSICS') and minor_id = 0)
begin
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description',
'user', @CurrentUser, 'table', 'OP_WMS_PHYSICS'
end
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><EFBFBD>',
'user', @CurrentUser, 'table', 'OP_WMS_PHYSICS'
go
-----------------
if exists (select 1
from sysobjects
where id = object_id('OP_WMS_CHANGE_LOG<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD><EFBFBD>־')
and type = 'U')
drop table OP_WMS_CHANGE_LOG<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD><EFBFBD>־
go
/*==============================================================*/
/* Table: OP_WMS_CHANGE_LOG<4F><47><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E4B6AF>¼<EFBFBD><C2BC>־ */
/*==============================================================*/
create table OP_WMS_CHANGE_LOG<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD><EFBFBD>־ (
WMSLOGID uniqueidentifier not null,
WMSID uniqueidentifier null,
DOBSNO varchar(50) null,
DOGID uniqueidentifier null,
CreateID uniqueidentifier null,
CreateDate datetime null,
Creator varchar(50) null,
CHANGETYPE varchar(50) null,
KGS numeric(18,3) null,
CBM numeric(18,3) null,
PKGS numeric(18,3) null,
KINDPKGS varchar(50) null,
STORAGEUNIT varchar(50) null,
STORAGEUNITCOUNT numeric(18,3) null,
RULEUNIT varchar(50) null,
RULEUNITCOUNT numeric(18,3) null,
KGS2 numeric(18,3) null,
CBM2 numeric(18,3) null,
PKGS2 numeric(18,3) null,
KINDPKGS2 varchar(50) null,
STOREMAN2 varchar(50) null,
AREAID2 varchar(50) null,
PAYEDTAXES2 bit null,
STORAGEUNIT2 varchar(50) null,
STORAGEUNITCOUNT2 numeric(18,3) null,
RULEUNIT2 varchar(50) null,
RULEUNITCOUNT2 numeric(18,3) null,
KGS3 numeric(18,3) null,
CBM3 numeric(18,3) null,
PKGS3 numeric(18,3) null,
KINDPKGS3 varchar(50) null,
STOREMAN3 varchar(50) null,
AREAID3 varchar(50) null,
PAYEDTAXES3 bit null,
STORAGEUNIT3 varchar(50) null,
STORAGEUNITCOUNT3 numeric(18,3) null,
RULEUNIT3 varchar(50) null,
RULEUNITCOUNT3 numeric(18,3) null,
constraint PK_OP_WMS_CHANGE_LOG<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD><EFBFBD>־ primary key (WMSLOGID)
)
go
if exists (select 1 from sys.extended_properties
where major_id = object_id('OP_WMS_CHANGE_LOG<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD><EFBFBD>־') and minor_id = 0)
begin
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description',
'user', @CurrentUser, 'table', 'OP_WMS_CHANGE_LOG<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD><EFBFBD>־'
end
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ı<EFBFBD><EFBFBD>¼
<20>޺<EFBFBD>׺<EFBFBD>ֶ<EFBFBD>Ϊ<EFBFBD>䶯ֵ <20><>׺2Ϊԭֵ <20><>׺3Ϊ<33><CEAA>ֵ',
'user', @CurrentUser, 'table', 'OP_WMS_CHANGE_LOG<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD><EFBFBD>־'
go
-------------------
if exists (select 1
from sysobjects
where id = object_id('OP_WMS_PHYSICS_CHANGE<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼')
and type = 'U')
drop table OP_WMS_PHYSICS_CHANGE<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼
go
/*==============================================================*/
/* Table: OP_WMS_PHYSICS_CHANGE<47><45><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E4B6AF>¼ */
/*==============================================================*/
create table OP_WMS_PHYSICS_CHANGE<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼ (
WMSPHYSICS_LOGID uniqueidentifier not null,
WMSID uniqueidentifier null,
WMSPHYSICSID uniqueidentifier null,
STOREMAN varchar(50) null,
AREAID varchar(50) null,
DOBSNO varchar(50) null,
DOGID varchar(50) null,
CreateID uniqueidentifier null,
CreateDate datetime null,
Creator varchar(50) null,
CHANGETYPE varchar(50) null,
KGS numeric(18,3) null,
CBM numeric(18,3) null,
PKGS numeric(18,3) null,
KINDPKGS varchar(50) null,
STORAGEUNIT varchar(50) null,
STORAGEUNITCOUNT numeric(18,3) null,
RULEUNIT varchar(50) null,
RULEUNITCOUNT numeric(18,3) null,
KGS2 numeric(18,3) null,
CBM2 numeric(18,3) null,
PKGS2 numeric(18,3) null,
KINDPKGS2 varchar(50) null,
STOREMAN2 varchar(50) null,
AREAID2 varchar(50) null,
PAYEDTAXES2 bit null,
STORAGEUNIT2 varchar(50) null,
STORAGEUNITCOUNT2 numeric(18,3) null,
RULEUNIT2 varchar(50) null,
RULEUNITCOUNT2 numeric(18,3) null,
KGS3 numeric(18,3) null,
CBM3 numeric(18,3) null,
PKGS3 numeric(18,3) null,
KINDPKGS3 varchar(50) null,
STOREMAN3 varchar(50) null,
AREAID3 varchar(50) null,
PAYEDTAXES3 bit null,
STORAGEUNIT3 varchar(50) null,
STORAGEUNITCOUNT3 numeric(18,3) null,
RULEUNIT3 varchar(50) null,
RULEUNITCOUNT3 numeric(18,3) null,
constraint PK_OP_WMS_PHYSICS_CHANGE<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> primary key (WMSPHYSICS_LOGID)
)
go
if exists (select 1 from sys.extended_properties
where major_id = object_id('OP_WMS_PHYSICS_CHANGE<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼') and minor_id = 0)
begin
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description',
'user', @CurrentUser, 'table', 'OP_WMS_PHYSICS_CHANGE<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼'
end
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ı<EFBFBD><EFBFBD>¼
һ<>θı<CEB8><C4B1>ܿ<EFBFBD><DCBF><EFBFBD><EFBFBD>IJ<EFBFBD><C4B2><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>2<EFBFBD><32><EFBFBD><EFBFBD><E4B6AF>¼<EFBFBD><C2BC>־
<20>ֱ<EFBFBD><D6B1>ǿ<EFBFBD><C7BF><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><E4B6AF>¼<EFBFBD><C2BC>־<EFBFBD><D6BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E4B6AF>¼<EFBFBD><C2BC>־
<20><><EFBFBD><EFBFBD>ֻ<EFBFBD><D6BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',
'user', @CurrentUser, 'table', 'OP_WMS_PHYSICS_CHANGE<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼'
go
--------------------------
if exists (select 1
from sysobjects
where id = object_id('OP_WMS_LOGIC')
and type = 'U')
drop table OP_WMS_LOGIC
go
/*==============================================================*/
/* Table: OP_WMS_LOGIC */
/*==============================================================*/
create table OP_WMS_LOGIC (
WMSLOGICID uniqueidentifier not null,
WMSID uniqueidentifier null,
NAME varchar(50) null,
VALUE varchar(50) null,
constraint PK_OP_WMS_LOGIC primary key (WMSLOGICID)
)
go
if exists (select 1 from sys.extended_properties
where major_id = object_id('OP_WMS_LOGIC') and minor_id = 0)
begin
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description',
'user', @CurrentUser, 'table', 'OP_WMS_LOGIC'
end
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'<EFBFBD>߼<EFBFBD><EFBFBD><EFBFBD><EFBFBD>棬ʵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ؼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ã<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͳ<EFBFBD><EFBFBD>',
'user', @CurrentUser, 'table', 'OP_WMS_LOGIC'
go
---------------------------------
if exists (select 1
from sysobjects
where id = object_id('OP_WMS_LOGIC_LOG')
and type = 'U')
drop table OP_WMS_LOGIC_LOG
go
/*==============================================================*/
/* Table: OP_WMS_LOGIC_LOG */
/*==============================================================*/
create table OP_WMS_LOGIC_LOG (
WMSLOGIC_LOGID uniqueidentifier not null,
WMSID uniqueidentifier null,
WMSLOGICID uniqueidentifier null,
CHANGETYPE varchar(4) null,
NAME varchar(50) null,
VALUE varchar(50) null,
NAME2 varchar(50) null,
VALUE2 varchar(50) null,
CreateID uniqueidentifier null,
CreateDate datetime null,
Creator varchar(50) null,
constraint PK_OP_WMS_LOGIC_LOG primary key (WMSLOGIC_LOGID)
)
go
if exists (select 1 from sys.extended_properties
where major_id = object_id('OP_WMS_LOGIC_LOG') and minor_id = 0)
begin
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description',
'user', @CurrentUser, 'table', 'OP_WMS_LOGIC_LOG'
end
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'<EFBFBD>߼<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼ <20><>׺2Ϊԭֵ',
'user', @CurrentUser, 'table', 'OP_WMS_LOGIC_LOG'
go
-------
/*==============================================================*/
/* Table: OP_WMS_IN_DO */
/*==============================================================*/
if exists (select 1
from sysobjects
where id = object_id('OP_WMS_IN_DO')
and type = 'U')
drop table OP_WMS_IN_DO
go
create table OP_WMS_IN_DO (
BSNO varchar(50) null,
WMSDOID uniqueidentifier not null,
WMS_PLAN_BSNO varchar(50) null,
BILLTYPE varchar(50) null,
CUSTOMERNAME varchar(50) null,
MATERIALNO varchar(50) null,
GOODSCODE varchar(50) null,
GOODSNAME varchar(50) null,
GOODSHSCODE varchar(50) null,
MBLNO varchar(50) null,
PAYEDTAXES bit null,
BSSTATUS varchar(50) null,
CreateDate datetime null,
Creator datetime null,
CreateID uniqueidentifier null,
REMARK varchar(500) null,
constraint PK_OP_WMS_IN_DO primary key (WMSDOID)
)
go
if exists (select 1 from sys.extended_properties
where major_id = object_id('OP_WMS_IN_DO') and minor_id = 0)
begin
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description',
'user', @CurrentUser, 'table', 'OP_WMS_IN_DO'
end
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'<EFBFBD><EFBFBD><EFBFBD>Դ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
һ<><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ִ<EFBFBD><D6B4> <20><><EFBFBD><EFBFBD>һ<EFBFBD>ο<EFBFBD><CEBF><EFBFBD><EFBFBD><EFBFBD><E4B6AF>һ<EFBFBD><D2BB><EFBFBD>߼<EFBFBD><DFBC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E4B6AF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E4B6AF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϸ<EFBFBD><CFB8>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>/<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E4B6AF>',
'user', @CurrentUser, 'table', 'OP_WMS_IN_DO'
go
if exists (select 1
from sysobjects
where id = object_id('VW_OP_WMS_IN_DO')
and type = 'V')
drop view VW_OP_WMS_IN_DO
go
create view VW_OP_WMS_IN_DO
as select * from OP_WMS_IN_DO
GO
/*==============================================================*/
/* Table: OP_WMS_IN_DO_GOODS */
/*==============================================================*/
if exists (select 1
from sysobjects
where id = object_id('OP_WMS_IN_DO_GOODS')
and type = 'U')
drop table OP_WMS_IN_DO_GOODS
go
create table OP_WMS_IN_DO_GOODS (
WMSDODETAILID uniqueidentifier not null,
WMSDOID uniqueidentifier null,
STOREHOUSE varchar(50) null,
AREACODE varchar(50) null,
KGS numeric(18,3) null,
CBM numeric(18,3) null,
PKGS numeric(18,3) null,
KINDPKGS varchar(50) null,
STORAGEUNIT varchar(50) null,
STORAGEUNITCOUNT numeric(18,3) null,
RULEUNIT varchar(50) null,
RULEUNITCOUNT numeric(18,3) null,
constraint PK_OP_WMS_IN_DO_GOODS primary key (WMSDODETAILID)
)
go
if exists (select 1 from sys.extended_properties
where major_id = object_id('OP_WMS_IN_DO_GOODS') and minor_id = 0)
begin
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description',
'user', @CurrentUser, 'table', 'OP_WMS_IN_DO_GOODS'
end
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'<EFBFBD><EFBFBD>¼ʵ<EFBFBD>ʵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><EFBFBD>',
'user', @CurrentUser, 'table', 'OP_WMS_IN_DO_GOODS'
go
if exists(select 1 from sys.extended_properties p where
p.major_id = object_id('OP_WMS_IN_DO_GOODS')
and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'STORAGEUNIT')
)
begin
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description',
'user', @CurrentUser, 'table', 'OP_WMS_IN_DO_GOODS', 'column', 'STORAGEUNIT'
end
if exists (select 1
from sysobjects
where id = object_id('VW_OP_WMS_IN_DO_GOODS')
and type = 'V')
drop view VW_OP_WMS_IN_DO_GOODS
go
create view VW_OP_WMS_IN_DO_GOODS
as select * from OP_WMS_IN_DO_GOODS
GO
/*==============================================================*/
/* Table: OP_WMS_IN_DO_WORKDETAIL */
/*==============================================================*/
if exists (select 1
from sysobjects
where id = object_id('OP_WMS_IN_DO_WORKDETAIL')
and type = 'U')
drop table OP_WMS_IN_DO_WORKDETAIL
go
create table OP_WMS_IN_DO_WORKDETAIL (
WORKDETAILID uniqueidentifier not null,
WMSDOID uniqueidentifier null,
WORKER varchar(50) null,
WORKNAME varchar(50) null,
WORKLOADCOUNT numeric(18,3) null,
PRICE numeric(18,3) null,
AMOUNT numeric(18,2) null,
PRICE2 numeric(18,3) null,
AMOUNT2 numeric(18,2) null,
WORKDATE datetime null,
constraint PK_OP_WMS_IN_DO_WORKDETAIL primary key (WORKDETAILID)
)
go
if exists (select 1 from sys.extended_properties
where major_id = object_id('OP_WMS_IN_DO_WORKDETAIL') and minor_id = 0)
begin
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description',
'user', @CurrentUser, 'table', 'OP_WMS_IN_DO_WORKDETAIL'
end
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'<EFBFBD><EFBFBD>¼<EFBFBD><EFBFBD><EFBFBD>ع<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD>Ĺ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',
'user', @CurrentUser, 'table', 'OP_WMS_IN_DO_WORKDETAIL'
go
if exists (select 1
from sysobjects
where id = object_id('VW_OP_WMS_IN_DO_WORKDETAIL')
and type = 'V')
drop view VW_OP_WMS_IN_DO_WORKDETAIL
go
create view VW_OP_WMS_IN_DO_WORKDETAIL
as select * from OP_WMS_IN_DO_WORKDETAIL
GO
/*==============================================================*/
/* Table: OP_WMS_STOREHOUSE_LETOUT */
/*==============================================================*/
if exists (select 1
from sysobjects
where id = object_id('OP_WMS_STOREHOUSE_LETOUT')
and type = 'U')
drop table OP_WMS_STOREHOUSE_LETOUT
go
create table OP_WMS_STOREHOUSE_LETOUT (
GID uniqueidentifier not null,
AREACODE varchar(50) null,
STOREHOUSECODE varchar(50) null,
CUSTOMERNAME varchar(50) null,
AREA numeric(18,3) null,
STARTDATE datetime null,
ENDDATE datetime null,
REMARK varchar(500) null,
PRICE numeric(18,3) null,
DAYPRICE numeric(18,3) null,
constraint PK_OP_WMS_STOREHOUSE_LETOUT primary key (GID)
)
go
if exists (select 1 from sys.extended_properties
where major_id = object_id('OP_WMS_STOREHOUSE_LETOUT') and minor_id = 0)
begin
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description',
'user', @CurrentUser, 'table', 'OP_WMS_STOREHOUSE_LETOUT'
end
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'<EFBFBD><EFBFBD>¼<EFBFBD><EFBFBD>λ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',
'user', @CurrentUser, 'table', 'OP_WMS_STOREHOUSE_LETOUT'
go
/*==============================================================*/
/* Table: OP_WMS_FEECALENDAR */
/*==============================================================*/
if exists (select 1
from sysobjects
where id = object_id('OP_WMS_FEECALENDAR')
and type = 'U')
drop table OP_WMS_FEECALENDAR
go
create table OP_WMS_FEECALENDAR (
FEECALENDERID uniqueidentifier not null,
WMSID uniqueidentifier null,
WMSDUIID uniqueidentifier null,
CUSTOMERNAME varchar(50) null,
FEEDATE datetime null,
QUANTITY numeric(18,2) null,
FEETYPE int null,
PRICE numeric(18,2) null,
AMOUNT numeric(18,2) null,
constraint PK_OP_WMS_FEECALENDAR primary key (FEECALENDERID),
)
go
if exists (select 1 from sys.extended_properties
where major_id = object_id('OP_WMS_FEECALENDAR') and minor_id = 0)
begin
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description',
'user', @CurrentUser, 'table', 'OP_WMS_FEECALENDAR'
end
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'<EFBFBD>ִ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',
'user', @CurrentUser, 'table', 'OP_WMS_FEECALENDAR'
go
drop view VW_OP_WMS_FEECALENDAR
go
create view VW_OP_WMS_FEECALENDAR as
select fc.*,wms.MBLNO ,wms.CNTRNO,wms.MBLNO+'_'+wms.CNTRNO MBLNOCNTRNO,wms.GOODSNAME from OP_WMS_FEECALENDAR fc left join op_wms wms on wms.wmsid=fc.wmsid
/*==============================================================*/
/* Table: OP_WMS_FEEDUI_STORAGE <20>ִ<EFBFBD><D6B4><EFBFBD><EFBFBD>½<EFBFBD><C2BD>˵<EFBFBD> */
/*==============================================================*/
if exists (select 1
from sysobjects
where id = object_id('OP_WMS_FEEDUI_STORAGE')
and type = 'U')
drop table OP_WMS_FEEDUI_STORAGE
go
create table OP_WMS_FEEDUI_STORAGE (
WMSDUIID uniqueidentifier not null,
BSNO varchar(50) null,
CUSTOMERNAME varchar(50) null,
ACCDATE datetime null,
QUANTITY numeric(18,2) null,
AMOUNT numeric(18,2) null,
STARTDATE datetime null,
ENDDATE datetime null,
BILLSTATUS varchar(10) null,
REMARK varchar(500) null
)
go
if exists (select 1 from sys.extended_properties
where major_id = object_id('OP_WMS_FEEDUI_STORAGE') and minor_id = 0)
begin
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description',
'user', @CurrentUser, 'table', 'OP_WMS_FEEDUI_STORAGE'
end
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'<EFBFBD>ִ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>½<EFBFBD><EFBFBD>˵<EFBFBD>',
'user', @CurrentUser, 'table', 'OP_WMS_FEEDUI_STORAGE'
go
drop view VW_OP_WMS_FEEDUI_STORAGE
GO
create view VW_OP_WMS_FEEDUI_STORAGE
as select * from OP_WMS_FEEDUI_STORAGE
/*==============================================================*/
/* Table: OP_WMS_FEEDUI_STORAGE_DETAIL <20>½<EFBFBD><C2BD>˵<EFBFBD><CBB5><EFBFBD>ϸ */
/*==============================================================*/
if exists (select 1
from sysobjects
where id = object_id('OP_WMS_FEEDUI_STORAGE_DETAIL')
and type = 'U')
drop table OP_WMS_FEEDUI_STORAGE_DETAIL
go
create table OP_WMS_FEEDUI_STORAGE_DETAIL (
WMSDUIDETAILID uniqueidentifier not null,
WMSDUIID uniqueidentifier null,
CUSTOMERNAME varchar(50) null,
ACCDATE datetime null,
MBLNO varchar(50) null,
QUANTITY numeric(18,2) null,
AMOUNT numeric(18,2) null,
STARTDATE datetime null,
ENDDATE datetime null,
REMARK varchar(500) null,
constraint PK_OP_WMS_FEEDUI_STORAGE_DETAI primary key (WMSDUIDETAILID)
)
go
if exists (select 1 from sys.extended_properties
where major_id = object_id('OP_WMS_FEEDUI_STORAGE_DETAIL') and minor_id = 0)
begin
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description',
'user', @CurrentUser, 'table', 'OP_WMS_FEEDUI_STORAGE_DETAIL'
end
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'<EFBFBD>ִ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>½<EFBFBD><EFBFBD>˵<EFBFBD><EFBFBD><EFBFBD>ϸ',
'user', @CurrentUser, 'table', 'OP_WMS_FEEDUI_STORAGE_DETAIL'
go
-----------------------
if exists (select 1
from sysobjects
where id = object_id('OP_WMS_TRANSFERGOODS')
and type = 'U')
drop table OP_WMS_TRANSFERGOODS
go
/*==============================================================*/
/* Table: OP_WMS_TRANSFERGOODS */
/*==============================================================*/
create table OP_WMS_TRANSFERGOODS (
WMSTRANSFERGOODSID uniqueidentifier not null,
BSNO varchar(50) null,
OLDCUSTOMERNAME varchar(50) null,
NEWCUSTERNAME varchar(50) null,
TRANSFERDATE datetime null,
STOREHOUSEDAYS tinyint null,
STOREHOUSEENDDATE datetime null,
WMSINFEE_OLDCUST bit null,
WMSOUTFEE_OLDCUST bit null,
--TIMEMARK timestamp null,
REMARK varchar(500) null,
CORPID uniqueidentifier null,
ModifyID uniqueidentifier null,
Modifier varchar(50) null,
ModifyDate datetime null,
CreateID uniqueidentifier null,
Creator varchar(50) null,
CreateDate datetime null,
constraint PK_OP_WMS_TRANSFERGOODS primary key (WMSTRANSFERGOODSID)
)
go
if exists (select 1 from sys.extended_properties
where major_id = object_id('OP_WMS_TRANSFERGOODS') and minor_id = 0)
begin
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description',
'user', @CurrentUser, 'table', 'OP_WMS_TRANSFERGOODS'
end
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'<EFBFBD><EFBFBD>Ȩת<EFBFBD><EFBFBD>',
'user', @CurrentUser, 'table', 'OP_WMS_TRANSFERGOODS'
go
create view VW_OP_WMS_TRANSFERGOODS as select * from OP_WMS_TRANSFERGOODS
-------------
if exists (select 1
from sysobjects
where id = object_id('OP_WMS_TRANSFERGOODS_DETAIL')
and type = 'U')
drop table OP_WMS_TRANSFERGOODS_DETAIL
go
/*==============================================================*/
/* Table: OP_WMS_TRANSFERGOODS_DETAIL */
/*==============================================================*/
create table OP_WMS_TRANSFERGOODS_DETAIL (
WMSDODETAILID uniqueidentifier not null,
WMSTRANSFERGOODSID uniqueidentifier null,
REMARK varchar(50) null,
CORPID uniqueidentifier null,
ModifyID uniqueidentifier null,
Modifier varchar(50) null,
ModifyDate datetime null,
CreateID uniqueidentifier null,
Creator varchar(50) null,
CreateDate datetime null,
WMSID uniqueidentifier null,
ISALL bit null,
KGS numeric(18,3) null,
CBM numeric(18,3) null,
PKGS numeric(18,3) null,
KINDPKGS varchar(50) null,
STORAGEUNIT varchar(50) null,
STORAGEUNITCOUNT numeric(18,3) null,
RULEUNIT varchar(50) null,
RULEUNITCOUNT numeric(18,3) null,
BSSTATUS bit null,
FEESTATUS bit null,
--TIMEMARK timestamp null,
constraint PK_OP_WMS_TRANSFERGOODS_DETAIL primary key (WMSDODETAILID)
)
go
if exists (select 1 from sys.extended_properties
where major_id = object_id('OP_WMS_TRANSFERGOODS_DETAIL') and minor_id = 0)
begin
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description',
'user', @CurrentUser, 'table', 'OP_WMS_TRANSFERGOODS_DETAIL'
end
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'<EFBFBD><EFBFBD>ת<EFBFBD><EFBFBD>ϸ
<20><>תʱ<D7AA>ճ<EFBFBD><D5B3>߼<EFBFBD><DFBC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
<20>硰ȫ<E7A1B0><C8AB><EFBFBD><EFBFBD>ת<EFBFBD><D7AA><EFBFBD><EFBFBD><EFBFBD>ճ<EFBFBD><D5B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB><EFBFBD><EFBFBD><EFBFBD>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȡ<EFBFBD>
<20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA>д<EFBFBD><D0B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д<EFBFBD><D0B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB>ϸ',
'user', @CurrentUser, 'table', 'OP_WMS_TRANSFERGOODS_DETAIL'
go
--drop view VW_OP_WMS_TRANSFERGOODS_DETAIL
create view VW_OP_WMS_TRANSFERGOODS_DETAIL as
select d.*,w.GOODSNAME,w.MBLNO,w.CNTRNO,w.INDATE
from OP_WMS_TRANSFERGOODS_DETAIL d
left join op_wms w on w.WMSID=d.WMSID
/****** Object: Table [dbo].[OP_WMS_PHYSICS] Script Date: 2020/10/15 15:37:18 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[OP_WMS_PHYSICS_DODETAIL](
[DODETAILID] [uniqueidentifier] NOT NULL,
[WMSDOID] [uniqueidentifier] NOT NULL,
[WMSPHYSICSID] [uniqueidentifier] NOT NULL,
[WMSID] [uniqueidentifier] NULL,
[STOREHOUSE] [varchar](50) NULL,
[AREACODE] [varchar](50) NULL,
[KGS] [numeric](18, 3) NULL,
[CBM] [numeric](18, 3) NULL,
[PKGS] [numeric](18, 3) NULL,
[KINDPKGS] [varchar](50) NULL,
[STORAGEUNIT] [varchar](50) NULL,
[STORAGEUNITCOUNT] [numeric](18, 6) NULL,
[RULEUNIT] [varchar](50) NULL,
[RULEUNITCOUNT] [numeric](18, 3) NULL,
[STARTDATE] [datetime] NULL,
[FEEENDDATE] [datetime] NULL,
CONSTRAINT [PK_OP_WMS_PHYSICS_DODETAIL] PRIMARY KEY CLUSTERED
(
[WMSPHYSICSID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ<EFBFBD><EFBFBD>¼ <20><><EFBFBD>ڼ<EFBFBD>¼<EFBFBD>ƿ⡢<C6BF><E2A1A2>ת<EFBFBD><D7AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'OP_WMS_PHYSICS_DODETAIL'
GO
create view VW_OP_WMS_PHYSICS_DODETAIL as
select D.*,W.CUSTOMERNAME,W.GOODSNAME,W.MBLNO,W.CNTRNO from OP_WMS_PHYSICS_DODETAIL D
left join OP_WMS W on W.WMSID=D.WMSID
-------------
if exists (select 1
from sysobjects
where id = object_id('OP_WMS_MOVE')
and type = 'U')
drop table OP_WMS_MOVE
go
/*==============================================================*/
/* Table: OP_WMS_MOVE */
/*==============================================================*/
create table OP_WMS_MOVE (
WMSDOID uniqueidentifier not null,
BSNO varchar(50) null,
CUSTOMERNAME varchar(50) null,
DODATE datetime null,
REMARK varchar(500) null,
WMSID uniqueidentifier null,
WMSPHYSICSID uniqueidentifier null,
WMSPHYSICSID_NEW uniqueidentifier null,
STOREHOUSE varchar(50) null,
AREACODE varchar(50) null,
STOREHOUSE_NEW varchar(50) null,
AREACODE_NEW varchar(50) null,
KGS numeric(18,3) null,
CBM numeric(18,3) null,
PKGS numeric(18,3) null,
KINDPKGS varchar(50) null,
STORAGEUNIT varchar(50) null,
STORAGEUNITCOUNT numeric(18,6) null,
RULEUNIT varchar(50) null,
RULEUNITCOUNT numeric(18,6) null,
BILLSTATUS varchar(10) null,
CORPID uniqueidentifier null,
ModifyID uniqueidentifier null,
Modifier varchar(50) null,
ModifyDate datetime null,
CreateID uniqueidentifier null,
Creator varchar(50) null,
CreateDate datetime null,
constraint PK_OP_WMS_MOVE primary key (WMSDOID)
)
go
if exists (select 1 from sys.extended_properties
where major_id = object_id('OP_WMS_MOVE') and minor_id = 0)
begin
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description',
'user', @CurrentUser, 'table', 'OP_WMS_MOVE'
end
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
ֻ<>ı<EFBFBD><C4B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
<20><>ϸֱ<CFB8><D6B1>ʹ<EFBFBD><CAB9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><EFBFBD><E4B6AF>',
'user', @CurrentUser, 'table', 'OP_WMS_MOVE'
go
--drop view VW_OP_WMS_MOVE
create view VW_OP_WMS_MOVE as select m.*,w.MBLNO,w.CNTRNO,w.GOODSNAME from OP_WMS_MOVE m left join op_wms w on w.WMSID=m.WMSID