ALTER TABLE [dbo].[CostGoods_Expense] ALTER COLUMN ExpenseCode nvarchar(50) NULL GO ALTER TABLE CostGoods_Expense ALTER COLUMN CompileMan NVARCHAR(50) NULL GO ALTER TABLE CostGoods_Expense ALTER COLUMN CheckMan NVARCHAR(50) NULL GO ALTER TABLE CostGoods_Expense ALTER COLUMN ApproveMan NVARCHAR(50) NULL GO ALTER TABLE CostGoods_ExpenseDetail add CostTypeName NVARCHAR(50) NULL GO ALTER TABLE CostGoods_ExpenseDetail add SortIndex int NULL GO ALTER TABLE CostGoods_ExpenseDetail add SupCostTypeId NVARCHAR(50) NULL GO ALTER TABLE CostGoods_ExpenseDetail add SupCostTypeName NVARCHAR(50) NULL GO ALTER TABLE CostGoods_ExpenseDetail add SupSortIndex int NULL GO ALTER TABLE CostGoods_ExpenseDetail alter column CostMoney decimal(18, 2) NULL GO CREATE TABLE [dbo].[Base_CostTypeItem]( [CostTypeItemId] [nvarchar](50) NOT NULL, [CostTypeId] [nvarchar](50) NULL, [SortIndex] [int] NULL, [CostTypeItemName] [nvarchar](50) NULL, [Remark] [nvarchar](500) NULL, CONSTRAINT [PK_Base_CostTypeItem] PRIMARY KEY CLUSTERED ( [CostTypeItemId] 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 ALTER TABLE [dbo].[Base_CostTypeItem] WITH CHECK ADD CONSTRAINT [FK_Base_CostTypeItem_Base_CostType] FOREIGN KEY([CostTypeId]) REFERENCES [dbo].[Base_CostType] ([CostTypeId]) GO ALTER TABLE [dbo].[Base_CostTypeItem] CHECK CONSTRAINT [FK_Base_CostTypeItem_Base_CostType] GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'主键ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_CostTypeItem', @level2type=N'COLUMN',@level2name=N'CostTypeItemId' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'费用类型id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_CostTypeItem', @level2type=N'COLUMN',@level2name=N'CostTypeId' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'序号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_CostTypeItem', @level2type=N'COLUMN',@level2name=N'SortIndex' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_CostTypeItem', @level2type=N'COLUMN',@level2name=N'CostTypeItemName' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'费用类型明细表' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_CostTypeItem' GO DELETE FROM Base_CostType GO ALTER TABLE Base_CostType ALTER COLUMN CostTypeCode INT NULL GO --插入费用类型数据 INSERT INTO [dbo].[Base_CostType]([CostTypeId],[CostTypeCode],[CostTypeName],[Remark]) VALUES('ca2dacae-ca5f-4104-aca1-3bd185b737b2',1,'安全施工','起重作业、动火作业、脚手架、试压与吹扫、拆除工程') GO INSERT INTO [dbo].[Base_CostTypeItem]([CostTypeItemId],[CostTypeId],[SortIndex],[CostTypeItemName]) VALUES('A1','ca2dacae-ca5f-4104-aca1-3bd185b737b2',1,'办公用品') GO INSERT INTO [dbo].[Base_CostTypeItem]([CostTypeItemId],[CostTypeId],[SortIndex],[CostTypeItemName]) VALUES('A2','ca2dacae-ca5f-4104-aca1-3bd185b737b2',2,'HSE培训') GO INSERT INTO [dbo].[Base_CostTypeItem]([CostTypeItemId],[CostTypeId],[SortIndex],[CostTypeItemName]) VALUES('A3','ca2dacae-ca5f-4104-aca1-3bd185b737b2',3,'警示标识') GO INSERT INTO [dbo].[Base_CostTypeItem]([CostTypeItemId],[CostTypeId],[SortIndex],[CostTypeItemName]) VALUES('A4','ca2dacae-ca5f-4104-aca1-3bd185b737b2',4,'检测器具') GO INSERT INTO [dbo].[Base_CostTypeItem]([CostTypeItemId],[CostTypeId],[SortIndex],[CostTypeItemName]) VALUES('A5','ca2dacae-ca5f-4104-aca1-3bd185b737b2',5,'安全奖励') GO INSERT INTO [dbo].[Base_CostTypeItem]([CostTypeItemId],[CostTypeId],[SortIndex],[CostTypeItemName]) VALUES('A6','ca2dacae-ca5f-4104-aca1-3bd185b737b2',6,'安全技术') GO INSERT INTO [dbo].[Base_CostTypeItem]([CostTypeItemId],[CostTypeId],[SortIndex],[CostTypeItemName]) VALUES('A7','ca2dacae-ca5f-4104-aca1-3bd185b737b2',7,'安全用电') GO INSERT INTO [dbo].[Base_CostTypeItem]([CostTypeItemId],[CostTypeId],[SortIndex],[CostTypeItemName]) VALUES('A8','ca2dacae-ca5f-4104-aca1-3bd185b737b2',8,'高处作业及临边孔洞') GO INSERT INTO [dbo].[Base_CostTypeItem]([CostTypeItemId],[CostTypeId],[SortIndex],[CostTypeItemName]) VALUES('A9','ca2dacae-ca5f-4104-aca1-3bd185b737b2',9,'气瓶防护') GO INSERT INTO [dbo].[Base_CostTypeItem]([CostTypeItemId],[CostTypeId],[SortIndex],[CostTypeItemName]) VALUES('A10','ca2dacae-ca5f-4104-aca1-3bd185b737b2',10,'脚手架(防护)') GO INSERT INTO [dbo].[Base_CostTypeItem]([CostTypeItemId],[CostTypeId],[SortIndex],[CostTypeItemName]) VALUES('A11','ca2dacae-ca5f-4104-aca1-3bd185b737b2',11,'木工防护棚') GO INSERT INTO [dbo].[Base_CostTypeItem]([CostTypeItemId],[CostTypeId],[SortIndex],[CostTypeItemName]) VALUES('A12','ca2dacae-ca5f-4104-aca1-3bd185b737b2',12,'钢筋加工防护棚') GO INSERT INTO [dbo].[Base_CostTypeItem]([CostTypeItemId],[CostTypeId],[SortIndex],[CostTypeItemName]) VALUES('A13','ca2dacae-ca5f-4104-aca1-3bd185b737b2',13,'受限空间') GO INSERT INTO [dbo].[Base_CostTypeItem]([CostTypeItemId],[CostTypeId],[SortIndex],[CostTypeItemName]) VALUES('A14','ca2dacae-ca5f-4104-aca1-3bd185b737b2',14,'机械设备') GO INSERT INTO [dbo].[Base_CostTypeItem]([CostTypeItemId],[CostTypeId],[SortIndex],[CostTypeItemName]) VALUES('A15','ca2dacae-ca5f-4104-aca1-3bd185b737b2',15,'喷砂作业') GO INSERT INTO [dbo].[Base_CostTypeItem]([CostTypeItemId],[CostTypeId],[SortIndex],[CostTypeItemName]) VALUES('A16','ca2dacae-ca5f-4104-aca1-3bd185b737b2',16,'消防') GO INSERT INTO [dbo].[Base_CostTypeItem]([CostTypeItemId],[CostTypeId],[SortIndex],[CostTypeItemName]) VALUES('A17','ca2dacae-ca5f-4104-aca1-3bd185b737b2',17,'应急') GO INSERT INTO [dbo].[Base_CostTypeItem]([CostTypeItemId],[CostTypeId],[SortIndex],[CostTypeItemName]) VALUES('A18','ca2dacae-ca5f-4104-aca1-3bd185b737b2',18,'化工试车') GO INSERT INTO [dbo].[Base_CostType]([CostTypeId],[CostTypeCode],[CostTypeName],[Remark]) VALUES('fa9e4e0c-8f0d-46c4-a659-682d4de1ca0f',2,'职业健康','健康保护') GO INSERT INTO [dbo].[Base_CostTypeItem]([CostTypeItemId],[CostTypeId],[SortIndex],[CostTypeItemName]) VALUES('B1','fa9e4e0c-8f0d-46c4-a659-682d4de1ca0f',1,'临时设施(饮水间、厕所、吸烟室等)') GO INSERT INTO [dbo].[Base_CostTypeItem]([CostTypeItemId],[CostTypeId],[SortIndex],[CostTypeItemName]) VALUES('B2','fa9e4e0c-8f0d-46c4-a659-682d4de1ca0f',2,'防护用品') GO INSERT INTO [dbo].[Base_CostTypeItem]([CostTypeItemId],[CostTypeId],[SortIndex],[CostTypeItemName]) VALUES('B3','fa9e4e0c-8f0d-46c4-a659-682d4de1ca0f',3,'体检费用') GO INSERT INTO [dbo].[Base_CostType]([CostTypeId],[CostTypeCode],[CostTypeName],[Remark]) VALUES('2c5b070a-ef8c-44f8-b35a-00316aed7d3a',3,'环境保护','噪音防护、污水废水排放、防尘降尘、危险物质控制、固体废弃物清理、辐射防护') GO INSERT INTO [dbo].[Base_CostTypeItem]([CostTypeItemId],[CostTypeId],[SortIndex],[CostTypeItemName]) VALUES('C1','2c5b070a-ef8c-44f8-b35a-00316aed7d3a',1,'噪声控制') GO INSERT INTO [dbo].[Base_CostTypeItem]([CostTypeItemId],[CostTypeId],[SortIndex],[CostTypeItemName]) VALUES('C2','2c5b070a-ef8c-44f8-b35a-00316aed7d3a',2,'扬尘控制') GO INSERT INTO [dbo].[Base_CostTypeItem]([CostTypeItemId],[CostTypeId],[SortIndex],[CostTypeItemName]) VALUES('C3','2c5b070a-ef8c-44f8-b35a-00316aed7d3a',3,'固体废弃物清理') GO INSERT INTO [dbo].[Base_CostTypeItem]([CostTypeItemId],[CostTypeId],[SortIndex],[CostTypeItemName]) VALUES('C4','2c5b070a-ef8c-44f8-b35a-00316aed7d3a',4,'污水处理') GO INSERT INTO [dbo].[Base_CostTypeItem]([CostTypeItemId],[CostTypeId],[SortIndex],[CostTypeItemName]) VALUES('C5','2c5b070a-ef8c-44f8-b35a-00316aed7d3a',5,'高危物质控制') GO INSERT INTO [dbo].[Base_CostTypeItem]([CostTypeItemId],[CostTypeId],[SortIndex],[CostTypeItemName]) VALUES('C6','2c5b070a-ef8c-44f8-b35a-00316aed7d3a',6,'防辐射') GO INSERT INTO [dbo].[Base_CostType]([CostTypeId],[CostTypeCode],[CostTypeName],[Remark]) VALUES('278e29bc-fa92-463a-88de-f481d41a69e0',4,'文明施工','现场围挡、五牌一图、企业标志、场容场貌、材料存放、不扰民措施、成品半成品保护') GO INSERT INTO [dbo].[Base_CostTypeItem]([CostTypeItemId],[CostTypeId],[SortIndex],[CostTypeItemName]) VALUES('D1','278e29bc-fa92-463a-88de-f481d41a69e0',1,'场容场貌') GO INSERT INTO [dbo].[Base_CostTypeItem]([CostTypeItemId],[CostTypeId],[SortIndex],[CostTypeItemName]) VALUES('D2','278e29bc-fa92-463a-88de-f481d41a69e0',2,'宣传标识') GO INSERT INTO [dbo].[Base_CostTypeItem]([CostTypeItemId],[CostTypeId],[SortIndex],[CostTypeItemName]) VALUES('D3','278e29bc-fa92-463a-88de-f481d41a69e0',3,'智慧化工地') GO ALTER TABLE [dbo].[CostGoods_Expense] ADD SortIndex int null GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'序号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'CostGoods_Expense', @level2type=N'COLUMN',@level2name=N'SortIndex' GO ALTER TABLE [dbo].[CostGoods_Expense] ADD Year int null GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'年度' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'CostGoods_Expense', @level2type=N'COLUMN',@level2name=N'Year' GO