1
This commit is contained in:
@@ -0,0 +1,106 @@
|
||||
-- auto-generated definition
|
||||
create table dbo.Supervise_UnitHazardRegister
|
||||
(
|
||||
UnitHazardRegisterId nvarchar(50) not null
|
||||
primary key,
|
||||
UnitHazardRegisterCode nvarchar(50) not null,
|
||||
CheckDate datetime,
|
||||
CheckMainType nvarchar(2),
|
||||
CheckType nvarchar(50),
|
||||
ProjectId nvarchar(50)
|
||||
constraint FK_UnitHazardRegister_Project
|
||||
references dbo.Base_Project,
|
||||
UnitId nvarchar(50)
|
||||
constraint FK_UnitHazardRegister_Unit
|
||||
references dbo.Base_Unit,
|
||||
CheckObjectId nvarchar(200),
|
||||
CheckUnitId nvarchar(50)
|
||||
constraint FK_UnitHazardRegister_CheckUnit
|
||||
references dbo.Base_Unit,
|
||||
CheckTeam nvarchar(200),
|
||||
CheckManIds nvarchar(max),
|
||||
CheckManNames nvarchar(max),
|
||||
EvaluationResult nvarchar(max),
|
||||
AttachUrl nvarchar(2000),
|
||||
States int default 0,
|
||||
CompileMan nvarchar(50),
|
||||
CreateDate datetime,
|
||||
UpdateDate datetime,
|
||||
IsUpdate bit
|
||||
)
|
||||
go
|
||||
|
||||
create index IX_UnitHazardRegister_CheckDate
|
||||
on dbo.Supervise_UnitHazardRegister (CheckDate desc)
|
||||
go
|
||||
|
||||
create index IX_UnitHazardRegister_CheckMainType
|
||||
on dbo.Supervise_UnitHazardRegister (CheckMainType)
|
||||
go
|
||||
|
||||
create index IX_UnitHazardRegister_ProjectId
|
||||
on dbo.Supervise_UnitHazardRegister (ProjectId)
|
||||
go
|
||||
|
||||
-- auto-generated definition
|
||||
create table dbo.Supervise_UnitHazardRegisterItem
|
||||
(
|
||||
UnitHazardRegisterItemId nvarchar(50) not null
|
||||
primary key,
|
||||
UnitHazardRegisterId nvarchar(50) not null
|
||||
constraint FK_UnitHazardRegisterItem_Register
|
||||
references dbo.Supervise_UnitHazardRegister
|
||||
on delete cascade,
|
||||
ProblemDescription nvarchar(max),
|
||||
ProblemType nvarchar(50),
|
||||
RiskLevel nvarchar(50),
|
||||
RectifyRequirement nvarchar(max),
|
||||
CompleteStatus int default 0,
|
||||
CompletedDate datetime,
|
||||
SortIndex int default 0,
|
||||
RectificationMeasures nvarchar(100),
|
||||
IsUpdate bit
|
||||
)
|
||||
go
|
||||
|
||||
create index IX_UnitHazardRegisterItem_RegisterId
|
||||
on dbo.Supervise_UnitHazardRegisterItem (UnitHazardRegisterId)
|
||||
go
|
||||
|
||||
|
||||
INSERT INTO dbo.Sys_Menu (MenuId, MenuName, Icon, Url, SortIndex, SuperMenu, MenuType, IsOffice, IsEnd, IsUsed)
|
||||
VALUES (N'C46C007E-A100-4A52-9317-3B885442E130', N'企业安全检查', null, N'/ZHGL/Supervise/UnitHazardRegister.aspx?type=0', 40, N'CD9FC4C8-4B02-4619-8B02-50DA6AE6146E', N'Menu_System_Hsse_S_Hsse', 1, 1, 1);
|
||||
go
|
||||
INSERT INTO dbo.Sys_ButtonToMenu (ButtonToMenuId, MenuId, ButtonName, SortIndex) VALUES (N'D15F74F2-CD1A-4F45-9501-DF00ED845730', N'C46C007E-A100-4A52-9317-3B885442E130', N'修改', 2);
|
||||
go
|
||||
INSERT INTO dbo.Sys_ButtonToMenu (ButtonToMenuId, MenuId, ButtonName, SortIndex) VALUES (N'A2CCDFF7-9593-4BCB-9425-769C99F8EFEE', N'C46C007E-A100-4A52-9317-3B885442E130', N'删除', 3);
|
||||
go
|
||||
INSERT INTO dbo.Sys_ButtonToMenu (ButtonToMenuId, MenuId, ButtonName, SortIndex) VALUES (N'435F26E9-232F-4CAA-835F-CAF41DA2B175', N'C46C007E-A100-4A52-9317-3B885442E130', N'保存', 4);
|
||||
go
|
||||
INSERT INTO dbo.Sys_ButtonToMenu (ButtonToMenuId, MenuId, ButtonName, SortIndex) VALUES (N'B822D703-CFE3-422A-88F3-67B26B0A255A', N'C46C007E-A100-4A52-9317-3B885442E130', N'增加', 1);
|
||||
|
||||
go
|
||||
INSERT INTO dbo.Sys_Menu (MenuId, MenuName, Icon, Url, SortIndex, SuperMenu, MenuType, IsOffice, IsEnd, IsUsed)
|
||||
VALUES (N'73283863-CF67-44CA-9DF8-67071734A528', N'企业安全检查记录', null, N'/ZHGL/Supervise/UnitHazardRegisterRecord.aspx?type=0', 45, N'CD9FC4C8-4B02-4619-8B02-50DA6AE6146E', N'Menu_System_Hsse_S_Hsse', 1, 1, 1);
|
||||
|
||||
INSERT INTO dbo.Sys_Menu (MenuId, MenuName, Icon, Url, SortIndex, SuperMenu, MenuType, IsOffice, IsEnd, IsUsed)
|
||||
VALUES (N'73283863-CF67-44CA-9DF8-67071734A528', N'企业安全检查记录', null, N'/ZHGL/Supervise/UnitHazardRegisterRecord.aspx?type=0', 10, N'467A0CB9-737D-4451-965E-869EBC3A4BD6', N'Menu_System_Hsse_P_Hsse', 1, 1, 1);
|
||||
|
||||
go
|
||||
INSERT INTO dbo.Sys_Menu (MenuId, MenuName, Icon, Url, SortIndex, SuperMenu, MenuType, IsOffice, IsEnd, IsUsed)
|
||||
VALUES (N'FDA7722C-383E-4BB1-B29D-BB0BF87AA942', N'企业质量检查', null, N'/ZHGL/Supervise/UnitHazardRegister.aspx?type=1', 40, N'CD9FC4C8-4B02-4619-8B02-50DA6AE6146E', N'Menu_System_Qwms_S_Cqms', 1, 1, 1);
|
||||
go
|
||||
INSERT INTO dbo.Sys_ButtonToMenu (ButtonToMenuId, MenuId, ButtonName, SortIndex) VALUES (N'B980C835-B079-4485-AE0E-EE721C191470', N'FDA7722C-383E-4BB1-B29D-BB0BF87AA942', N'修改', 2);
|
||||
go
|
||||
INSERT INTO dbo.Sys_ButtonToMenu (ButtonToMenuId, MenuId, ButtonName, SortIndex) VALUES (N'9BABA2CE-2593-422A-A792-80E826D164AB', N'FDA7722C-383E-4BB1-B29D-BB0BF87AA942', N'删除', 3);
|
||||
go
|
||||
INSERT INTO dbo.Sys_ButtonToMenu (ButtonToMenuId, MenuId, ButtonName, SortIndex) VALUES (N'5C9AF2B1-4AF0-4F16-BC5D-154055A6BF8F', N'FDA7722C-383E-4BB1-B29D-BB0BF87AA942', N'保存', 4);
|
||||
go
|
||||
INSERT INTO dbo.Sys_ButtonToMenu (ButtonToMenuId, MenuId, ButtonName, SortIndex) VALUES (N'E3CD6629-9B4B-4B26-A24B-97F9F3E4428F', N'FDA7722C-383E-4BB1-B29D-BB0BF87AA942', N'增加', 1);
|
||||
go
|
||||
INSERT INTO dbo.Sys_Menu (MenuId, MenuName, Icon, Url, SortIndex, SuperMenu, MenuType, IsOffice, IsEnd, IsUsed)
|
||||
VALUES (N'15511354-9822-4A21-AB24-2483D889FDB8', N'企业质量检查记录', null, N'/ZHGL/Supervise/UnitHazardRegisterRecord.aspx?type=1', 45, N'CD9FC4C8-4B02-4619-8B02-50DA6AE6146E', N'Menu_System_Qwms_S_Cqms', 1, 1, 1);
|
||||
go
|
||||
INSERT INTO dbo.Sys_Menu (MenuId, MenuName, Icon, Url, SortIndex, SuperMenu, MenuType, IsOffice, IsEnd, IsUsed)
|
||||
VALUES (N'15511354-9822-4A21-AB24-2483D889FDB8', N'企业质量检查记录', null, N'/ZHGL/Supervise/UnitHazardRegisterRecord.aspx?type=1', 10, N'A54EC449-5F77-4068-83B9-AA305B721A0B', N'Menu_System_Qwms_P_Cqms', 1, 1, 1);
|
||||
go
|
||||
@@ -0,0 +1,23 @@
|
||||
|
||||
|
||||
-- 总包单位
|
||||
alter table Base_Project add SubjectUnit nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL;
|
||||
-- 总包单位下项目id
|
||||
alter table Base_Project add SubjectProject nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL;
|
||||
GO
|
||||
|
||||
--数据来源
|
||||
alter table HSSE_Hazard_HazardRegister add DataSource char(1) COLLATE Chinese_PRC_CI_AS NULL;
|
||||
EXEC sp_addextendedproperty
|
||||
'MS_Description', N'数据来源(1总包,0本单位)',
|
||||
'SCHEMA', N'dbo',
|
||||
'TABLE', N'HSSE_Hazard_HazardRegister',
|
||||
'COLUMN', N'DataSource'
|
||||
GO
|
||||
|
||||
|
||||
|
||||
--定制版需要根据具体的菜单名称进行修改为"安全健康检查"
|
||||
update [dbo].[Sys_Menu] set MenuName = '安全健康检查' WHERE MenuName = '安全健康日常巡检' and IsUsed = '1'
|
||||
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
|
||||
|
||||
/****** Object: StoredProcedure [dbo].[SP_DataIdMove] Script Date: 2026-2-6 17:34:01 ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
|
||||
|
||||
|
||||
CREATE PROC [dbo].[SP_DataIdMove]
|
||||
@exTable NVARCHAR(50) = NULL ,
|
||||
@colums NVARCHAR(50) = NULL ,
|
||||
@trueId NVARCHAR(50) = NULL
|
||||
--,@returnVal int output
|
||||
AS
|
||||
|
||||
BEGIN
|
||||
--DECLARE @returnVal int =0
|
||||
--SET @returnVal = 0
|
||||
DECLARE @OldId nvarchar(50),@NewId nvarchar(50)
|
||||
DECLARE @tablename nvarchar(1000),@columnname nvarchar(1000)
|
||||
DECLARE @sql nvarchar(2000)
|
||||
DECLARE cursor_Id CURSOR FOR -- 定义游标
|
||||
SELECT OldId ,NewIds FROM DataIdMove WHERE ColumType = @colums and NewIds = @trueId
|
||||
OPEN cursor_Id
|
||||
FETCH NEXT FROM cursor_Id INTO @OldId, @NewId -- 抓取下一行游标数据
|
||||
WHILE @@FETCH_STATUS = 0 --(-1 语句失败, -2 被提取行不存在)
|
||||
BEGIN
|
||||
--SET @returnVal=@returnVal+1
|
||||
--print @OldId
|
||||
DECLARE cursor_name CURSOR FOR -- 定义游标
|
||||
SELECT DISTINCT TABLE_NAME,COLUMN_NAME
|
||||
FROM INFORMATION_SCHEMA.COLUMNS
|
||||
WHERE COLUMN_NAME like '%'+@colums+'%' and TABLE_NAME in (SELECT distinct TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'BASE TABLE') and TABLE_NAME <> @exTable
|
||||
OPEN cursor_name -- 打开游标
|
||||
FETCH NEXT FROM cursor_name INTO @tablename ,@columnname -- 抓取下一行游标数据
|
||||
WHILE @@FETCH_STATUS = 0 --(-1 语句失败, -2 被提取行不存在)
|
||||
BEGIN
|
||||
SET @sql = 'update ' + @tablename + ' set ' + @columnname + ' =REPLACE('+@columnname+', '''+@OldId+''', '''+@NewId+''') where '+ @columnname + ' like '+'''%'+@OldId+'%'';' ;
|
||||
--print @sql
|
||||
EXEC sp_executesql @sql
|
||||
FETCH NEXT FROM cursor_name INTO @tablename,@columnname;
|
||||
END
|
||||
CLOSE cursor_name -- 关闭游标
|
||||
DEALLOCATE cursor_name -- 释放游标
|
||||
FETCH NEXT FROM cursor_Id INTO @OldId, @NewId
|
||||
END
|
||||
CLOSE cursor_Id -- 关闭游标
|
||||
DEALLOCATE cursor_Id -- 释放游标
|
||||
--SELECT @returnVal
|
||||
END
|
||||
|
||||
|
||||
|
||||
GO
|
||||
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
alter table dbo.Supervise_UnitHazardRegister
|
||||
add InsResponsibleUserId nvarchar(50)
|
||||
go
|
||||
|
||||
exec sp_addextendedproperty 'MS_Description', N'受检责任人', 'SCHEMA', 'dbo', 'TABLE', 'Supervise_UnitHazardRegister',
|
||||
'COLUMN', 'InsResponsibleUserId'
|
||||
go
|
||||
alter table dbo.Supervise_UnitHazardRegister
|
||||
drop constraint FK_UnitHazardRegister_Unit
|
||||
go
|
||||
alter table dbo.Supervise_UnitHazardRegister
|
||||
drop column UnitId
|
||||
go
|
||||
|
||||
alter table dbo.Supervise_UnitHazardRegister
|
||||
drop column CheckObjectId
|
||||
go
|
||||
@@ -0,0 +1,21 @@
|
||||
|
||||
|
||||
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'DataIdMove') AND type = N'U')
|
||||
BEGIN
|
||||
CREATE TABLE [dbo].[DataIdMove](
|
||||
[OldId] [nvarchar](50) NOT NULL,
|
||||
[NewIds] [nvarchar](50) NULL,
|
||||
[ColumType] [nvarchar](50) NULL,
|
||||
CONSTRAINT [PK_DataIdMove] PRIMARY KEY CLUSTERED
|
||||
(
|
||||
[OldId] 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'OldId' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'DataIdMove', @level2type=N'COLUMN',@level2name=N'OldId'
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'NewIds' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'DataIdMove', @level2type=N'COLUMN',@level2name=N'NewIds'
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ColumType' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'DataIdMove', @level2type=N'COLUMN',@level2name=N'ColumType'
|
||||
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Ìæ»»Êý¾Ý±í' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'DataIdMove'
|
||||
END
|
||||
|
||||
GO
|
||||
@@ -0,0 +1,58 @@
|
||||
|
||||
/****** Object: StoredProcedure [dbo].[SP_DataIdMove] Script Date: 2026-2-6 17:14:03 ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
|
||||
|
||||
|
||||
ALTER PROC [dbo].[SP_DataIdMove]
|
||||
@exTable NVARCHAR(50) = NULL ,
|
||||
@colums NVARCHAR(50) = NULL ,
|
||||
@trueId NVARCHAR(50) = NULL
|
||||
--,@returnVal int output
|
||||
AS
|
||||
|
||||
BEGIN
|
||||
--DECLARE @returnVal int =0
|
||||
--SET @returnVal = 0
|
||||
DECLARE @OldId nvarchar(50),@NewId nvarchar(50)
|
||||
DECLARE @tablename nvarchar(1000),@columnname nvarchar(1000)
|
||||
DECLARE @sql nvarchar(2000)
|
||||
DECLARE cursor_Id CURSOR FOR -- 定义游标
|
||||
SELECT OldId ,NewIds FROM DataIdMove WHERE ColumType = @colums and NewIds = @trueId
|
||||
OPEN cursor_Id
|
||||
FETCH NEXT FROM cursor_Id INTO @OldId, @NewId -- 抓取下一行游标数据
|
||||
WHILE @@FETCH_STATUS = 0 --(-1 语句失败, -2 被提取行不存在)
|
||||
BEGIN
|
||||
--SET @returnVal=@returnVal+1
|
||||
--print @OldId
|
||||
DECLARE cursor_name CURSOR FOR -- 定义游标
|
||||
SELECT DISTINCT TABLE_NAME,COLUMN_NAME
|
||||
FROM INFORMATION_SCHEMA.COLUMNS
|
||||
WHERE COLUMN_NAME like '%'+@colums+'%' and TABLE_NAME in (SELECT distinct TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'BASE TABLE') and TABLE_NAME <> @exTable
|
||||
OPEN cursor_name -- 打开游标
|
||||
FETCH NEXT FROM cursor_name INTO @tablename ,@columnname -- 抓取下一行游标数据
|
||||
WHILE @@FETCH_STATUS = 0 --(-1 语句失败, -2 被提取行不存在)
|
||||
BEGIN
|
||||
SET @sql = 'update ' + @tablename + ' set ' + @columnname + ' =REPLACE('+@columnname+', '''+@OldId+''', '''+@NewId+''') where '+ @columnname + ' like '+'''%'+@OldId+'%'';' ;
|
||||
--print @sql
|
||||
EXEC sp_executesql @sql
|
||||
FETCH NEXT FROM cursor_name INTO @tablename,@columnname;
|
||||
END
|
||||
CLOSE cursor_name -- 关闭游标
|
||||
DEALLOCATE cursor_name -- 释放游标
|
||||
FETCH NEXT FROM cursor_Id INTO @OldId, @NewId
|
||||
END
|
||||
CLOSE cursor_Id -- 关闭游标
|
||||
DEALLOCATE cursor_Id -- 释放游标
|
||||
--SELECT @returnVal
|
||||
END
|
||||
|
||||
|
||||
|
||||
GO
|
||||
|
||||
|
||||
@@ -0,0 +1,101 @@
|
||||
|
||||
|
||||
--班前会补充字段
|
||||
IF NOT EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'Meeting_ClassMeeting' AND COLUMN_NAME = 'Remark')
|
||||
BEGIN
|
||||
ALTER TABLE Meeting_ClassMeeting ADD Remark nvarchar(500);
|
||||
END
|
||||
GO
|
||||
|
||||
|
||||
--菜单安全技术-临时用电方案表
|
||||
--注意:菜单父级位置根据定制单位结构放置【五环放在施工方案(Menu_HSSE)下面】
|
||||
IF NOT EXISTS (SELECT * FROM Sys_Menu WHERE MenuId = '09B2A0A6-A693-4F1D-A4F5-D5DEA803D771')
|
||||
BEGIN
|
||||
INSERT INTO dbo.Sys_Menu (MenuId, MenuName,Url, SortIndex, SuperMenu, MenuType, IsOffice, IsEnd, IsUsed)
|
||||
VALUES (N'09B2A0A6-A693-4F1D-A4F5-D5DEA803D771', N'临时用电方案', N'HSSE/Solution/TemporaryElectricity.aspx', 40, 菜单父级位置, 菜单类型, 0,1, 1);
|
||||
END
|
||||
|
||||
--安全技术-临时用电方案表
|
||||
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'Solution_TemporaryElectricity') AND type = N'U')
|
||||
BEGIN
|
||||
|
||||
CREATE TABLE [dbo].[Solution_TemporaryElectricity](
|
||||
[TemporaryElectricityId] [nvarchar](50) NOT NULL,
|
||||
[ProjectId] [nvarchar](50) NULL,
|
||||
[Code] [nvarchar](100) NULL,
|
||||
[Name] [nvarchar](200) NULL,
|
||||
[Content] [nvarchar](2000) NULL,
|
||||
[Remark] [nvarchar](500) NULL,
|
||||
[CompileMan] [nvarchar](50) NULL,
|
||||
[CompileDate] [datetime] NULL,
|
||||
CONSTRAINT [PK_Solution_TemporaryElectricity] PRIMARY KEY CLUSTERED
|
||||
(
|
||||
[TemporaryElectricityId] 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'Solution_TemporaryElectricity', @level2type=N'COLUMN',@level2name=N'TemporaryElectricityId'
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'项目id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Solution_TemporaryElectricity', @level2type=N'COLUMN',@level2name=N'ProjectId'
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'编号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Solution_TemporaryElectricity', @level2type=N'COLUMN',@level2name=N'Code'
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'方案名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Solution_TemporaryElectricity', @level2type=N'COLUMN',@level2name=N'Name'
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'内容' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Solution_TemporaryElectricity', @level2type=N'COLUMN',@level2name=N'Content'
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'备注' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Solution_TemporaryElectricity', @level2type=N'COLUMN',@level2name=N'Remark'
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'编制人' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Solution_TemporaryElectricity', @level2type=N'COLUMN',@level2name=N'CompileMan'
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'编制日期' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Solution_TemporaryElectricity', @level2type=N'COLUMN',@level2name=N'CompileDate'
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'临时用电方案' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Solution_TemporaryElectricity'
|
||||
|
||||
END
|
||||
|
||||
GO
|
||||
|
||||
update Sys_Menu set MenuName='临时用电方案'
|
||||
WHERE MenuId = '09B2A0A6-A693-4F1D-A4F5-D5DEA803D771'
|
||||
update Sys_Menu set MenuName='临时用电方案'
|
||||
WHERE MenuId = 'B04483D5-4421-4046-8B1A-E97589952150'
|
||||
|
||||
GO
|
||||
|
||||
--临时用电方案补充字段
|
||||
IF NOT EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'Solution_TemporaryElectricity' AND COLUMN_NAME = 'Remark')
|
||||
BEGIN
|
||||
ALTER TABLE Solution_TemporaryElectricity ADD Content nvarchar(2000);
|
||||
ALTER TABLE Solution_TemporaryElectricity ADD Remark nvarchar(500);
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'内容' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Solution_TemporaryElectricity', @level2type=N'COLUMN',@level2name=N'Content'
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'备注' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Solution_TemporaryElectricity', @level2type=N'COLUMN',@level2name=N'Remark'
|
||||
END
|
||||
GO
|
||||
|
||||
--安全技术-临时用电表操作按钮
|
||||
IF NOT EXISTS (SELECT * FROM Sys_ButtonToMenu WHERE MenuId = '09B2A0A6-A693-4F1D-A4F5-D5DEA803D771')
|
||||
BEGIN
|
||||
INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex])
|
||||
VALUES (N'A633C879-BE46-4D2B-BAC3-9A656396AD53', N'09B2A0A6-A693-4F1D-A4F5-D5DEA803D771', N'增加', 1);
|
||||
INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex])
|
||||
VALUES (N'3C001F6B-428B-4BDC-8913-FD00CAC63C64', N'09B2A0A6-A693-4F1D-A4F5-D5DEA803D771', N'修改', 2);
|
||||
INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex])
|
||||
VALUES (N'E510ABD6-50B2-4685-8DB8-E362B88E8F9E', N'09B2A0A6-A693-4F1D-A4F5-D5DEA803D771', N'删除', 3);
|
||||
INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex])
|
||||
VALUES (N'9552542D-879F-49A7-BB33-7F1B54D9658F', N'09B2A0A6-A693-4F1D-A4F5-D5DEA803D771', N'保存', 4);
|
||||
END
|
||||
GO
|
||||
|
||||
|
||||
|
||||
|
||||
----菜单设置报错脚本补充处理
|
||||
--IF NOT EXISTS (SELECT * FROM Sys_Const WHERE ID = '28BF7713-44E7-43C1-B24A-7342CDD561A7')
|
||||
--BEGIN
|
||||
-- INSERT INTO dbo.Sys_Const (ID, ConstValue, ConstText, SortIndex, GroupId, Remark)
|
||||
-- VALUES (N'28BF7713-44E7-43C1-B24A-7342CDD561A7', N'System_Qwms', N'质量与焊接管理系统', 2, N'SystemClassification', null);
|
||||
--END
|
||||
|
||||
--GO
|
||||
|
||||
--IF NOT EXISTS (SELECT * FROM Sys_Const WHERE ID = '5823ADE9-302E-4402-BA6E-80F440BF184E')
|
||||
--BEGIN
|
||||
-- INSERT INTO dbo.Sys_Const (ID, ConstValue, ConstText, SortIndex, GroupId, Remark)
|
||||
-- VALUES (N'5823ADE9-302E-4402-BA6E-80F440BF184E', N'System_Hsse', N'安全与职业健康管理系统', 1, N'SystemClassification', null);
|
||||
--END
|
||||
--GO
|
||||
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
alter table SitePerson_Person add IsSyncWelder bit null
|
||||
GO
|
||||
alter table BS_Welder add PersonId nvarchar(50) null
|
||||
GO
|
||||
@@ -0,0 +1,95 @@
|
||||
|
||||
|
||||
---修改安全检查视图(添加数据来源字段Registration.DataSource)
|
||||
ALTER VIEW [dbo].[View_Hazard_HazardRegister] AS
|
||||
SELECT Registration.HazardRegisterId,
|
||||
Registration.HazardCode,
|
||||
Registration.RegisterDate,
|
||||
Registration.RegisterDef,
|
||||
Registration.Rectification,
|
||||
Registration.Place,
|
||||
Registration.ResponsibleUnit,
|
||||
Registration.Observer,
|
||||
Registration.HazardValue,
|
||||
case when Registration.HazardValue='3' then '重大' else '一般' end as Risk_Level,
|
||||
Registration.RectifiedDate,
|
||||
Registration.ProjectId,
|
||||
Project.UnitId AS PUnitId,
|
||||
Project.ProjectState as ProjectState,
|
||||
null as isDelete,
|
||||
ProjectUnit.UnitName AS PUnitName,
|
||||
case when ProjectUnit.UnitId='d72a27c9-4ba9-41c5-ab0b-c010409f20f2' then 1 else 0 end as IsThisUnit,
|
||||
ProjectUnit.IsBranch as IsBranch,
|
||||
Project.ProjectAddress,
|
||||
Registration.states,
|
||||
Registration.IsEffective,
|
||||
Registration.ResponsibleMan,
|
||||
Registration.CheckManId,
|
||||
Registration.CheckTime,
|
||||
Registration.RectificationPeriod,
|
||||
Registration.ImageUrl,
|
||||
Registration.RectificationImageUrl,
|
||||
Registration.RectificationTime,
|
||||
Registration.ConfirmMan,
|
||||
Registration.ConfirmDate,
|
||||
Registration.HandleIdea,
|
||||
Registration.CutPayment,
|
||||
Registration.ProblemTypes,
|
||||
Registration.CheckSpecialId,
|
||||
Registration.CheckItemDetailId,
|
||||
Registration.SupCheckItemSetId,
|
||||
Registration.CheckItemSetId,
|
||||
Registration.SafeSupervisionId,
|
||||
Registration.SafeSupervisionIsOK,
|
||||
Registration.WorkPackageId,
|
||||
Registration.WorkPackageName,
|
||||
Registration.IsUpdate,
|
||||
Project.ProjectName,
|
||||
Registration.CheckCycle,
|
||||
ISNULL(WorkArea.UnitWorkName,'') AS WorkAreaName,
|
||||
Unit.UnitName as ResponsibilityUnitName,
|
||||
Unit.CollCropCode as ResponsibilityUnitCollCropCode,
|
||||
User1.PersonName AS ResponsibilityManName,
|
||||
ISNULL(User1.Telephone,'') AS ResponsibilityManTel,
|
||||
User2.PersonName AS CheckManName,
|
||||
ISNULL(User2.Telephone,'') AS CheckManTel,
|
||||
User2.UnitId AS SendUnitId,
|
||||
User3.PersonName AS ConfirmManName,
|
||||
ISNULL(User3.Telephone,'') AS ConfirmManTel,
|
||||
User4.PersonName AS ResponsibilityManName2,
|
||||
CCManNames = STUFF(( SELECT ',' + PersonName FROM Person_Persons
|
||||
where PATINDEX('%,' + RTRIM(Person_Persons.PersonId) + ',%',',' + Registration.CCManIds + ',')>0
|
||||
ORDER BY PATINDEX('%,' + RTRIM(Registration.CCManIds) + ',%',',' + Registration.CCManIds + ',')
|
||||
FOR XML PATH('')), 1, 1,''),
|
||||
ISNULL(User4.Telephone,'') AS ResponsibilityMan2Tel,
|
||||
(CASE WHEN Registration.states='1' and (Registration.SafeSupervisionIsOK is null OR Registration.SafeSupervisionIsOK=0) THEN '待整改'
|
||||
WHEN Registration.states='1' and Registration.SafeSupervisionIsOK=1 THEN '合格'
|
||||
WHEN Registration.states='2' THEN '已整改-待复查验收'
|
||||
WHEN Registration.states='3' THEN '已闭环'
|
||||
ELSE '已作废' END ) AS StatesStr,
|
||||
RegisterTypes.RegisterTypesId,
|
||||
RegisterTypes.RegisterTypesName,
|
||||
Registration.DIC_ID,
|
||||
Registration.CCManIds,
|
||||
Registration.DataSource,
|
||||
Registration.RegisterTypes2Id ,
|
||||
RegisterTypes2.RegisterTypesName as RegisterTypes2Name,
|
||||
Registration.RegisterTypes3Id ,
|
||||
RegisterTypes3.RegisterTypesName as RegisterTypes3Name,
|
||||
Registration.RegisterTypes4Id ,
|
||||
RegisterTypes4.RegisterTypesName as RegisterTypes4Name,
|
||||
Registration.Requirements
|
||||
FROM dbo.HSSE_Hazard_HazardRegister AS Registration
|
||||
LEFT JOIN dbo.Base_Project AS Project ON Project.ProjectId = Registration.ProjectId
|
||||
LEFT JOIN dbo.Base_Unit AS ProjectUnit ON Project.UnitId = ProjectUnit.UnitId
|
||||
LEFT JOIN dbo.WBS_UnitWork AS WorkArea ON WorkArea.UnitWorkId = Registration.Place
|
||||
LEFT JOIN dbo.HSSE_Hazard_HazardRegisterTypes AS RegisterTypes ON RegisterTypes.RegisterTypesId = Registration.RegisterTypesId
|
||||
LEFT JOIN dbo.HSSE_Hazard_HazardRegisterTypes AS RegisterTypes2 ON RegisterTypes2.RegisterTypesId = Registration.RegisterTypes2Id
|
||||
LEFT JOIN dbo.HSSE_Hazard_HazardRegisterTypes AS RegisterTypes3 ON RegisterTypes3.RegisterTypesId = Registration.RegisterTypes3Id
|
||||
LEFT JOIN dbo.HSSE_Hazard_HazardRegisterTypes AS RegisterTypes4 ON RegisterTypes4.RegisterTypesId = Registration.RegisterTypes4Id
|
||||
LEFT JOIN dbo.Base_Unit AS Unit ON Unit.UnitId = Registration.ResponsibleUnit
|
||||
LEFT JOIN dbo.Person_Persons AS User1 ON User1.PersonId = Registration.ResponsibleMan
|
||||
LEFT JOIN dbo.Person_Persons AS User2 ON User2.PersonId = Registration.CheckManId
|
||||
LEFT JOIN dbo.Person_Persons AS User3 ON User3.PersonId = Registration.ConfirmMan
|
||||
LEFT JOIN dbo.Person_Persons AS User4 ON User4.PersonId = Registration.ResponsibleMan2
|
||||
go
|
||||
@@ -0,0 +1,88 @@
|
||||
|
||||
update Check_CheckSpecialDetail
|
||||
set HiddenHazardType=1
|
||||
where HiddenHazardType='0' or HiddenHazardType='低' or HiddenHazardType='一般' or HiddenHazardType='' or HiddenHazardType is null
|
||||
|
||||
go
|
||||
update Check_CheckSpecialDetail
|
||||
set HiddenHazardType=2
|
||||
where HiddenHazardType='较大' or HiddenHazardType='较高'
|
||||
|
||||
go
|
||||
update Check_CheckSpecialDetail
|
||||
set HiddenHazardType=3
|
||||
where HiddenHazardType='高' or HiddenHazardType='重大'
|
||||
|
||||
go
|
||||
|
||||
|
||||
|
||||
ALTER VIEW [dbo].[View_CheckSpecialDetail]
|
||||
AS
|
||||
/*专项检查明细列表视图*/
|
||||
SELECT detail.CheckSpecialDetailId,
|
||||
detail.CheckSpecialId,
|
||||
detail.CheckItem,
|
||||
checkItemSet.RegisterTypesName as CheckItemName,
|
||||
--detail.CheckItemType,
|
||||
detail.Unqualified,
|
||||
detail.SortIndex,
|
||||
detail.UnitId,
|
||||
detail.HandleStep,
|
||||
detail.CompleteStatus,
|
||||
(case when detail.CompleteStatus =1 then '已整改' else '待整改' end) as CompleteStatusName,
|
||||
detail.LimitedDate,
|
||||
detail.CompletedDate,
|
||||
--detail.Suggestions,
|
||||
detail.CheckContent,
|
||||
detail.CheckArea,
|
||||
'' as HandleWay,
|
||||
detail.Suggestions,
|
||||
detail.HandleStep as RectifyOpinion,
|
||||
'd72a27c9-4ba9-41c5-ab0b-c010409f20f2' as ProposeUnitId,
|
||||
workArea.UnitWorkName + (CASE WHEN workArea.ProjectType ='1' THEN '(建筑)'
|
||||
WHEN workArea.ProjectType ='2' THEN '(安装)' ELSE '' END)AS CheckAreaName,
|
||||
detail.DataId,
|
||||
detail.DataType,
|
||||
unit.UnitName,
|
||||
dbo.GetConstTextByIds(detail.HandleStep) as HandleStepStr,
|
||||
--const.ConstText as HandleStepStr,
|
||||
(CASE WHEN detail.DataType like '%1%'
|
||||
THEN '下发整改单:'+(SELECT RectifyNoticesCode FROM Check_RectifyNotices WHERE detail.DataId like '%'+RectifyNoticesId+'%')
|
||||
else '' end)+
|
||||
(CASE WHEN detail.DataType like '%2%'
|
||||
THEN '下发处罚单:'+(SELECT PunishNoticeCode FROM Check_PunishNotice WHERE detail.DataId like '%'+PunishNoticeId+'%')
|
||||
else '' end)+
|
||||
(CASE WHEN detail.DataType = '3'
|
||||
THEN '下发暂停令:'+(SELECT PauseNoticeCode FROM Check_PauseNotice WHERE detail.DataId like '%'+ PauseNoticeId+'%')
|
||||
else '' end) AS HandleStepLink
|
||||
,
|
||||
--(case when detail.riskLevel ='0' then '低'
|
||||
-- when detail.riskLevel = '1' then '一般'
|
||||
-- when detail.riskLevel = '2' then '较高'
|
||||
-- when detail.riskLevel = '3' then '高'
|
||||
-- else detail.riskLevel end) as riskLevel,
|
||||
(case when detail.HiddenHazardType = '1' then '一般'
|
||||
when detail.HiddenHazardType = '2' then '较高'
|
||||
when detail.HiddenHazardType = '3' then '高'
|
||||
else '一般' end) as riskLevel,
|
||||
--sysuser.PersonName as HSEManage
|
||||
'' as HSEManage
|
||||
,(CASE WHEN detail.HiddenHazardType='3' THEN '重大'
|
||||
WHEN detail.HiddenHazardType='2' THEN '较大'
|
||||
WHEN detail.HiddenHazardType='1' THEN '一般' ELSE '' END) AS HiddenHazardTypeName
|
||||
FROM dbo.Check_CheckSpecialDetail AS detail
|
||||
LEFT JOIN dbo. HSSE_Hazard_HazardRegisterTypes AS checkItemSet ON checkItemSet.RegisterTypesId=detail.CheckItem
|
||||
LEFT JOIN dbo.Base_Unit AS unit ON unit.UnitId=detail.UnitId
|
||||
LEFT JOIN dbo.WBS_UnitWork AS workArea ON detail.CheckArea=workArea.UnitWorkId
|
||||
--LEFT JOIN dbo.Person_Persons AS sysuser ON sysuser.PersonId=detail.HSEManage
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
GO
|
||||
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
|
||||
|
||||
--作业票定稿补充字段:来源说明
|
||||
IF NOT EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'License_LicenseManager' AND COLUMN_NAME = 'SourceDes')
|
||||
BEGIN
|
||||
ALTER TABLE License_LicenseManager ADD SourceDes nvarchar(500);
|
||||
END
|
||||
GO
|
||||
|
||||
-- 修改视图
|
||||
ALTER VIEW [dbo].[View_License_LicenseManager] AS SELECT LicenseManager.LicenseManagerId,
|
||||
LicenseManager.ProjectId,
|
||||
LicenseManager.LicenseTypeId,
|
||||
LicenseManager.LicenseManagerCode,
|
||||
LicenseManager.LicenseManageName,
|
||||
LicenseManager.UnitId,
|
||||
LicenseManager.LicenseManageContents,
|
||||
LicenseManager.CompileMan,
|
||||
LicenseManager.CompileDate,
|
||||
LicenseManager.States,
|
||||
Project.ProjectCode,
|
||||
Project.ProjectName,
|
||||
LicenseType.LicenseTypeName,
|
||||
Unit.UnitName,
|
||||
UnitType.UnitTypeId,
|
||||
UnitType.UnitTypeName,
|
||||
Users.PersonName as UserName,
|
||||
LicenseManager.WorkAreaId,
|
||||
--WorkArea.WorkAreaName,
|
||||
LicenseManager.StartDate,
|
||||
LicenseManager.EndDate,
|
||||
LicenseManager.ApplicantMan,
|
||||
LicenseManager.IsHighRisk,
|
||||
LicenseManager.WorkStates,
|
||||
LicenseManager.IsUpdate,
|
||||
--LicenseManager.SourceDes,
|
||||
--LicenseManager.LicenseCodes,
|
||||
'' as SourceDes,
|
||||
'' as LicenseCodes,
|
||||
case LicenseManager.WorkStates when '1' then '待开工'
|
||||
when '2' then '作业中'
|
||||
when '3' then '已关闭'
|
||||
when '-1' then '已取消'
|
||||
else '' end as WorkStatesStr,
|
||||
WorkAreaName = STUFF(( SELECT ',' + UnitWorkName FROM WBS_UnitWork
|
||||
where PATINDEX('%,' + RTRIM(WBS_UnitWork.UnitWorkId) + ',%',',' + LicenseManager.WorkAreaId + ',')>0
|
||||
ORDER BY PATINDEX('%,' + RTRIM(LicenseManager.WorkAreaId) + ',%',',' + LicenseManager.WorkAreaId + ',')
|
||||
FOR XML PATH('')), 1, 1,'')
|
||||
FROM dbo.License_LicenseManager AS LicenseManager
|
||||
LEFT JOIN dbo.Base_Project AS Project ON Project.ProjectId = LicenseManager.ProjectId
|
||||
LEFT JOIN dbo.Base_LicenseType AS LicenseType ON LicenseType.LicenseTypeId = LicenseManager.LicenseTypeId
|
||||
LEFT JOIN dbo.Base_Unit AS Unit ON Unit.UnitId = LicenseManager.UnitId
|
||||
LEFT JOIN dbo.Person_Persons AS Users ON Users.PersonId = LicenseManager.CompileMan
|
||||
LEFT JOIN dbo.WBS_UnitWork AS WorkArea ON WorkArea.UnitWorkId = LicenseManager.WorkAreaId
|
||||
LEFT JOIN dbo.Base_UnitType as UnitType ON UnitType.UnitTypeId=Unit.UnitTypeId
|
||||
|
||||
GO
|
||||
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
|
||||
|
||||
|
||||
--企业大检查移到督查管理下
|
||||
update Sys_Menu set MenuType = 'Menu_System_Hsse_S_DCGL' where MenuId ='CD9FC4C8-4B02-4619-8B02-50DA6AE6146E' and MenuType = 'Menu_System_Hsse_S_Hsse';
|
||||
|
||||
|
||||
--企业大检查下面的企业安全检查,企业安全检查记录也移到督查管理下
|
||||
update Sys_Menu set MenuType = 'Menu_System_Hsse_S_DCGL' where MenuId ='73283863-CF67-44CA-9DF8-67071734A528' and MenuType = 'Menu_System_Hsse_S_Hsse';
|
||||
update Sys_Menu set MenuType = 'Menu_System_Hsse_S_DCGL' where MenuId ='C46C007E-A100-4A52-9317-3B885442E130' and MenuType = 'Menu_System_Hsse_S_Hsse';
|
||||
|
||||
|
||||
|
||||
--隐藏掉原来的安全监督检查报告
|
||||
update Sys_Menu set IsUsed = '0' where MenuId ='40387C48-95A0-435C-82FB-57AF0A81B9D4' and MenuType = 'Menu_System_Hsse_S_Hsse';
|
||||
|
||||
--隐藏原来的安全监督检查整改
|
||||
update Sys_Menu set IsUsed = '0' where MenuId ='A02E0365-383C-49A0-BF1A-B3E42052959B' and MenuType = 'Menu_System_Hsse_S_Hsse';
|
||||
|
||||
|
||||
|
||||
--隐藏问题类别定义
|
||||
update Sys_Menu set IsUsed = '0' where MenuId ='3044D68E-5018-4B57-BFC4-FBE4BCCA8B8B';
|
||||
|
||||
--隐藏执业资格证书定义
|
||||
update Sys_Menu set IsUsed = '0' where MenuId ='1390195D8-874B-4E7B-8DBF-D81A5984E973'
|
||||
|
||||
|
||||
--隐藏合同设置
|
||||
update Sys_Menu set IsUsed = '0' where MenuId ='24A40837-0756-49B0-8B3C-EFB8A9879336';
|
||||
|
||||
|
||||
|
||||
--隐藏作业人员角色定义
|
||||
update Sys_Menu set IsUsed = '0' where MenuId ='4AEA28ED-327C-4A8F-977D-BB56F423CEA4';
|
||||
|
||||
--隐藏管理人员角色定义
|
||||
update Sys_Menu set IsUsed = '0' where MenuId ='145523FE-B49A-4420-9DFB-565A79F4AF36';
|
||||
|
||||
|
||||
|
||||
--隐藏质量月
|
||||
update Sys_Menu set IsUsed = '0' where MenuId ='B6A867A0-3EBB-4EFC-8BCC-050816547BBE' and MenuType = 'Menu_System_Hsse_P_Hsse';
|
||||
update Sys_Menu set IsUsed = '0' where MenuId ='ED3846F3-B677-4958-A85C-BF235909B071' and MenuType = 'Menu_System_Hsse_S_Hsse';
|
||||
Reference in New Issue
Block a user