SCO供应链协同

## 数据表：T_DRP_CHANNEL(渠道档案)

### T_DRP_CHANNEL(渠道档案)：描述

名称 | T_DRP_CHANNEL(渠道档案)
代码 | T_DRP_CHANNEL
注释 | 渠道档案
模型 | SCO供应链协同
主键 | PK_DRP_CHANNEL

### T_DRP_CHANNEL(渠道档案)：列规格定义

名称 | 代码 | 数据类型 | 长度 | 强制 | 注释
渠道ID | FCHANNELID | int |  | TRUE |
编码 | FNUMBER | nvarchar(30) | 30 | TRUE |
所属组织 | FCHANNELORGID | int |  | TRUE |
状态 | FDOCUMENTSTATUS | char(1) | 1 | TRUE | A:新建 Z:暂存 B: 审核中 C: 已审核 D:重新审核
渠道类型(作废) | FRELATIONTYPE | varchar(36) | 36 | TRUE |
对应资料(作废) | FRELATIONID | int |  | TRUE |
助记码 | FHELPCODE | nvarchar(50) | 50 | TRUE |
上级渠道 | FPARENTCHANNELID | int |  | TRUE |
渠道关系 | FCHANNELRELATION | varchar(20) | 20 | TRUE | 枚举: 1：调拨 2：购销
渠道类别(作废) | FCHANNELCATEGORY | varchar(20) | 20 | TRUE |
渠道级别(作废) | FCHANNELLEVEL | varchar(20) | 20 | TRUE |
创建人 | FCREATORID | int |  | TRUE |
创建日期 | FCREATEDATE | datetime |  | FALSE |
修改人 | FMODIFIERID | int |  | TRUE |
修改日期 | FMODIFYDATE | datetime |  | FALSE |
禁用状态 | FFORBIDSTATUS | char(1) | 1 | TRUE | 'A'否 ‘B'是
审核人 | FAPPROVERID | int |  | TRUE |
审核日期 | FAPPROVEDATE | datetime |  | FALSE |
渠道类型 | FCHANNELTYPE | varchar(36) | 36 | TRUE | 枚举： ORG_Organizations : 组织机构 BD_Department : 部门
对应部门 | FCHANNELDEPTID | int |  | TRUE |
对应客户 | FCHANNELCUSTID | int |  | TRUE |
对应供应商 | FCHANNELSUPPLYID | int |  | TRUE |
渠道类别 | FCHANNELCLASS | varchar(36) | 36 | TRUE | 关联渠道类别辅助资料
成立日期 | FESTABLISHDATE | datetime |  | FALSE |
加盟日期 | FJOINDATE | datetime |  | FALSE |
禁用人 | FFORBIDDERID | int |  | TRUE |
禁用日期 | FFORBIDDATE | datetime |  | FALSE |
渠道分组 | FCHANNELGROUP | int |  | TRUE |
是否根结点 | FISROOT | char(1) | 1 | TRUE |
深度 | FDEPTH | int |  | TRUE |
全路径 | FLEVELCODE | varchar(255) | 255 | TRUE |
渠道归属 | FCHANNELBELONG | varchar(20) | 20 | TRUE |
渠道细分 | FCHANNELTYPEID | int |  | TRUE |
所属分支机构 | FORGBRANCHID | int |  | TRUE |
负责人 | FHEAD | nvarchar(50) | 50 | TRUE |
联系电话 | FTEL | nvarchar(50) | 50 | TRUE |
地址 | FBASEADDRESS | nvarchar(255) | 255 | TRUE |
经度 | FLONGITUDE | nvarchar(50) | 50 | TRUE |
纬度 | FLATITUDE | nvarchar(50) | 50 | TRUE |
订货渠道 | FORDERCHANNELID | int |  | TRUE |
结算渠道 | FSETTLECHANNELID | int |  | TRUE |

### T_DRP_CHANNEL(渠道档案)：脚本代码

