

-- 总包单位接口地址
alter table Base_Project add SubjectUnitApiUrl nvarchar(100) COLLATE Chinese_PRC_CI_AS  NULL;
-- 总包单位服务地址
alter table Base_Project add SubjectUnitWebUrl nvarchar(100) COLLATE Chinese_PRC_CI_AS  NULL;
go


奖罚管理菜单放在【HSE奖惩】里面

--select*from Sys_Menu WHERE MenuId='HSE288C955A-E379-4F24-85F9-585343B33D46'
--select*from Sys_Menu WHERE MenuName='HSE奖惩'
IF NOT EXISTS (SELECT * FROM Sys_Menu WHERE MenuId = '288C955A-E379-4F24-85F9-585343B33D46' and MenuType = 'Menu_HSSE')
BEGIN
INSERT INTO [dbo].[Sys_Menu] ([MenuId], [MenuName], [Icon], [Url], [SortIndex], [SuperMenu], [MenuType], [IsOffice], [IsEnd], [IsUsed]) 
VALUES (N'288C955A-E379-4F24-85F9-585343B33D46', N'奖罚管理', NULL, N'CQMS/Check/RewardAndPunish.aspx', 1, N'012DF857-AD6B-49AA-87A8-030CD5F66D4C', N'Menu_HSSE', '0', '1', '1');
END
GO


--奖罚类别定义
INSERT INTO [dbo].[Sys_Menu] ([MenuId], [MenuName], [Icon], [Url], [SortIndex], [SuperMenu], [MenuType], [IsOffice], [IsEnd], [IsUsed]) 
VALUES (N'621A9295-DD82-425A-863D-310AD319752B', N'奖罚类别定义', NULL, N'BaseInfo/RewardAndPunishManager.aspx', 180, N'5196A6FD-4BF1-46B3-8D24-9A3CE5BB4760', N'Menu_SysSet', '0', '1', '1');



--奖罚管理
IF NOT EXISTS (SELECT * FROM Sys_ButtonToMenu WHERE MenuId = '288C955A-E379-4F24-85F9-585343B33D46')
BEGIN
INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex]) 
VALUES (N'5133D10A-D667-4FFC-B3D5-83200770F573', N'288C955A-E379-4F24-85F9-585343B33D46', N'增加', 1);
INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex]) 
VALUES (N'146A757C-94C1-4EB5-B47C-A59CB431578A', N'288C955A-E379-4F24-85F9-585343B33D46', N'修改', 2);
INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex]) 
VALUES (N'F0D8E2D1-0C54-4BDE-A6CB-29BD83B326F3', N'288C955A-E379-4F24-85F9-585343B33D46', N'删除', 3);
INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex]) 
VALUES (N'23BDF246-F51F-41DF-8E99-FD55971AD759', N'288C955A-E379-4F24-85F9-585343B33D46', N'保存', 4);
END
GO

--IF NOT EXISTS (SELECT * FROM Sys_Menu WHERE MenuId = '34F2B327-4146-403F-9E4B-98D58EAA2C93' and MenuType = 'Menu_System_Hsse_P_Hsse')
--BEGIN
--INSERT INTO [dbo].[Sys_Menu] ([MenuId], [MenuName], [Icon], [Url], [SortIndex], [SuperMenu], [MenuType], [IsOffice], [IsEnd], [IsUsed]) VALUES (N'34F2B327-4146-403F-9E4B-98D58EAA2C93', N'奖罚管理', NULL, N'CQMS/Check/RewardAndPunish.aspx?type=1', 1, N'ED638B26-C462-4971-ACC8-BF6BA9668FB2', N'Menu_System_Hsse_S_Hsse', '0', '1', '1');
--UPDATE [dbo].[Sys_Menu] SET [MenuName] = N'奖罚管理',[Url] = N'CQMS/Check/RewardAndPunish.aspx?type=2' WHERE [MenuId] = N'34F2B327-4146-403F-9E4B-98D58EAA2C93'  AND [MenuType] = N'Menu_System_Qwms_P_Cqms';
--END
--GO




----删除质量月菜单
--delete Sys_Menu where MenuName ='质量月' and MenuType ='Menu_System_Hsse_P_Hsse'
--delete Sys_Menu where MenuName ='质量月' and MenuType ='Menu_System_Qwms_S_Cqms'
--go


--奖罚管理
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'Check_RewardAndPunish') AND type = N'U')
BEGIN

