
DROP TABLE [dbo].[OM_WorkOrder]
CREATE TABLE [dbo].[OM_WorkOrder] (
[PlantNr] int NOT NULL ,
[WorkOrderId] nvarchar(40) NOT NULL ,
[ArtId] nvarchar(40) NOT NULL ,
[CustArtId] nvarchar(40) NOT NULL ,
[RouteTemplateId] nvarchar(40) NOT NULL ,
[OrderType] nvarchar(20) NOT NULL ,
[OrderType1] nvarchar(20) NOT NULL ,
[OrderType2] nvarchar(20) NOT NULL ,
[OrderInfo] nvarchar(100) NOT NULL ,
[CustOrderId] nvarchar(40) NOT NULL ,
[ErpOrderId] nvarchar(40) NOT NULL ,
[ParentOrderId] nvarchar(40) NOT NULL ,
[Priority] int NOT NULL ,
[PlanResourceGroupId] nvarchar(40) NOT NULL ,
[PlanResourceId] nvarchar(40) NOT NULL ,
[UsedResourceId] nvarchar(40) NOT NULL ,
[PlanQty] float(53) NOT NULL ,
[QtyUomId] nvarchar(40) NOT NULL ,
[RatePerHourToggle] bit NOT NULL ,
[TimePerItemToggle] bit NOT NULL ,
[TimePerBatchToggle] bit NOT NULL ,
[BatchTimeFieldToggle] bit NOT NULL ,
[OpTimePerItem] float(53) NULL ,
[BatchTime] float(53) NULL ,
[QuantityPerHour] float(53) NOT NULL ,
[BatchQuantity] float(53) NOT NULL ,
[TimeUomId] nvarchar(40) NOT NULL ,
[BatchingMethod] int NOT NULL ,
[PlanStartDate] date NOT NULL ,
[PlanEndDate] date NOT NULL ,
[SetupStartTime] datetime NOT NULL ,
[SetupEndTime] datetime NOT NULL ,
[PlanStartTime] datetime NOT NULL ,
[PlanEndTime] datetime NOT NULL ,
[ActStartTime] datetime NOT NULL ,
[ActEndTime] datetime NOT NULL ,
[ProjectId] nvarchar(40) NOT NULL ,
[CustomerId] nvarchar(40) NOT NULL ,
[CustomerName] nvarchar(100) NOT NULL ,
[LastModify] datetime NOT NULL ,
[LastUser] nvarchar(20) NOT NULL ,
[CreateTime] datetime NOT NULL ,
[FixStartTimeToggle] bit NOT NULL 
)


IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'OM_WorkOrder', 
'COLUMN', N'ArtId')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'part_code'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'OM_WorkOrder'
, @level2type = 'COLUMN', @level2name = N'ArtId'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'part_code'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'OM_WorkOrder'
, @level2type = 'COLUMN', @level2name = N'ArtId'
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'OM_WorkOrder', 
'COLUMN', N'CustArtId')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'客户零件号'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'OM_WorkOrder'
, @level2type = 'COLUMN', @level2name = N'CustArtId'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'客户零件号'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'OM_WorkOrder'
, @level2type = 'COLUMN', @level2name = N'CustArtId'
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'OM_WorkOrder', 
'COLUMN', N'RouteTemplateId')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'工艺模板id routing '
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'OM_WorkOrder'
, @level2type = 'COLUMN', @level2name = N'RouteTemplateId'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'工艺模板id routing '
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'OM_WorkOrder'
, @level2type = 'COLUMN', @level2name = N'RouteTemplateId'
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'OM_WorkOrder', 
'COLUMN', N'OrderType')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'默认SEQ INT 内部 REO 反工'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'OM_WorkOrder'
, @level2type = 'COLUMN', @level2name = N'OrderType'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'默认SEQ INT 内部 REO 反工'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'OM_WorkOrder'
, @level2type = 'COLUMN', @level2name = N'OrderType'
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'OM_WorkOrder', 
'COLUMN', N'OrderType1')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'config'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'OM_WorkOrder'
, @level2type = 'COLUMN', @level2name = N'OrderType1'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'config'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'OM_WorkOrder'
, @level2type = 'COLUMN', @level2name = N'OrderType1'
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'OM_WorkOrder', 
'COLUMN', N'OrderInfo')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'barcode_desc 漏掉'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'OM_WorkOrder'
, @level2type = 'COLUMN', @level2name = N'OrderInfo'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'barcode_desc 漏掉'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'OM_WorkOrder'
, @level2type = 'COLUMN', @level2name = N'OrderInfo'
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'OM_WorkOrder', 
'COLUMN', N'Priority')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'默认0'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'OM_WorkOrder'
, @level2type = 'COLUMN', @level2name = N'Priority'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'默认0'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'OM_WorkOrder'
, @level2type = 'COLUMN', @level2name = N'Priority'
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'OM_WorkOrder', 
'COLUMN', N'PlanResourceId')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'产线id'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'OM_WorkOrder'
, @level2type = 'COLUMN', @level2name = N'PlanResourceId'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'产线id'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'OM_WorkOrder'
, @level2type = 'COLUMN', @level2name = N'PlanResourceId'
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'OM_WorkOrder', 
'COLUMN', N'UsedResourceId')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'实际使用产线id'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'OM_WorkOrder'
, @level2type = 'COLUMN', @level2name = N'UsedResourceId'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'实际使用产线id'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'OM_WorkOrder'
, @level2type = 'COLUMN', @level2name = N'UsedResourceId'
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'OM_WorkOrder', 
'COLUMN', N'PlanQty')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'计划数量'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'OM_WorkOrder'
, @level2type = 'COLUMN', @level2name = N'PlanQty'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'计划数量'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'OM_WorkOrder'
, @level2type = 'COLUMN', @level2name = N'PlanQty'
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'OM_WorkOrder', 
'COLUMN', N'QtyUomId')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'数量单位 uom表对应'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'OM_WorkOrder'
, @level2type = 'COLUMN', @level2name = N'QtyUomId'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'数量单位 uom表对应'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'OM_WorkOrder'
, @level2type = 'COLUMN', @level2name = N'QtyUomId'
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'OM_WorkOrder', 
'COLUMN', N'RatePerHourToggle')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'计算工时方式 jph  开'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'OM_WorkOrder'
, @level2type = 'COLUMN', @level2name = N'RatePerHourToggle'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'计算工时方式 jph  开'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'OM_WorkOrder'
, @level2type = 'COLUMN', @level2name = N'RatePerHourToggle'
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'OM_WorkOrder', 
'COLUMN', N'TimePerItemToggle')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'单件工时定义 '
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'OM_WorkOrder'
, @level2type = 'COLUMN', @level2name = N'TimePerItemToggle'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'单件工时定义 '
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'OM_WorkOrder'
, @level2type = 'COLUMN', @level2name = N'TimePerItemToggle'
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'OM_WorkOrder', 
'COLUMN', N'TimePerBatchToggle')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'批次工时定义'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'OM_WorkOrder'
, @level2type = 'COLUMN', @level2name = N'TimePerBatchToggle'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'批次工时定义'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'OM_WorkOrder'
, @level2type = 'COLUMN', @level2name = N'TimePerBatchToggle'
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'OM_WorkOrder', 
'COLUMN', N'PlanStartDate')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'plan_dttm'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'OM_WorkOrder'
, @level2type = 'COLUMN', @level2name = N'PlanStartDate'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'plan_dttm'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'OM_WorkOrder'
, @level2type = 'COLUMN', @level2name = N'PlanStartDate'
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'OM_WorkOrder', 
'COLUMN', N'PlanEndDate')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'plan_dttm'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'OM_WorkOrder'
, @level2type = 'COLUMN', @level2name = N'PlanEndDate'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'plan_dttm'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'OM_WorkOrder'
, @level2type = 'COLUMN', @level2name = N'PlanEndDate'
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'OM_WorkOrder', 
'COLUMN', N'PlanStartTime')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'0点'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'OM_WorkOrder'
, @level2type = 'COLUMN', @level2name = N'PlanStartTime'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'0点'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'OM_WorkOrder'
, @level2type = 'COLUMN', @level2name = N'PlanStartTime'
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'OM_WorkOrder', 
'COLUMN', N'PlanEndTime')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'23：59：59'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'OM_WorkOrder'
, @level2type = 'COLUMN', @level2name = N'PlanEndTime'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'23：59：59'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'OM_WorkOrder'
, @level2type = 'COLUMN', @level2name = N'PlanEndTime'
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'OM_WorkOrder', 
'COLUMN', N'ProjectId')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'车型 '
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'OM_WorkOrder'
, @level2type = 'COLUMN', @level2name = N'ProjectId'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'车型 '
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'OM_WorkOrder'
, @level2type = 'COLUMN', @level2name = N'ProjectId'