if exists (select 1
from sys.sysreferences r join sys.sysobjects o on (o.id = r.constid and o.type = 'F')
where r.fkeyid = object_id('T_DRP_CHANNEL') and o.name = 'FK_T_DRP_CH_REFERENCE_T_DRP_CH')
alter table T_DRP_CHANNEL
drop constraint FK_T_DRP_CH_REFERENCE_T_DRP_CH
go
if exists (select 1
from sys.sysreferences r join sys.sysobjects o on (o.id = r.constid and o.type = 'F')
where r.fkeyid = object_id('T_DRP_CHANNELPERSON') and o.name = 'FK_T_DRP_CH_R_DRP_CHA_T_DRP_CH')
alter table T_DRP_CHANNELPERSON
drop constraint FK_T_DRP_CH_R_DRP_CHA_T_DRP_CH
go
if exists (select 1
from sys.sysreferences r join sys.sysobjects o on (o.id = r.constid and o.type = 'F')
where r.fkeyid = object_id('T_DRP_CHANNELRECEIVE') and o.name = 'FK_T_DRP_CH_REFERENCE_T_DRP_CH')
alter table T_DRP_CHANNELRECEIVE
drop constraint FK_T_DRP_CH_REFERENCE_T_DRP_CH
go
if exists (select 1
from sys.sysreferences r join sys.sysobjects o on (o.id = r.constid and o.type = 'F')
where r.fkeyid = object_id('T_DRP_CHANNELSOURCE') and o.name = 'FK_T_DRP_CH_REFERENCE_T_DRP_CH')
alter table T_DRP_CHANNELSOURCE
drop constraint FK_T_DRP_CH_REFERENCE_T_DRP_CH
go
if exists (select 1
from sys.sysreferences r join sys.sysobjects o on (o.id = r.constid and o.type = 'F')
where r.fkeyid = object_id('T_DRP_CHANNELSTOCK') and o.name = 'FK_T_DRP_CH_REFERENCE_T_DRP_CH')
alter table T_DRP_CHANNELSTOCK
drop constraint FK_T_DRP_CH_REFERENCE_T_DRP_CH
go
if exists (select 1
from sys.sysreferences r join sys.sysobjects o on (o.id = r.constid and o.type = 'F')
where r.fkeyid = object_id('T_DRP_CHANNEL_L') and o.name = 'FK_T_DRP_CH_REFERENCE_T_DRP_CH')
alter table T_DRP_CHANNEL_L
drop constraint FK_T_DRP_CH_REFERENCE_T_DRP_CH
go
if exists (select 1
from sysindexes
where id = object_id('T_DRP_CHANNEL')
and name = 'IDX_DRP_CHANNEL_NUM'
and indid > 0
and indid < 255)
drop index T_DRP_CHANNEL.IDX_DRP_CHANNEL_NUM
go
if exists (select 1
from sysindexes
where id = object_id('T_DRP_CHANNEL')
and name = 'IDX_DRP_CHANNEL_ORGID'
and indid > 0
and indid < 255)
drop index T_DRP_CHANNEL.IDX_DRP_CHANNEL_ORGID
go
if exists (select 1
from sysobjects
where id = object_id('T_DRP_CHANNEL')
and type = 'U')
drop table T_DRP_CHANNEL
go
/*==============================================================*/
/* Table: T_DRP_CHANNEL */
/*==============================================================*/
create table T_DRP_CHANNEL (
FCHANNELID int not null default 0,
FNUMBER nvarchar(30) not null default '',
FCHANNELORGID int not null default 0,
FDOCUMENTSTATUS char(1) not null default '',
FRELATIONTYPE varchar(36) not null default '',
FRELATIONID int not null default 0,
FHELPCODE nvarchar(50) not null default '',
FPARENTCHANNELID int not null default 0,
FCHANNELRELATION varchar(20) not null default '',
FCHANNELCATEGORY varchar(20) not null default '',
FCHANNELLEVEL varchar(20) not null default '',
FCREATORID int not null default 0,
FCREATEDATE datetime null,
FMODIFIERID int not null default 0,
FMODIFYDATE datetime null,
FFORBIDSTATUS char(1) not null default 'A',
FAPPROVERID int not null default 0,
FAPPROVEDATE datetime null,
FCHANNELTYPE varchar(36) not null default '',
FCHANNELDEPTID int not null default 0,
FCHANNELCUSTID int not null default 0,
FCHANNELSUPPLYID int not null default 0,
FCHANNELCLASS varchar(36) not null default '',
FESTABLISHDATE datetime null,
FJOINDATE datetime null,
FFORBIDDERID int not null default 0,
FFORBIDDATE datetime null,
FCHANNELGROUP int not null default 0,
FISROOT char(1) not null default '0',
FDEPTH int not null default 0,
FLEVELCODE varchar(255) not null default '',
FCHANNELBELONG varchar(20) not null default '',
FCHANNELTYPEID int not null default 0,
FORGBRANCHID int not null default 0,
FHEAD nvarchar(50) not null default '',
FTEL nvarchar(50) not null default '',
FBASEADDRESS nvarchar(255) not null default '',
FLONGITUDE nvarchar(50) not null default '',
FLATITUDE nvarchar(50) not null default '',
FORDERCHANNELID int not null default 0,
FSETTLECHANNELID int not null default 0,
constraint PK_DRP_CHANNEL primary key (FCHANNELID)
)
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'渠道档案',
'user', @CurrentUser, 'table', 'T_DRP_CHANNEL'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'A:新建 Z:暂存 B: 审核中 C: 已审核 D:重新审核',
'user', @CurrentUser, 'table', 'T_DRP_CHANNEL', 'column', 'FDOCUMENTSTATUS'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'枚举:
1：调拨
2：购销',
'user', @CurrentUser, 'table', 'T_DRP_CHANNEL', 'column', 'FCHANNELRELATION'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'''A''否 ‘B''是',
'user', @CurrentUser, 'table', 'T_DRP_CHANNEL', 'column', 'FFORBIDSTATUS'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'枚举：
ORG_Organizations : 组织机构
BD_Department : 部门',
'user', @CurrentUser, 'table', 'T_DRP_CHANNEL', 'column', 'FCHANNELTYPE'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'关联渠道类别辅助资料',
'user', @CurrentUser, 'table', 'T_DRP_CHANNEL', 'column', 'FCHANNELCLASS'
go
/*==============================================================*/
/* Index: IDX_DRP_CHANNEL_ORGID */
/*==============================================================*/
create index IDX_DRP_CHANNEL_ORGID on T_DRP_CHANNEL (
FCHANNELORGID ASC
)
go
/*==============================================================*/
/* Index: IDX_DRP_CHANNEL_NUM */
/*==============================================================*/
create index IDX_DRP_CHANNEL_NUM on T_DRP_CHANNEL (
FNUMBER ASC
)
go
alter table T_DRP_CHANNEL
add constraint FK_T_DRP_CH_REFERENCE_T_DRP_CH foreign key (FCHANNELGROUP)
references T_DRP_CHANNELGROUP (FID)
go

### T_DRP_CHANNEL(渠道档案)：键值定义

名称 | 代码 | 主要的
PK_DRP_CHANNEL | PK_DRP_CHANNEL | TRUE

### T_DRP_CHANNEL(渠道档案)：索引定义

名称 | 代码 | 唯一的 | 群集器 | 主要的 | 外键 | 候选键 | 表格
IDX_DRP_CHANNEL_ORGID | IDX_DRP_CHANNEL_ORGID | FALSE | FALSE | FALSE | FALSE | FALSE | T_DRP_CHANNEL(渠道档案)
IDX_DRP_CHANNEL_NUM | IDX_DRP_CHANNEL_NUM | FALSE | FALSE | FALSE | FALSE | FALSE | T_DRP_CHANNEL(渠道档案)

上一页

主页

下一页