CREATE TABLE [dbo].[Check_RewardAndPunish](
	[RewardAndPunishID] [nvarchar](50) NOT NULL,
	[Type] [int] NULL,
	[ResponseUnit] [nvarchar](50) NULL,
	[Description] [nvarchar](500) NULL,
	[Money] [decimal](18, 0) NULL,
	[Date] [date] NULL,
	[CreateMan] [nvarchar](50) NULL,
	[ProjectId] [nvarchar](50) NULL,
	[NoticeUnit] [nvarchar](50) NULL,
	[RewardAndPunishType] [nvarchar](10) NULL,
	[RewardAndPunishCode] [nvarchar](100) NULL,
	[RewardAndPunishMan] [nvarchar](50) NULL,
	[TeamGroupId] [nvarchar](50) NULL,
	[Remark] [nvarchar](2000) NULL,
	[DataSource] [char](1) NULL,
	[HazardRegisterId] [nvarchar](50) NULL,
	[SysTemType] [char](1) NULL,
 CONSTRAINT [PK_RewardAndPunish] PRIMARY KEY CLUSTERED 
(
	[RewardAndPunishID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'奖励还是处罚' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Check_RewardAndPunish', @level2type=N'COLUMN',@level2name=N'Type'
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'责任单位' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Check_RewardAndPunish', @level2type=N'COLUMN',@level2name=N'ResponseUnit'
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'描述' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Check_RewardAndPunish', @level2type=N'COLUMN',@level2name=N'Description'
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'金额' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Check_RewardAndPunish', @level2type=N'COLUMN',@level2name=N'Money'
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'日期' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Check_RewardAndPunish', @level2type=N'COLUMN',@level2name=N'Date'
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创建人' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Check_RewardAndPunish', @level2type=N'COLUMN',@level2name=N'CreateMan'
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'处罚/奖励单位' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Check_RewardAndPunish', @level2type=N'COLUMN',@level2name=N'NoticeUnit'
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'奖惩类型' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Check_RewardAndPunish', @level2type=N'COLUMN',@level2name=N'RewardAndPunishType'
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'奖惩编号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Check_RewardAndPunish', @level2type=N'COLUMN',@level2name=N'RewardAndPunishCode'
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'奖惩人id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Check_RewardAndPunish', @level2type=N'COLUMN',@level2name=N'RewardAndPunishMan'
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'所属班组id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Check_RewardAndPunish', @level2type=N'COLUMN',@level2name=N'TeamGroupId'
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'备注' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Check_RewardAndPunish', @level2type=N'COLUMN',@level2name=N'Remark'
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'数据来源(1巡检,0页面新增)' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Check_RewardAndPunish', @level2type=N'COLUMN',@level2name=N'DataSource'
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'巡检id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Check_RewardAndPunish', @level2type=N'COLUMN',@level2name=N'HazardRegisterId'
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'系统类型(1:安全,2:质量)' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Check_RewardAndPunish', @level2type=N'COLUMN',@level2name=N'SysTemType'
END

GO



alter table Check_RewardAndPunish add RewardAndPunishType nvarchar(10) COLLATE Chinese_PRC_CI_AS  NULL;
EXEC sp_addextendedproperty
'MS_Description', N'奖惩类型',
'SCHEMA', N'dbo',
'TABLE', N'Check_RewardAndPunish',
'COLUMN', N'RewardAndPunishType'
GO


alter table Check_RewardAndPunish add RewardAndPunishCode nvarchar(100) COLLATE Chinese_PRC_CI_AS  NULL;
EXEC sp_addextendedproperty
'MS_Description', N'奖惩编号',
'SCHEMA', N'dbo',
'TABLE', N'Check_RewardAndPunish',
'COLUMN', N'RewardAndPunishCode'
GO


alter table Check_RewardAndPunish add RewardAndPunishMan nvarchar(50) COLLATE Chinese_PRC_CI_AS  NULL;
EXEC sp_addextendedproperty
'MS_Description', N'奖惩人id',
'SCHEMA', N'dbo',
'TABLE', N'Check_RewardAndPunish',
'COLUMN', N'RewardAndPunishMan'
GO


alter table Check_RewardAndPunish add TeamGroupId nvarchar(50) COLLATE Chinese_PRC_CI_AS  NULL;
EXEC sp_addextendedproperty
'MS_Description', N'所属班组id',
'SCHEMA', N'dbo',
'TABLE', N'Check_RewardAndPunish',
'COLUMN', N'TeamGroupId'
GO


alter table Check_RewardAndPunish add Remark nvarchar(2000) COLLATE Chinese_PRC_CI_AS  NULL;
EXEC sp_addextendedproperty
'MS_Description', N'备注',
'SCHEMA', N'dbo',
'TABLE', N'Check_RewardAndPunish',
'COLUMN', N'Remark'
GO



--数据来源
alter table Check_RewardAndPunish add DataSource char(1) COLLATE Chinese_PRC_CI_AS  NULL;
EXEC sp_addextendedproperty
'MS_Description', N'数据来源(1巡检,0页面新增)',
'SCHEMA', N'dbo',
'TABLE', N'Check_RewardAndPunish',
'COLUMN', N'DataSource'
GO

--巡检id
alter table Check_RewardAndPunish add HazardRegisterId nvarchar(50) COLLATE Chinese_PRC_CI_AS  NULL;
EXEC sp_addextendedproperty
'MS_Description', N'巡检id',
'SCHEMA', N'dbo',
'TABLE', N'Check_RewardAndPunish',
'COLUMN', N'HazardRegisterId'
GO



alter table Check_RewardAndPunish add SysTemType char(1) COLLATE Chinese_PRC_CI_AS  NULL;
EXEC sp_addextendedproperty
'MS_Description', N'系统类型(1:安全,2:质量)',
'SCHEMA', N'dbo',
'TABLE', N'Check_RewardAndPunish',
'COLUMN', N'SysTemType'
GO





--奖罚类别定义操作按钮
IF NOT EXISTS (SELECT * FROM Sys_ButtonToMenu WHERE MenuId = '621A9295-DD82-425A-863D-310AD319752B')
BEGIN
INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex]) 
VALUES (N'66A68871-E510-4357-BD6A-EBF760D91077', N'621A9295-DD82-425A-863D-310AD319752B', N'增加', 1);
INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex]) 
VALUES (N'DB3EFB77-6A46-466F-A1A6-8BA05D963ED0', N'621A9295-DD82-425A-863D-310AD319752B', N'修改', 2);
INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex]) 
VALUES (N'55213669-02B3-4CC5-9763-AB9F04FDD8A4', N'621A9295-DD82-425A-863D-310AD319752B', N'删除', 3);
INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex]) 
VALUES (N'DB1233F9-CCAC-40E9-86ED-8B384D1647E1', N'621A9295-DD82-425A-863D-310AD319752B', N'保存', 4);
END
GO

