USE [CallCenter_XinXiangXLX]
GO

IF  EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF__T_Wo_Work__F_IsU__44801EAD]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[T_Wo_WorkOrderItem_New] DROP CONSTRAINT [DF__T_Wo_Work__F_IsU__44801EAD]
END

GO

USE [CallCenter_XinXiangXLX]
GO

/****** Object:  Table [dbo].[T_Wo_WorkOrderItem_New]    Script Date: 06/11/2019 17:26:41 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[T_Wo_WorkOrderItem_New]') AND type in (N'U'))
DROP TABLE [dbo].[T_Wo_WorkOrderItem_New]
GO

USE [CallCenter_XinXiangXLX]
GO

/****** Object:  Table [dbo].[T_Wo_WorkOrderItem_New]    Script Date: 06/11/2019 17:26:41 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[T_Wo_WorkOrderItem_New](
	[F_ID] [bigint] IDENTITY(1,1) NOT NULL,
	[F_WoID] [bigint] NOT NULL,
	[F_WoState] [int] NULL,
	[F_ItemType] [int] NULL,
	[F_OptType] [int] NULL,
	[F_OptContent] [nvarchar](max) NULL,
	[F_NextUser] [varchar](50) NULL,
	[F_NextDept] [int] NULL,
	[F_IsUsed] [int] NULL,
	[F_LimitTime] [nvarchar](200) NULL,--时限	
	[F_IsSMS] [int] NULL,--是否短信提醒：下一级接收人
	[F_SMSToUser] [varchar](50) NULL,--短信提醒人
	[F_SMSToPhone] [varchar](50) NULL,--短信提醒电话
	[F_SMSContent] [ntext] NULL,--短信提醒内容
	[F_CreateUser] [varchar](50) NULL,
	[F_CreateTime] [datetime] NULL,
 CONSTRAINT [PK__T_Wo_WorkOrderItem_New] PRIMARY KEY CLUSTERED 
(
	[F_ID] 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

SET ANSI_PADDING OFF
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'工单记录ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Wo_WorkOrderItem_New', @level2type=N'COLUMN',@level2name=N'F_ID'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'工单ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Wo_WorkOrderItem_New', @level2type=N'COLUMN',@level2name=N'F_WoID'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'工单状态' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Wo_WorkOrderItem_New', @level2type=N'COLUMN',@level2name=N'F_WoState'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'记录类型 1工单处理，2工单催办' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Wo_WorkOrderItem_New', @level2type=N'COLUMN',@level2name=N'F_ItemType'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'操作类型' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Wo_WorkOrderItem_New', @level2type=N'COLUMN',@level2name=N'F_OptType'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'操作内容' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Wo_WorkOrderItem_New', @level2type=N'COLUMN',@level2name=N'F_OptContent'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'下一步操作人' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Wo_WorkOrderItem_New', @level2type=N'COLUMN',@level2name=N'F_NextUser'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'下一步操作部门' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Wo_WorkOrderItem_New', @level2type=N'COLUMN',@level2name=N'F_NextDept'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否在用，0是 1否' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Wo_WorkOrderItem_New', @level2type=N'COLUMN',@level2name=N'F_IsUsed'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'时限' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Wo_WorkOrderItem_New', @level2type=N'COLUMN',@level2name=N'F_LimitTime'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否短信提醒' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Wo_WorkOrderItem_New', @level2type=N'COLUMN',@level2name=N'F_IsSMS'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'短信提醒人' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Wo_WorkOrderItem_New', @level2type=N'COLUMN',@level2name=N'F_SMSToUser'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'短信提醒电话' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Wo_WorkOrderItem_New', @level2type=N'COLUMN',@level2name=N'F_SMSToPhone'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'短信提醒内容' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Wo_WorkOrderItem_New', @level2type=N'COLUMN',@level2name=N'F_SMSContent'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创建人' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Wo_WorkOrderItem_New', @level2type=N'COLUMN',@level2name=N'F_CreateUser'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创建时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Wo_WorkOrderItem_New', @level2type=N'COLUMN',@level2name=N'F_CreateTime'
GO

ALTER TABLE [dbo].[T_Wo_WorkOrderItem_New] ADD  DEFAULT ((0)) FOR [F_IsUsed]
GO


