SCO供应链协同

## 数据表：T_SPM_PROMOTIONPOLICY(促销政策)

### T_SPM_PROMOTIONPOLICY(促销政策)：描述

名称 | T_SPM_PROMOTIONPOLICY(促销政策)
代码 | T_SPM_PROMOTIONPOLICY
注释 | 促销政策
模型 | SCO供应链协同
主键 | PK_SPM_PROMOTIONPOLICY

### T_SPM_PROMOTIONPOLICY(促销政策)：列规格定义

名称 | 代码 | 数据类型 | 长度 | 强制 | 注释
主键ID | FID | int |  | TRUE |
编码 | FNUMBER | nvarchar(30) | 30 | TRUE |
名称 | FNAME | nvarchar(50) | 50 | TRUE |
单据状态 | FDOCUMENTSTATUS | char(1) | 1 | TRUE |
创建组织 | FCOMPANYORGUNITID | int |  | TRUE |
促销模式 | FPROMOTIONMODEID | int |  | TRUE |
赠送限制 | FPRESENTLIMIT | varchar(20) | 20 | TRUE |
判断模式 | FJUDGEMENTMODEL | varchar(20) | 20 | TRUE |
促销内容 | FCONTENT | nvarchar(255) | 255 | TRUE |
数量赠送限制 | FPRESENTQTY | decimal(23,10) | 23 | TRUE |
币别 | FCURRENCYID | int |  | TRUE |
来自促销申请 | FPROMOTIONAPPLY | int |  | TRUE |
创建人 | 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 |
促销折扣是否支持折上折 | FISDOUBLEDISCOUNT | char(1) | 1 | TRUE |
赠品促销使用累计数量促销 | FISUSESUMPROMOTION | char(1) | 1 | TRUE |
统计初始累计数量 | FISCOUNTINITDATA | char(1) | 1 | TRUE |

### T_SPM_PROMOTIONPOLICY(促销政策)：脚本代码

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_SPM_PROMOTIONCUSTOMER') and o.name = 'FK_T_SPM_PR_R_DRP_PRO_T_SPM_PR')
alter table T_SPM_PROMOTIONCUSTOMER
drop constraint FK_T_SPM_PR_R_DRP_PRO_T_SPM_PR
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_SPM_PROMOTIONPOLICY') and o.name = 'FK_T_SPM_PR_R_DRP_PRO_T_SPM_PR')
alter table T_SPM_PROMOTIONPOLICY
drop constraint FK_T_SPM_PR_R_DRP_PRO_T_SPM_PR
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_SPM_PROMOTIONPOLICYENTRY') and o.name = 'FK_T_SPM_PR_R_DRP_PRO_T_SPM_PR')
alter table T_SPM_PROMOTIONPOLICYENTRY
drop constraint FK_T_SPM_PR_R_DRP_PRO_T_SPM_PR
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_SPM_PROMOTIONPOLICYEXENTRY') and o.name = 'FK_T_SPM_PR_REFERENCE_T_SPM_PR')
alter table T_SPM_PROMOTIONPOLICYEXENTRY
drop constraint FK_T_SPM_PR_REFERENCE_T_SPM_PR
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_SPM_PROMOTIONSALEORG') and o.name = 'FK_T_SPM_PR_R_DRP_PRO_T_SPM_PR')
alter table T_SPM_PROMOTIONSALEORG
drop constraint FK_T_SPM_PR_R_DRP_PRO_T_SPM_PR
go
if exists (select 1
from sysindexes
where id = object_id('T_SPM_PROMOTIONPOLICY')
and name = 'IDX_SPM_PROMOTIONPOLICY_SFPCI'
and indid > 0
and indid < 255)
drop index T_SPM_PROMOTIONPOLICY.IDX_SPM_PROMOTIONPOLICY_SFPCI
go
if exists (select 1
from sysindexes
where id = object_id('T_SPM_PROMOTIONPOLICY')
and name = 'IDX_SPM_PROMOTIONPOLICY_NUM'
and indid > 0
and indid < 255)
drop index T_SPM_PROMOTIONPOLICY.IDX_SPM_PROMOTIONPOLICY_NUM
go
if exists (select 1
from sysobjects
where id = object_id('T_SPM_PROMOTIONPOLICY')
and type = 'U')
drop table T_SPM_PROMOTIONPOLICY
go
/*==============================================================*/
/* Table: T_SPM_PROMOTIONPOLICY */
/*==============================================================*/
create table T_SPM_PROMOTIONPOLICY (
FID int not null default 0,
FNUMBER nvarchar(30) not null default '',
FNAME nvarchar(50) not null default '',
FDOCUMENTSTATUS char(1) not null default '',
FCOMPANYORGUNITID int not null default 0,
FPROMOTIONMODEID int not null default 0,
FPRESENTLIMIT varchar(20) not null default '',
FJUDGEMENTMODEL varchar(20) not null default '',
FCONTENT nvarchar(255) not null default '',
FPRESENTQTY decimal(23,10) not null default 0.0,
FCURRENCYID int not null default 0,
FPROMOTIONAPPLY int not null default 0,
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 '',
FISDOUBLEDISCOUNT char(1) not null default '',
FISUSESUMPROMOTION char(1) not null default '',
FISCOUNTINITDATA char(1) not null default '',
constraint PK_SPM_PROMOTIONPOLICY primary key (FID)
)
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'促销政策',
'user', @CurrentUser, 'table', 'T_SPM_PROMOTIONPOLICY'
go
/*==============================================================*/
/* Index: IDX_SPM_PROMOTIONPOLICY_NUM */
/*==============================================================*/
create index IDX_SPM_PROMOTIONPOLICY_NUM on T_SPM_PROMOTIONPOLICY (
FNUMBER ASC
)
go
/*==============================================================*/
/* Index: IDX_SPM_PROMOTIONPOLICY_SFPCI */
/*==============================================================*/
create index IDX_SPM_PROMOTIONPOLICY_SFPCI on T_SPM_PROMOTIONPOLICY (
FPROMOTIONMODEID ASC,
FDOCUMENTSTATUS ASC,
FFORBIDSTATUS ASC,
FCURRENCYID ASC,
FID ASC
)
go
alter table T_SPM_PROMOTIONPOLICY
add constraint FK_T_SPM_PR_R_DRP_PRO_T_SPM_PR foreign key (FPROMOTIONMODEID)
references T_SPM_PROMOTIONMODE (FPROMOTIONMODEID)
go

### T_SPM_PROMOTIONPOLICY(促销政策)：键值定义

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

### T_SPM_PROMOTIONPOLICY(促销政策)：索引定义

名称 | 代码 | 唯一的 | 群集器 | 主要的 | 外键 | 候选键 | 表格
IDX_SPM_PROMOTIONPOLICY_NUM | IDX_SPM_PROMOTIONPOLICY_NUM | FALSE | FALSE | FALSE | FALSE | FALSE | T_SPM_PROMOTIONPOLICY(促销政策)
IDX_SPM_PROMOTIONPOLICY_SFPCI | IDX_SPM_PROMOTIONPOLICY_SFPCI | FALSE | FALSE | FALSE | FALSE | FALSE | T_SPM_PROMOTIONPOLICY(促销政策)

上一页

主页

下一页