--初始奖罚类型
IF NOT EXISTS (SELECT * FROM Sys_Const WHERE ConstText = '安全明星奖')
BEGIN
INSERT INTO [dbo].[Sys_Const] ([ID], [ConstValue], [ConstText], [SortIndex], [GroupId], [Remark]) VALUES (N'1F1F8341-5E14-4F3C-BD77-561FBC6B0109', N'1', N'安全明星奖', 1, N'RewardType', NULL);
END
GO
IF NOT EXISTS (SELECT * FROM Sys_Const WHERE ConstText = '百万工时无事故奖')
BEGIN
INSERT INTO [dbo].[Sys_Const] ([ID], [ConstValue], [ConstText], [SortIndex], [GroupId], [Remark]) VALUES (N'49B56FFB-8153-43F6-8650-DE23DD353C38', N'2', N'百万工时无事故奖', 2, N'RewardType', NULL);
END
GO
IF NOT EXISTS (SELECT * FROM Sys_Const WHERE ConstText = '安全目标兑现奖')
BEGIN
INSERT INTO [dbo].[Sys_Const] ([ID], [ConstValue], [ConstText], [SortIndex], [GroupId], [Remark]) VALUES (N'C5C64861-30C6-4FB2-B24D-4D81BF18981A', N'3', N'安全目标兑现奖', 3, N'RewardType', NULL);
END
GO
IF NOT EXISTS (SELECT * FROM Sys_Const WHERE ConstText = '其它奖励')
BEGIN
INSERT INTO [dbo].[Sys_Const] ([ID], [ConstValue], [ConstText], [SortIndex], [GroupId], [Remark]) VALUES (N'4DCEF45B-878F-4724-A76B-7AFFF22A4169', N'4', N'其它奖励', 4, N'RewardType', NULL);
END
GO
IF NOT EXISTS (SELECT * FROM Sys_Const WHERE ConstText = '个人防护')
BEGIN
INSERT INTO [dbo].[Sys_Const] ([ID], [ConstValue], [ConstText], [SortIndex], [GroupId], [Remark]) VALUES (N'7b07cbcc-9c5c-4eb7-9015-ebcc41e68810', N'1', N'个人防护', 5, N'PunishType', NULL);
END
GO
IF NOT EXISTS (SELECT * FROM Sys_Const WHERE ConstText = '其他处罚')
BEGIN
INSERT INTO [dbo].[Sys_Const] ([ID], [ConstValue], [ConstText], [SortIndex], [GroupId], [Remark]) VALUES (N'f03173ab-0a91-4583-b15d-d4fd0c3c68e5', N'2', N'其他处罚', 6, N'PunishType', NULL);
END
GO


