SCO供应链协同

## 数据表：T_RPM_RPPOLICY(返利政策)

### T_RPM_RPPOLICY(返利政策)：描述

名称 | T_RPM_RPPOLICY(返利政策)
代码 | T_RPM_RPPOLICY
注释 | 返利政策
模型 | SCO供应链协同
主键 | PK_RPM_RPPOLICY

### T_RPM_RPPOLICY(返利政策)：列规格定义

名称 | 代码 | 数据类型 | 长度 | 强制 | 注释
主键 | FID | int |  | TRUE |
返利政策编码 | FBILLNO | nvarchar(30) | 30 | TRUE |
单据状态 | FDOCUMENTSTATUS | char(1) | 1 | TRUE | Z:暂存 A: 创建 B:审核中 C:已审核 D:重新审核
主题 | FNAME | nvarchar(80) | 80 | TRUE |
返利组织 | FCOMPANYORGUNITID | int |  | TRUE |
币别 | FCURRENCYID | int |  | TRUE |
返利内容 | FCONTENT | nvarchar(500) | 500 | TRUE |
返利模式 | FRPMODEID | int |  | TRUE |
返利累进方式 | FCUMULATATIONTYPE | varchar(20) | 20 | TRUE | 1:全额累进 2：超额累进
创建人 | FCREATORID | int |  | TRUE |
创建日期 | FCREATEDATE | datetime |  | FALSE |
修改人 | FMODIFIERID | int |  | TRUE |
修改日期 | FMODIFYDATE | datetime |  | FALSE |
审核人 | FAPPROVERID | int |  | TRUE |
审核日期 | FAPPROVEDATE | datetime |  | FALSE |
失效人 | FFORBIDERID | int |  | TRUE |
失效日期 | FFORBIDDATE | datetime |  | FALSE |
失效状态 | FFORBIDSTATUS | char(1) | 1 | TRUE | A:否 B：是
多组号执行策略 | FJUDGEMENTMODEL | varchar(20) | 20 | TRUE |

### T_RPM_RPPOLICY(返利政策)：脚本代码

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_RPM_RPPOLICY') and o.name = 'FK_T_RPM_RP_R_RPMODE__T_RPM_RP')
alter table T_RPM_RPPOLICY
drop constraint FK_T_RPM_RP_R_RPMODE__T_RPM_RP
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_RPM_RPPOLICYCUSTOMER') and o.name = 'FK_T_RPM_RP_R_RPM_POL_T_RPM_RP')
alter table T_RPM_RPPOLICYCUSTOMER
drop constraint FK_T_RPM_RP_R_RPM_POL_T_RPM_RP
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_RPM_RPPOLICYENTRY') and o.name = 'FK_T_RPM_RP_R_RPM_POL_T_RPM_RP')
alter table T_RPM_RPPOLICYENTRY
drop constraint FK_T_RPM_RP_R_RPM_POL_T_RPM_RP
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_RPM_RPPOLICYSALEORG') and o.name = 'FK_T_RPM_RP_R_RPM_POL_T_RPM_RP')
alter table T_RPM_RPPOLICYSALEORG
drop constraint FK_T_RPM_RP_R_RPM_POL_T_RPM_RP
go
if exists (select 1
from sysindexes
where id = object_id('T_RPM_RPPOLICY')
and name = 'IDX_RPM_RPPOLICY_NUM'
and indid > 0
and indid < 255)
drop index T_RPM_RPPOLICY.IDX_RPM_RPPOLICY_NUM
go
if exists (select 1
from sysindexes
where id = object_id('T_RPM_RPPOLICY')
and name = 'IDX_RPM_RPPOLICY_ORG'
and indid > 0
and indid < 255)
drop index T_RPM_RPPOLICY.IDX_RPM_RPPOLICY_ORG
go
if exists (select 1
from sysobjects
where id = object_id('T_RPM_RPPOLICY')
and type = 'U')
drop table T_RPM_RPPOLICY
go
/*==============================================================*/
/* Table: T_RPM_RPPOLICY */
/*==============================================================*/
create table T_RPM_RPPOLICY (
FID int not null default 0,
FBILLNO nvarchar(30) not null default '',
FDOCUMENTSTATUS char(1) not null default '',
FNAME nvarchar(80) not null default '',
FCOMPANYORGUNITID int not null default 0,
FCURRENCYID int not null default 0,
FCONTENT nvarchar(500) not null default '',
FRPMODEID int not null default 0,
FCUMULATATIONTYPE varchar(20) not null default '',
FCREATORID int not null default 0,
FCREATEDATE datetime null,
FMODIFIERID int not null default 0,
FMODIFYDATE datetime null,
FAPPROVERID int not null default 0,
FAPPROVEDATE datetime null,
FFORBIDERID int not null default 0,
FFORBIDDATE datetime null,
FFORBIDSTATUS char(1) not null default '',
FJUDGEMENTMODEL varchar(20) not null default '2',
constraint PK_RPM_RPPOLICY primary key (FID)
)
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'返利政策',
'user', @CurrentUser, 'table', 'T_RPM_RPPOLICY'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'Z:暂存 A: 创建 B:审核中 C:已审核 D:重新审核
',
'user', @CurrentUser, 'table', 'T_RPM_RPPOLICY', 'column', 'FDOCUMENTSTATUS'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'1:全额累进 2：超额累进',
'user', @CurrentUser, 'table', 'T_RPM_RPPOLICY', 'column', 'FCUMULATATIONTYPE'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'A:否 B：是',
'user', @CurrentUser, 'table', 'T_RPM_RPPOLICY', 'column', 'FFORBIDSTATUS'
go
/*==============================================================*/
/* Index: IDX_RPM_RPPOLICY_ORG */
/*==============================================================*/
create index IDX_RPM_RPPOLICY_ORG on T_RPM_RPPOLICY (
FCOMPANYORGUNITID ASC,
FDOCUMENTSTATUS ASC,
FFORBIDSTATUS ASC
)
go
/*==============================================================*/
/* Index: IDX_RPM_RPPOLICY_NUM */
/*==============================================================*/
create index IDX_RPM_RPPOLICY_NUM on T_RPM_RPPOLICY (
FBILLNO ASC
)
go
alter table T_RPM_RPPOLICY
add constraint FK_T_RPM_RP_R_RPMODE__T_RPM_RP foreign key (FRPMODEID)
references T_RPM_RPMODE (FRPMODEID)
go

### T_RPM_RPPOLICY(返利政策)：键值定义

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

### T_RPM_RPPOLICY(返利政策)：索引定义

名称 | 代码 | 唯一的 | 群集器 | 主要的 | 外键 | 候选键 | 表格
IDX_RPM_RPPOLICY_ORG | IDX_RPM_RPPOLICY_ORG | FALSE | FALSE | FALSE | FALSE | FALSE | T_RPM_RPPOLICY(返利政策)
IDX_RPM_RPPOLICY_NUM | IDX_RPM_RPPOLICY_NUM | FALSE | FALSE | FALSE | FALSE | FALSE | T_RPM_RPPOLICY(返利政策)

上一页

主页

下一页