INSERT INTO [dbo].[OM_WorkOrder] ([PlantNr], [WorkOrderId], [ArtId], [CustArtId], [RouteTemplateId], [OrderType], [OrderType1], [OrderType2], [OrderInfo], [CustOrderId], [ErpOrderId], [ParentOrderId], [Priority], [PlanResourceGroupId], [PlanResourceId], [UsedResourceId], [PlanQty], [QtyUomId], [RatePerHourToggle], [TimePerItemToggle], [TimePerBatchToggle], [BatchTimeFieldToggle], [OpTimePerItem], [BatchTime], [QuantityPerHour], [BatchQuantity], [TimeUomId], [BatchingMethod], [PlanStartDate], [PlanEndDate], [SetupStartTime], [SetupEndTime], [PlanStartTime], [PlanEndTime], [ActStartTime], [ActEndTime], [ProjectId], [CustomerId], [CustomerName], [LastModify], [LastUser], [CreateTime], [FixStartTimeToggle]) VALUES (N'100', N'WO-00000543', N'6340003CAD0300YM2', N'', N'', N'SEQ', N'6343', N'', N'三排左座椅总成（深色）', N'', N'', N'', N'0', N'', N'RB', N'RB', N'16', N'件', N'1', N'0', N'0', N'0', N'0', N'0', N'20', N'0', N'', N'0', N'2021-04-14', N'2021-04-14', N'1900-01-01 00:00:00.000', N'1900-01-01 00:00:00.000', N'2021-04-14 00:00:00.000', N'2021-04-14 23:59:59.000', N'2021-04-14 00:00:00.000', N'2021-04-14 01:00:00.000', N'G-FRAME', N'', N'', N'2021-05-06 17:19:16.000', N'crontab', N'2021-05-06 17:19:16.000', N'0')
INSERT INTO [dbo].[OM_WorkOrder] ([PlantNr], [WorkOrderId], [ArtId], [CustArtId], [RouteTemplateId], [OrderType], [OrderType1], [OrderType2], [OrderInfo], [CustOrderId], [ErpOrderId], [ParentOrderId], [Priority], [PlanResourceGroupId], [PlanResourceId], [UsedResourceId], [PlanQty], [QtyUomId], [RatePerHourToggle], [TimePerItemToggle], [TimePerBatchToggle], [BatchTimeFieldToggle], [OpTimePerItem], [BatchTime], [QuantityPerHour], [BatchQuantity], [TimeUomId], [BatchingMethod], [PlanStartDate], [PlanEndDate], [SetupStartTime], [SetupEndTime], [PlanStartTime], [PlanEndTime], [ActStartTime], [ActEndTime], [ProjectId], [CustomerId], [CustomerName], [LastModify], [LastUser], [CreateTime], [FixStartTimeToggle]) VALUES (N'100', N'WO-00000544', N'6340004CAD0300YM2', N'', N'', N'SEQ', N'6344', N'', N'A30-I中东版三排右座椅_高顶配启停（素雅黑）', N'', N'', N'', N'0', N'', N'RB', N'RB', N'20', N'件', N'1', N'0', N'0', N'0', N'0', N'0', N'20', N'0', N'', N'0', N'2021-04-14', N'2021-04-14', N'1900-01-01 00:00:00.000', N'1900-01-01 00:00:00.000', N'2021-04-14 00:00:00.000', N'2021-04-14 23:59:59.000', N'2021-04-14 00:00:00.000', N'2021-04-14 01:00:00.000', N'G-FRAME', N'', N'', N'2021-05-06 17:19:18.000', N'crontab', N'2021-05-06 17:19:18.000', N'0')
INSERT INTO [dbo].[OM_WorkOrder] ([PlantNr], [WorkOrderId], [ArtId], [CustArtId], [RouteTemplateId], [OrderType], [OrderType1], [OrderType2], [OrderInfo], [CustOrderId], [ErpOrderId], [ParentOrderId], [Priority], [PlanResourceGroupId], [PlanResourceId], [UsedResourceId], [PlanQty], [QtyUomId], [RatePerHourToggle], [TimePerItemToggle], [TimePerBatchToggle], [BatchTimeFieldToggle], [OpTimePerItem], [BatchTime], [QuantityPerHour], [BatchQuantity], [TimeUomId], [BatchingMethod], [PlanStartDate], [PlanEndDate], [SetupStartTime], [SetupEndTime], [PlanStartTime], [PlanEndTime], [ActStartTime], [ActEndTime], [ProjectId], [CustomerId], [CustomerName], [LastModify], [LastUser], [CreateTime], [FixStartTimeToggle]) VALUES (N'100', N'WO-00000545', N'6310003CAD1001YM2', N'', N'', N'SEQ', N'631', N'', N'前排主驾总成（深色次顶配）', N'', N'', N'', N'0', N'', N'RB', N'RB', N'1', N'件', N'1', N'0', N'0', N'0', N'0', N'0', N'20', N'0', N'', N'0', N'2021-04-14', N'2021-04-14', N'1900-01-01 00:00:00.000', N'1900-01-01 00:00:00.000', N'2021-04-14 00:00:00.000', N'2021-04-14 23:59:59.000', N'2021-04-14 00:00:00.000', N'2021-04-14 01:00:00.000', N'G-FRAME', N'', N'', N'2021-05-06 17:19:19.000', N'crontab', N'2021-05-06 17:19:19.000', N'0')
INSERT INTO [dbo].[OM_WorkOrder] ([PlantNr], [WorkOrderId], [ArtId], [CustArtId], [RouteTemplateId], [OrderType], [OrderType1], [OrderType2], [OrderInfo], [CustOrderId], [ErpOrderId], [ParentOrderId], [Priority], [PlanResourceGroupId], [PlanResourceId], [UsedResourceId], [PlanQty], [QtyUomId], [RatePerHourToggle], [TimePerItemToggle], [TimePerBatchToggle], [BatchTimeFieldToggle], [OpTimePerItem], [BatchTime], [QuantityPerHour], [BatchQuantity], [TimeUomId], [BatchingMethod], [PlanStartDate], [PlanEndDate], [SetupStartTime], [SetupEndTime], [PlanStartTime], [PlanEndTime], [ActStartTime], [ActEndTime], [ProjectId], [CustomerId], [CustomerName], [LastModify], [LastUser], [CreateTime], [FixStartTimeToggle]) VALUES (N'100', N'WO-00000546', N'6310003CAD1101YM2', N'', N'', N'SEQ', N'631', N'', N'前排主驾总成（深色高配）', N'', N'', N'', N'0', N'', N'RB', N'RB', N'14', N'件', N'1', N'0', N'0', N'0', N'0', N'0', N'20', N'0', N'', N'0', N'2021-04-14', N'2021-04-14', N'1900-01-01 00:00:00.000', N'1900-01-01 00:00:00.000', N'2021-04-14 00:00:00.000', N'2021-04-14 23:59:59.000', N'2021-04-14 00:00:00.000', N'2021-04-14 01:00:00.000', N'G-FRAME', N'', N'', N'2021-05-06 17:19:19.000', N'crontab', N'2021-05-06 17:19:19.000', N'0')
INSERT INTO [dbo].[OM_WorkOrder] ([PlantNr], [WorkOrderId], [ArtId], [CustArtId], [RouteTemplateId], [OrderType], [OrderType1], [OrderType2], [OrderInfo], [CustOrderId], [ErpOrderId], [ParentOrderId], [Priority], [PlanResourceGroupId], [PlanResourceId], [UsedResourceId], [PlanQty], [QtyUomId], [RatePerHourToggle], [TimePerItemToggle], [TimePerBatchToggle], [BatchTimeFieldToggle], [OpTimePerItem], [BatchTime], [QuantityPerHour], [BatchQuantity], [TimeUomId], [BatchingMethod], [PlanStartDate], [PlanEndDate], [SetupStartTime], [SetupEndTime], [PlanStartTime], [PlanEndTime], [ActStartTime], [ActEndTime], [ProjectId], [CustomerId], [CustomerName], [LastModify], [LastUser], [CreateTime], [FixStartTimeToggle]) VALUES (N'100', N'WO-00000547', N'6320003CAD1101YM2', N'', N'', N'SEQ', N'632', N'', N'前排副驾总成（深色高配）', N'', N'', N'', N'0', N'', N'RB', N'RB', N'13', N'件', N'1', N'0', N'0', N'0', N'0', N'0', N'20', N'0', N'', N'0', N'2021-04-14', N'2021-04-14', N'1900-01-01 00:00:00.000', N'1900-01-01 00:00:00.000', N'2021-04-14 00:00:00.000', N'2021-04-14 23:59:59.000', N'2021-04-14 00:00:00.000', N'2021-04-14 01:00:00.000', N'G-FRAME', N'', N'', N'2021-05-06 17:19:20.000', N'crontab', N'2021-05-06 17:19:20.000', N'0')
INSERT INTO [dbo].[OM_WorkOrder] ([PlantNr], [WorkOrderId], [ArtId], [CustArtId], [RouteTemplateId], [OrderType], [OrderType1], [OrderType2], [OrderInfo], [CustOrderId], [ErpOrderId], [ParentOrderId], [Priority], [PlanResourceGroupId], [PlanResourceId], [UsedResourceId], [PlanQty], [QtyUomId], [RatePerHourToggle], [TimePerItemToggle], [TimePerBatchToggle], [BatchTimeFieldToggle], [OpTimePerItem], [BatchTime], [QuantityPerHour], [BatchQuantity], [TimeUomId], [BatchingMethod], [PlanStartDate], [PlanEndDate], [SetupStartTime], [SetupEndTime], [PlanStartTime], [PlanEndTime], [ActStartTime], [ActEndTime], [ProjectId], [CustomerId], [CustomerName], [LastModify], [LastUser], [CreateTime], [FixStartTimeToggle]) VALUES (N'100', N'WO-00000548', N'6330093CAD0701YM2', N'', N'', N'SEQ', N'6333', N'', N'A30-I中东版二排左座椅_高顶配启停（素雅黑）', N'', N'', N'', N'0', N'', N'RB', N'RB', N'19', N'件', N'1', N'0', N'0', N'0', N'0', N'0', N'20', N'0', N'', N'0', N'2021-04-14', N'2021-04-14', N'1900-01-01 00:00:00.000', N'1900-01-01 00:00:00.000', N'2021-04-14 00:00:00.000', N'2021-04-14 23:59:59.000', N'2021-04-14 00:00:00.000', N'2021-04-14 01:00:00.000', N'G-FRAME', N'', N'', N'2021-05-06 17:19:21.000', N'crontab', N'2021-05-06 17:19:21.000', N'0')
INSERT INTO [dbo].[OM_WorkOrder] ([PlantNr], [WorkOrderId], [ArtId], [CustArtId], [RouteTemplateId], [OrderType], [OrderType1], [OrderType2], [OrderInfo], [CustOrderId], [ErpOrderId], [ParentOrderId], [Priority], [PlanResourceGroupId], [PlanResourceId], [UsedResourceId], [PlanQty], [QtyUomId], [RatePerHourToggle], [TimePerItemToggle], [TimePerBatchToggle], [BatchTimeFieldToggle], [OpTimePerItem], [BatchTime], [QuantityPerHour], [BatchQuantity], [TimeUomId], [BatchingMethod], [PlanStartDate], [PlanEndDate], [SetupStartTime], [SetupEndTime], [PlanStartTime], [PlanEndTime], [ActStartTime], [ActEndTime], [ProjectId], [CustomerId], [CustomerName], [LastModify], [LastUser], [CreateTime], [FixStartTimeToggle]) VALUES (N'100', N'WO-00000549', N'6330094CAD0701YM2', N'', N'', N'SEQ', N'6334', N'', N'A30-I中东版二排右座椅_高顶配启停（素雅黑）', N'', N'', N'', N'0', N'', N'RB', N'RB', N'17', N'件', N'1', N'0', N'0', N'0', N'0', N'0', N'20', N'0', N'', N'0', N'2021-04-14', N'2021-04-14', N'1900-01-01 00:00:00.000', N'1900-01-01 00:00:00.000', N'2021-04-14 00:00:00.000', N'2021-04-14 23:59:59.000', N'2021-04-14 00:00:00.000', N'2021-04-14 01:00:00.000', N'G-FRAME', N'', N'', N'2021-05-06 17:19:22.000', N'crontab', N'2021-05-06 17:19:22.000', N'0')
INSERT INTO [dbo].[OM_WorkOrder] ([PlantNr], [WorkOrderId], [ArtId], [CustArtId], [RouteTemplateId], [OrderType], [OrderType1], [OrderType2], [OrderInfo], [CustOrderId], [ErpOrderId], [ParentOrderId], [Priority], [PlanResourceGroupId], [PlanResourceId], [UsedResourceId], [PlanQty], [QtyUomId], [RatePerHourToggle], [TimePerItemToggle], [TimePerBatchToggle], [BatchTimeFieldToggle], [OpTimePerItem], [BatchTime], [QuantityPerHour], [BatchQuantity], [TimeUomId], [BatchingMethod], [PlanStartDate], [PlanEndDate], [SetupStartTime], [SetupEndTime], [PlanStartTime], [PlanEndTime], [ActStartTime], [ActEndTime], [ProjectId], [CustomerId], [CustomerName], [LastModify], [LastUser], [CreateTime], [FixStartTimeToggle]) VALUES (N'100', N'WO-00000550', N'6330025CAD0501RH2', N'', N'', N'SEQ', N'6344', N'', N'A5K后排高/顶配40%靠背总成（银灰色）', N'', N'', N'', N'0', N'', N'RB', N'RB', N'1', N'件', N'1', N'0', N'0', N'0', N'0', N'0', N'20', N'0', N'', N'0', N'2021-04-14', N'2021-04-14', N'1900-01-01 00:00:00.000', N'1900-01-01 00:00:00.000', N'2021-04-14 00:00:00.000', N'2021-04-14 23:59:59.000', N'2021-04-14 00:00:00.000', N'2021-04-14 01:00:00.000', N'G-FRAME', N'', N'', N'2021-05-06 17:19:23.000', N'crontab', N'2021-05-06 17:19:23.000', N'0')
INSERT INTO [dbo].[OM_WorkOrder] ([PlantNr], [WorkOrderId], [ArtId], [CustArtId], [RouteTemplateId], [OrderType], [OrderType1], [OrderType2], [OrderInfo], [CustOrderId], [ErpOrderId], [ParentOrderId], [Priority], [PlanResourceGroupId], [PlanResourceId], [UsedResourceId], [PlanQty], [QtyUomId], [RatePerHourToggle], [TimePerItemToggle], [TimePerBatchToggle], [BatchTimeFieldToggle], [OpTimePerItem], [BatchTime], [QuantityPerHour], [BatchQuantity], [TimeUomId], [BatchingMethod], [PlanStartDate], [PlanEndDate], [SetupStartTime], [SetupEndTime], [PlanStartTime], [PlanEndTime], [ActStartTime], [ActEndTime], [ProjectId], [CustomerId], [CustomerName], [LastModify], [LastUser], [CreateTime], [FixStartTimeToggle]) VALUES (N'100', N'WO-00000551', N'6310003AMV1100TX2-N', N'', N'', N'SEQ', N'631', N'', N'AM8 前排尊享/尊贵主驾(深海蓝)', N'', N'', N'', N'0', N'', N'RB', N'RB', N'3', N'件', N'1', N'0', N'0', N'0', N'0', N'0', N'20', N'0', N'', N'0', N'2021-04-14', N'2021-04-14', N'1900-01-01 00:00:00.000', N'1900-01-01 00:00:00.000', N'2021-04-14 00:00:00.000', N'2021-04-14 23:59:59.000', N'2021-04-14 00:00:00.000', N'2021-04-14 01:00:00.000', N'G-FRAME', N'', N'', N'2021-05-06 17:19:23.000', N'crontab', N'2021-05-06 17:19:23.000', N'0')
INSERT INTO [dbo].[OM_WorkOrder] ([PlantNr], [WorkOrderId], [ArtId], [CustArtId], [RouteTemplateId], [OrderType], [OrderType1], [OrderType2], [OrderInfo], [CustOrderId], [ErpOrderId], [ParentOrderId], [Priority], [PlanResourceGroupId], [PlanResourceId], [UsedResourceId], [PlanQty], [QtyUomId], [RatePerHourToggle], [TimePerItemToggle], [TimePerBatchToggle], [BatchTimeFieldToggle], [OpTimePerItem], [BatchTime], [QuantityPerHour], [BatchQuantity], [TimeUomId], [BatchingMethod], [PlanStartDate], [PlanEndDate], [SetupStartTime], [SetupEndTime], [PlanStartTime], [PlanEndTime], [ActStartTime], [ActEndTime], [ProjectId], [CustomerId], [CustomerName], [LastModify], [LastUser], [CreateTime], [FixStartTimeToggle]) VALUES (N'100', N'WO-00000552', N'6310003AMV1100TX3-N', N'', N'', N'SEQ', N'631', N'', N'AM8 前排尊享/尊贵主驾(灰米色)', N'', N'', N'', N'0', N'', N'RB', N'RB', N'15', N'件', N'1', N'0', N'0', N'0', N'0', N'0', N'20', N'0', N'', N'0', N'2021-04-14', N'2021-04-14', N'1900-01-01 00:00:00.000', N'1900-01-01 00:00:00.000', N'2021-04-14 00:00:00.000', N'2021-04-14 23:59:59.000', N'2021-04-14 00:00:00.000', N'2021-04-14 01:00:00.000', N'G-FRAME', N'', N'', N'2021-05-06 17:19:24.000', N'crontab', N'2021-05-06 17:19:24.000', N'0')
INSERT INTO [dbo].[OM_WorkOrder] ([PlantNr], [WorkOrderId], [ArtId], [CustArtId], [RouteTemplateId], [OrderType], [OrderType1], [OrderType2], [OrderInfo], [CustOrderId], [ErpOrderId], [ParentOrderId], [Priority], [PlanResourceGroupId], [PlanResourceId], [UsedResourceId], [PlanQty], [QtyUomId], [RatePerHourToggle], [TimePerItemToggle], [TimePerBatchToggle], [BatchTimeFieldToggle], [OpTimePerItem], [BatchTime], [QuantityPerHour], [BatchQuantity], [TimeUomId], [BatchingMethod], [PlanStartDate], [PlanEndDate], [SetupStartTime], [SetupEndTime], [PlanStartTime], [PlanEndTime], [ActStartTime], [ActEndTime], [ProjectId], [CustomerId], [CustomerName], [LastModify], [LastUser], [CreateTime], [FixStartTimeToggle]) VALUES (N'100', N'WO-00000553', N'6320003AMV1100TX2-N', N'', N'', N'SEQ', N'632', N'', N'AM8 前排尊享/尊贵副驾(深海蓝)', N'', N'', N'', N'0', N'', N'RB', N'RB', N'1', N'件', N'1', N'0', N'0', N'0', N'0', N'0', N'20', N'0', N'', N'0', N'2021-04-14', N'2021-04-14', N'1900-01-01 00:00:00.000', N'1900-01-01 00:00:00.000', N'2021-04-14 00:00:00.000', N'2021-04-14 23:59:59.000', N'2021-04-14 00:00:00.000', N'2021-04-14 01:00:00.000', N'G-FRAME', N'', N'', N'2021-05-06 17:19:25.000', N'crontab', N'2021-05-06 17:19:25.000', N'0')
INSERT INTO [dbo].[OM_WorkOrder] ([PlantNr], [WorkOrderId], [ArtId], [CustArtId], [RouteTemplateId], [OrderType], [OrderType1], [OrderType2], [OrderInfo], [CustOrderId], [ErpOrderId], [ParentOrderId], [Priority], [PlanResourceGroupId], [PlanResourceId], [UsedResourceId], [PlanQty], [QtyUomId], [RatePerHourToggle], [TimePerItemToggle], [TimePerBatchToggle], [BatchTimeFieldToggle], [OpTimePerItem], [BatchTime], [QuantityPerHour], [BatchQuantity], [TimeUomId], [BatchingMethod], [PlanStartDate], [PlanEndDate], [SetupStartTime], [SetupEndTime], [PlanStartTime], [PlanEndTime], [ActStartTime], [ActEndTime], [ProjectId], [CustomerId], [CustomerName], [LastModify], [LastUser], [CreateTime], [FixStartTimeToggle]) VALUES (N'100', N'WO-00000554', N'6320003AMV1100TX3-N', N'', N'', N'SEQ', N'632', N'', N'AM8 前排尊享/尊贵副驾(灰米色)', N'', N'', N'', N'0', N'', N'RB', N'RB', N'15', N'件', N'1', N'0', N'0', N'0', N'0', N'0', N'20', N'0', N'', N'0', N'2021-04-14', N'2021-04-14', N'1900-01-01 00:00:00.000', N'1900-01-01 00:00:00.000', N'2021-04-14 00:00:00.000', N'2021-04-14 23:59:59.000', N'2021-04-14 00:00:00.000', N'2021-04-14 01:00:00.000', N'G-FRAME', N'', N'', N'2021-05-06 17:19:25.000', N'crontab', N'2021-05-06 17:19:25.000', N'0')
INSERT INTO [dbo].[OM_WorkOrder] ([PlantNr], [WorkOrderId], [ArtId], [CustArtId], [RouteTemplateId], [OrderType], [OrderType1], [OrderType2], [OrderInfo], [CustOrderId], [ErpOrderId], [ParentOrderId], [Priority], [PlanResourceGroupId], [PlanResourceId], [UsedResourceId], [PlanQty], [QtyUomId], [RatePerHourToggle], [TimePerItemToggle], [TimePerBatchToggle], [BatchTimeFieldToggle], [OpTimePerItem], [BatchTime], [QuantityPerHour], [BatchQuantity], [TimeUomId], [BatchingMethod], [PlanStartDate], [PlanEndDate], [SetupStartTime], [SetupEndTime], [PlanStartTime], [PlanEndTime], [ActStartTime], [ActEndTime], [ProjectId], [CustomerId], [CustomerName], [LastModify], [LastUser], [CreateTime], [FixStartTimeToggle]) VALUES (N'100', N'WO-00000555', N'6340003AMV0700TX3', N'', N'', N'SEQ', N'6343', N'', N'AM8三排60%真皮座椅(灰米色)', N'', N'', N'', N'0', N'', N'RB', N'RB', N'39', N'件', N'1', N'0', N'0', N'0', N'0', N'0', N'20', N'0', N'', N'0', N'2021-04-14', N'2021-04-14', N'1900-01-01 00:00:00.000', N'1900-01-01 00:00:00.000', N'2021-04-14 00:00:00.000', N'2021-04-14 23:59:59.000', N'2021-04-14 00:00:00.000', N'2021-04-14 01:00:00.000', N'G-FRAME', N'', N'', N'2021-05-06 17:19:26.000', N'crontab', N'2021-05-06 17:19:26.000', N'0')
INSERT INTO [dbo].[OM_WorkOrder] ([PlantNr], [WorkOrderId], [ArtId], [CustArtId], [RouteTemplateId], [OrderType], [OrderType1], [OrderType2], [OrderInfo], [CustOrderId], [ErpOrderId], [ParentOrderId], [Priority], [PlanResourceGroupId], [PlanResourceId], [UsedResourceId], [PlanQty], [QtyUomId], [RatePerHourToggle], [TimePerItemToggle], [TimePerBatchToggle], [BatchTimeFieldToggle], [OpTimePerItem], [BatchTime], [QuantityPerHour], [BatchQuantity], [TimeUomId], [BatchingMethod], [PlanStartDate], [PlanEndDate], [SetupStartTime], [SetupEndTime], [PlanStartTime], [PlanEndTime], [ActStartTime], [ActEndTime], [ProjectId], [CustomerId], [CustomerName], [LastModify], [LastUser], [CreateTime], [FixStartTimeToggle]) VALUES (N'100', N'WO-00000556', N'6340003AMV0700TX2', N'', N'', N'SEQ', N'6343', N'', N'AM8三排60%真皮座椅(深海蓝)', N'', N'', N'', N'0', N'', N'RB', N'RB', N'44', N'件', N'1', N'0', N'0', N'0', N'0', N'0', N'20', N'0', N'', N'0', N'2021-04-14', N'2021-04-14', N'1900-01-01 00:00:00.000', N'1900-01-01 00:00:00.000', N'2021-04-14 00:00:00.000', N'2021-04-14 23:59:59.000', N'2021-04-14 00:00:00.000', N'2021-04-14 01:00:00.000', N'G-FRAME', N'', N'', N'2021-05-06 17:19:28.000', N'crontab', N'2021-05-06 17:19:28.000', N'0')


ALTER TABLE [dbo].[OM_WorkOrder] ADD PRIMARY KEY ([PlantNr], [WorkOrderId])