--巡检添加处罚人
alter table HSSE_Hazard_HazardRegister add PunishPerson nvarchar(50) COLLATE Chinese_PRC_CI_AS  NULL;
EXEC sp_addextendedproperty
'MS_Description', N'处罚人',
'SCHEMA', N'dbo',
'TABLE', N'HSSE_Hazard_HazardRegister',
'COLUMN', N'PunishPersion'
GO



-----物质单位表
--CREATE TABLE [dbo].[Base_MaterialUnit] (
--  [MaterialUnitId] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NOT NULL,
--  [MaterialUnitName] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NULL,
--  [MaterialUnitCode] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
--  [Remark] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
--  CONSTRAINT [PK_Base_MaterialUnit] PRIMARY KEY CLUSTERED ([MaterialUnitId])
--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_MaterialUnit] SET (LOCK_ESCALATION = TABLE)
--GO

--EXEC sp_addextendedproperty
--'MS_Description', N'单位id',
--'SCHEMA', N'dbo',
--'TABLE', N'Base_MaterialUnit',
--'COLUMN', N'MaterialUnitId'
--GO

--EXEC sp_addextendedproperty
--'MS_Description', N'单位名称',
--'SCHEMA', N'dbo',
--'TABLE', N'Base_MaterialUnit',
--'COLUMN', N'MaterialUnitName'
--GO

--EXEC sp_addextendedproperty
--'MS_Description', N'编号',
--'SCHEMA', N'dbo',
--'TABLE', N'Base_MaterialUnit',
--'COLUMN', N'MaterialUnitCode'
--GO

--EXEC sp_addextendedproperty
--'MS_Description', N'备注',
--'SCHEMA', N'dbo',
--'TABLE', N'Base_MaterialUnit',
--'COLUMN', N'Remark'
--GO

--EXEC sp_addextendedproperty
--'MS_Description', N'物质单位表',
--'SCHEMA', N'dbo',
--'TABLE', N'Base_MaterialUnit'
--GO





--IF NOT EXISTS (SELECT * FROM Sys_Menu WHERE MenuId = '3DD3F0E8-D3EA-41AA-BA1F-CA3168657D67' and MenuType = 'Menu_System_Hsse_S_SysSet')
--BEGIN
--INSERT INTO [dbo].[Sys_Menu] ([MenuId], [MenuName], [Icon], [Url], [SortIndex], [SuperMenu], [MenuType], [IsOffice], [IsEnd], [IsUsed]) 
--VALUES (N'3DD3F0E8-D3EA-41AA-BA1F-CA3168657D67', N'物资单位', NULL, N'BaseInfo/MaterialUnit.aspx', 135, N'8A2CEE72-2793-49C6-9E2E-E83B2676E2DD', N'Menu_System_Hsse_S_SysSet', '1', '1', '1');
--END
--GO


----物资单位类别操作按钮
--IF NOT EXISTS (SELECT * FROM Sys_ButtonToMenu WHERE MenuId = '3DD3F0E8-D3EA-41AA-BA1F-CA3168657D67')
--BEGIN
--INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex]) 
--VALUES (N'B24AC161-1F79-4068-99A2-4B2FF0B67DD5', N'3DD3F0E8-D3EA-41AA-BA1F-CA3168657D67', N'增加', 1);
--INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex]) 
--VALUES (N'39FEED77-AFCD-463F-A7B2-6EBA78973DBD', N'3DD3F0E8-D3EA-41AA-BA1F-CA3168657D67', N'修改', 2);
--INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex]) 
--VALUES (N'47297A32-0CBC-4A7A-ACBE-E3666C87A2A2', N'3DD3F0E8-D3EA-41AA-BA1F-CA3168657D67', N'删除', 3);
--INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex]) 
--VALUES (N'99AD4C8E-27A7-4721-A559-BD879A2C3940', N'3DD3F0E8-D3EA-41AA-BA1F-CA3168657D67', N'保存', 4);
--END
--GO







-----物质进出记录表
--CREATE TABLE [dbo].[MaterialInAndOutRecord] (
--  [Id] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NOT NULL,
--  [ProjectId] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
--  [GoodsCategoryId] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
--  [GoodsCategoryName] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NULL,
--  [MaterialModel] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NULL,
--  [InOutDate] datetime  NULL,
--  [UnitId] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
--  [InOrOut] nvarchar(10) COLLATE Chinese_PRC_CI_AS  NULL,
--  [Number] decimal(18,2)  NULL,
--  [MaterialUnitId] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
--  [Remark] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
--  [CompileMan] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
--  [CompileDate] datetime  NULL,
--  CONSTRAINT [PK_MaterialInAndOutRecord] PRIMARY KEY CLUSTERED ([Id])
--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].[MaterialInAndOutRecord] SET (LOCK_ESCALATION = TABLE)
--GO

--EXEC sp_addextendedproperty
--'MS_Description', N'主键id',
--'SCHEMA', N'dbo',
--'TABLE', N'MaterialInAndOutRecord',
--'COLUMN', N'Id'
--GO

--EXEC sp_addextendedproperty
--'MS_Description', N'物资名称',
--'SCHEMA', N'dbo',
--'TABLE', N'MaterialInAndOutRecord',
--'COLUMN', N'GoodsCategoryName'
--GO

--EXEC sp_addextendedproperty
--'MS_Description', N'物资id',
--'SCHEMA', N'dbo',
--'TABLE', N'MaterialInAndOutRecord',
--'COLUMN', N'GoodsCategoryId'
--GO

--EXEC sp_addextendedproperty
--'MS_Description', N'型号',
--'SCHEMA', N'dbo',
--'TABLE', N'MaterialInAndOutRecord',
--'COLUMN', N'MaterialModel'
--GO

--EXEC sp_addextendedproperty
--'MS_Description', N'所属单位',
--'SCHEMA', N'dbo',
--'TABLE', N'MaterialInAndOutRecord',
--'COLUMN', N'UnitId'
--GO

--EXEC sp_addextendedproperty
--'MS_Description', N'进出时间',
--'SCHEMA', N'dbo',
--'TABLE', N'MaterialInAndOutRecord',
--'COLUMN', N'InOutDate'
--GO

--EXEC sp_addextendedproperty
--'MS_Description', N'进/出',
--'SCHEMA', N'dbo',
--'TABLE', N'MaterialInAndOutRecord',
--'COLUMN', N'InOrOut'
--GO

--EXEC sp_addextendedproperty
--'MS_Description', N'数量',
--'SCHEMA', N'dbo',
--'TABLE', N'MaterialInAndOutRecord',
--'COLUMN', N'Number'
--GO

--EXEC sp_addextendedproperty
--'MS_Description', N'物资单位',
--'SCHEMA', N'dbo',
--'TABLE', N'MaterialInAndOutRecord',
--'COLUMN', N'MaterialUnitId'
--GO

--EXEC sp_addextendedproperty
--'MS_Description', N'备注',
--'SCHEMA', N'dbo',
--'TABLE', N'MaterialInAndOutRecord',
--'COLUMN', N'Remark'
--GO

--EXEC sp_addextendedproperty
--'MS_Description', N'编制人',
--'SCHEMA', N'dbo',
--'TABLE', N'MaterialInAndOutRecord',
--'COLUMN', N'CompileMan'
--GO

--EXEC sp_addextendedproperty
--'MS_Description', N'编制时间',
--'SCHEMA', N'dbo',
--'TABLE', N'MaterialInAndOutRecord',
--'COLUMN', N'CompileDate'
--GO

--EXEC sp_addextendedproperty
--'MS_Description', N'物质单位表',
--'SCHEMA', N'dbo',
--'TABLE', N'MaterialInAndOutRecord'
--GO



-----施工机具改为机具及物资管理
--UPDATE [dbo].[Sys_Menu] SET [MenuName] = N'机具及物资管理' WHERE CONVERT(NVARCHAR(MAX), [MenuId]) = N'E8EFF12C-E07C-491D-A33A-891F80BFA2A4' AND CONVERT(NVARCHAR(MAX), [MenuType]) = N'Menu_System_Hsse_S_Hsse';
--UPDATE [dbo].[Sys_Menu] SET [MenuName] = N'机具及物资管理' WHERE CONVERT(NVARCHAR(MAX), [MenuId]) = N'28C8EDB9-F1C2-4287-8013-28A976B093E2' AND CONVERT(NVARCHAR(MAX), [MenuType]) = N'Menu_System_Hsse_P_Hsse';
--GO

--IF NOT EXISTS (SELECT * FROM Sys_Menu WHERE MenuId = '5DAB5F9A-097A-46D4-8EB1-F60D1D65E812')
--BEGIN
--INSERT INTO [dbo].[Sys_Menu] ([MenuId], [MenuName], [Icon], [Url], [SortIndex], [SuperMenu], [MenuType], [IsOffice], [IsEnd], [IsUsed]) VALUES (N'5DAB5F9A-097A-46D4-8EB1-F60D1D65E812', N'物资进出记录', NULL, N'Customization/CNCCG/HSSE/InApproveManager/MaterialInAndOutRecord.aspx', 70, N'E8EFF12C-E07C-491D-A33A-891F80BFA2A4', N'Menu_System_Hsse_S_Hsse', '0', '1', '1');
--INSERT INTO [dbo].[Sys_Menu] ([MenuId], [MenuName], [Icon], [Url], [SortIndex], [SuperMenu], [MenuType], [IsOffice], [IsEnd], [IsUsed]) VALUES (N'5DAB5F9A-097A-46D4-8EB1-F60D1D65E812', N'物资进出记录', NULL, N'Customization/CNCCG/HSSE/InApproveManager/MaterialInAndOutRecord.aspx', 70, N'28C8EDB9-F1C2-4287-8013-28A976B093E2', N'Menu_System_Hsse_P_Hsse', '0', '1', '1');
--END
--GO


----物资进出记录操作按钮
--IF NOT EXISTS (SELECT * FROM Sys_ButtonToMenu WHERE MenuId = '5DAB5F9A-097A-46D4-8EB1-F60D1D65E812')
--BEGIN
--INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex]) 
--VALUES (N'6ED57081-F50C-4C78-A57F-1B66E60CA5BB', N'5DAB5F9A-097A-46D4-8EB1-F60D1D65E812', N'增加', 1);
--INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex]) 
--VALUES (N'01BCCD41-AF6F-4608-A8D3-F36A281530E9', N'5DAB5F9A-097A-46D4-8EB1-F60D1D65E812', N'修改', 2);
--INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex]) 
--VALUES (N'32273E6F-AA17-4EA3-8B45-21105AB34C98', N'5DAB5F9A-097A-46D4-8EB1-F60D1D65E812', N'删除', 3);
--INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex]) 
--VALUES (N'718ED2CB-BAD4-48B8-A7A9-186CA9032191', N'5DAB5F9A-097A-46D4-8EB1-F60D1D65E812', N'保存', 4);
--END
--GO


----物资进出统计
--IF NOT EXISTS (SELECT * FROM Sys_Menu WHERE MenuId = '76608E2B-5309-4346-9BA7-E29A5736D1F1')
--BEGIN
--INSERT INTO [dbo].[Sys_Menu] ([MenuId], [MenuName], [Icon], [Url], [SortIndex], [SuperMenu], [MenuType], [IsOffice], [IsEnd], [IsUsed]) VALUES (N'76608E2B-5309-4346-9BA7-E29A5736D1F1', N'物资进出记录统计', NULL, N'Customization/CNCCG/HSSE/InApproveManager/MaterialInAndOutRecordStatistics.aspx', 80, N'E8EFF12C-E07C-491D-A33A-891F80BFA2A4', N'Menu_System_Hsse_S_Hsse', '0', '1', '1');
--INSERT INTO [dbo].[Sys_Menu] ([MenuId], [MenuName], [Icon], [Url], [SortIndex], [SuperMenu], [MenuType], [IsOffice], [IsEnd], [IsUsed]) VALUES (N'76608E2B-5309-4346-9BA7-E29A5736D1F1', N'物资进出记录统计', NULL, N'Customization/CNCCG/HSSE/InApproveManager/MaterialInAndOutRecordStatistics.aspx', 80, N'28C8EDB9-F1C2-4287-8013-28A976B093E2', N'Menu_System_Hsse_P_Hsse', '0', '1', '1');
--END
--GO

