CNCEC_SUBQHSE_WUHUAN/DataBase/版本日志/SGGLDB_WH_2023-10-25.sql

729 lines
61 KiB
MySQL
Raw Normal View History

2023-10-26 15:38:13 +08:00
<EFBFBD><EFBFBD>--_/TX[<EFBFBD> zgbL<EFBFBD>api<EFBFBD>c<EFBFBD>SM<EFBFBD>n
sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'Ole Automation Procedures', 1;
GO
RECONFIGURE;
GO
EXEC sp_configure 'Ole Automation Procedures';
GO
INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed)
VALUES('D1BB76A7-B273-4636-B414-49B93231780D','<00>e<EFBFBD>]<5D>~He<48>{t','',180,'0','Menu_CQMS',0,0,1)
GO
--<EFBFBD>X<EFBFBD>R<EFBFBD>e<EFBFBD>]<EFBFBD>~He
INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed)
VALUES('B96FEF05-CA28-4450-ACE6-9FA654CE7F6D','<00>e<EFBFBD>]<5D>~He','CQMS/Performance/Performance.aspx',10,
'D1BB76A7-B273-4636-B414-49B93231780D','Menu_CQMS',0,1,1)
GO
--<EFBFBD>X<EFBFBD>R<EFBFBD>e<EFBFBD>]<EFBFBD>~HeSbR
INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed)
VALUES('888962E7-EF4E-43C7-B835-BAE0249DCA3F','<00>e<EFBFBD>]<5D>~He<48>[ybSbR','CQMS/Performance/PerformanceAudit.aspx',15,
'D1BB76A7-B273-4636-B414-49B93231780D','Menu_CQMS',0,1,1)
GO
--<EFBFBD>X<EFBFBD>R<EFBFBD>e<EFBFBD>]<EFBFBD>~He<EFBFBD><EFBFBD>n
INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed)
VALUES('753BED05-3B04-43F3-9D97-1534C581A49F','<00>e<EFBFBD>]<5D>~He<48><65>n','CQMS/Performance/PerformanceConfig.aspx',20,
'D1BB76A7-B273-4636-B414-49B93231780D','Menu_CQMS',0,1,1)
GO
INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex)
VALUES('FFB401C2-C071-42EF-A50C-5CA2AD62ED55','B96FEF05-CA28-4450-ACE6-9FA654CE7F6D','<00>X<EFBFBD>R',1)
INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex)
VALUES('34A474D7-AD30-4B31-958C-7CDCBEA23FDE','B96FEF05-CA28-4450-ACE6-9FA654CE7F6D','<00>O9e',2)
INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex)
VALUES('C9768A14-0032-460D-9721-D1C37AE3C30C','B96FEF05-CA28-4450-ACE6-9FA654CE7F6D',' Rd<52>',3)
INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex)
VALUES('FED18627-41AD-4D98-9E0A-8C68871D641E','B96FEF05-CA28-4450-ACE6-9FA654CE7F6D','<00>OX[',4)
GO
CREATE TABLE [dbo].[CQMS_Performance](
[PerformanceGid] [nvarchar](50) NOT NULL,
[HeadUserid] [nvarchar](50) NULL,
[ProOutputValue] [decimal](18, 2) NULL,
[SubUserids] [nvarchar](2000) NULL,
[SubpackageUserids] [nvarchar](2000) NULL,
[TotalScore] [decimal](18, 2) NULL,
[ProjectId] [nvarchar](50) NULL,
[CreateDate] [datetime] NULL,
[CreateMan] [nvarchar](50) NULL,
[CreateDateMonth] [nvarchar](50) NULL,
[States] [nvarchar](50) NULL,
CONSTRAINT [PK_CQMS_Performance] PRIMARY KEY CLUSTERED
(
[PerformanceGid] 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
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N';N.<2E>id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'CQMS_Performance', @level2type=N'COLUMN',@level2name=N'PerformanceGid'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'<00>N<EFBFBD>s<1F>#<23><>N' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'CQMS_Performance', @level2type=N'COLUMN',@level2name=N'HeadUserid'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'NN<>N<P' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'CQMS_Performance', @level2type=N'COLUMN',@level2name=N'ProOutputValue'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'RSFU<1F>#<23><>N<08>Y <09> <09>' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'CQMS_Performance', @level2type=N'COLUMN',@level2name=N'SubUserids'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'RS<>] z^<08>Y <09> <09>' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'CQMS_Performance', @level2type=N'COLUMN',@level2name=N'SubpackageUserids'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N';`<60><><EFBFBD>_R' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'CQMS_Performance', @level2type=N'COLUMN',@level2name=N'TotalScore'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N't^g' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'CQMS_Performance', @level2type=N'COLUMN',@level2name=N'CreateDate'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'kX<6B>Q<EFBFBD>N' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'CQMS_Performance', @level2type=N'COLUMN',@level2name=N'CreateMan'
GO
CREATE TABLE [dbo].[CQMS_Performance_Child1](
[Performance_ChildGid1] [nvarchar](50) NOT NULL,
[PerformanceGid] [nvarchar](50) NULL,
[PType] [nvarchar](50) NULL,
[EvaScore] [decimal](18, 2) NULL,
[Itemize] [nvarchar](50) NULL,
[WorkArea] [nvarchar](50) NULL,
[MonthTarget] [nvarchar](500) NULL,
[SortIndex] [int] NULL,
[CreateMan] [nvarchar](50) NULL,
CONSTRAINT [PK_CQMS_Performance_Child1] PRIMARY KEY CLUSTERED
(
[Performance_ChildGid1] 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
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N';Nh<4E>;N.<2E>' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'CQMS_Performance_Child1', @level2type=N'COLUMN',@level2name=N'PerformanceGid'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'{|+R' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'CQMS_Performance_Child1', @level2type=N'COLUMN',@level2name=N'PType'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ċ<>N<EFBFBD>_R
' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'CQMS_Performance_Child1', @level2type=N'COLUMN',@level2name=N'EvaScore'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Ry<52>
' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'CQMS_Performance_Child1', @level2type=N'COLUMN',@level2name=N'Itemize'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'<00>e<EFBFBD>]:S<>W
' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'CQMS_Performance_Child1', @level2type=N'COLUMN',@level2name=N'WorkArea'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'g<><67><EFBFBD>p<EFBFBD>vh
' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'CQMS_Performance_Child1', @level2type=N'COLUMN',@level2name=N'MonthTarget'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'<00>c<EFBFBD>^<5E>^<5E>S' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'CQMS_Performance_Child1', @level2type=N'COLUMN',@level2name=N'SortIndex'
GO
CREATE TABLE [dbo].[CQMS_Performance_Child2](
[Performance_ChildGid2] [nvarchar](50) NOT NULL,
[Performance_ChildGid1] [nvarchar](50) NULL,
[PerformanceGid] [nvarchar](50) NULL,
[TaskContent] [nvarchar](500) NULL,
[ProjectQuantity] [nvarchar](500) NULL,
[DemandPlan] [nvarchar](500) NULL,
[TaskCompletContent] [nvarchar](500) NULL,
[NowWeek] [int] NULL,
[SortIndex] [int] NULL,
[CreateMan] [nvarchar](50) NULL,
CONSTRAINT [PK_CQMS_Performance_Child2] PRIMARY KEY CLUSTERED
(
[Performance_ChildGid2] 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
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'P[h<>1;N.<2E>' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'CQMS_Performance_Child2', @level2type=N'COLUMN',@level2name=N'Performance_ChildGid1'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'<00>N<EFBFBD>R<EFBFBD>[<5B>c' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'CQMS_Performance_Child2', @level2type=N'COLUMN',@level2name=N'TaskContent'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'<00>] ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'CQMS_Performance_Child2', @level2type=N'COLUMN',@level2name=N'ProjectQuantity'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'<00>NPg:gD<67><44>n<00>Bl<42><6C>R' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'CQMS_Performance_Child2', @level2type=N'COLUMN',@level2name=N'DemandPlan'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N',ghT<68>]\O<>N<EFBFBD>R<EFBFBD>[b<>`<60>Q' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'CQMS_Performance_Child2', @level2type=N'COLUMN',@level2name=N'TaskCompletContent'
GO
CREATE TABLE [dbo].[CQMS_Performance_Child3](
[Performance_ChildGid3] [nvarchar](50) NOT NULL,
[Performance_ChildGid2] [nvarchar](50) NULL,
[PerformanceGid] [nvarchar](50) NULL,
[WorkPlan] [nvarchar](500) NULL,
[CompletStatus] [nvarchar](500) NULL,
[CurrentDate] [datetime] NULL,
[CreateMan] [nvarchar](50) NULL,
[ProjectId] [nvarchar](50) NULL,
CONSTRAINT [PK_CQMS_Performance_Child3] PRIMARY KEY CLUSTERED
(
[Performance_ChildGid3] 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
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'P[h<>2;N.<2E>' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'CQMS_Performance_Child3', @level2type=N'COLUMN',@level2name=N'Performance_ChildGid2'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'S_MR<4D>eg' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'CQMS_Performance_Child3', @level2type=N'COLUMN',@level2name=N'CurrentDate'
GO
CREATE TABLE [dbo].[CQMS_Performance_SetUp](
[PerformanceSteUpGid] [nvarchar](50) NOT NULL,
[SetUpMonth] [nvarchar](50) NULL,
[SetUpStartDate] [nvarchar](50) NULL,
[SetUpEndDate] [nvarchar](50) NULL,
[SetUpWeek] [int] NULL,
[CreateDate] [datetime] NULL,
[CreateYear] [nvarchar](50) NULL,
[SortIndex] [int] NULL,
CONSTRAINT [PK_CQMS_Performance_SetUp] PRIMARY KEY CLUSTERED
(
[PerformanceSteUpGid] 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
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'S_MRt^g' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'CQMS_Performance_SetUp', @level2type=N'COLUMN',@level2name=N'SetUpMonth'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'_<>Y:S<><53>' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'CQMS_Performance_SetUp', @level2type=N'COLUMN',@level2name=N'SetUpStartDate'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'<00>~_g:S<><53>' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'CQMS_Performance_SetUp', @level2type=N'COLUMN',@level2name=N'SetUpEndDate'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'hTpe' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'CQMS_Performance_SetUp', @level2type=N'COLUMN',@level2name=N'SetUpWeek'
GO
--<EFBFBD>m<EFBFBD>R<EFBFBD>c<EFBFBD>api<EFBFBD>c<EFBFBD>SX[<EFBFBD> z
Create PROCEDURE [dbo].[Proc_CallWebApi]
-- Add the parameters for the stored procedure here
@userId NVARCHAR(2000),--<EFBFBD><EFBFBD><EFBFBD><EFBFBD>S<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>vuserid<EFBFBD><EFBFBD><EFBFBD>SR<EFBFBD><EFBFBD> <EFBFBD>
@thing2 nvarchar(2000),--<EFBFBD>S<EFBFBD><EFBFBD>v<EFBFBD>mo`<EFBFBD>Q<EFBFBD>[
@name1 nvarchar(50),--<EFBFBD>Sw<EFBFBD><EFBFBD>N
@date3 datetime,--<EFBFBD>S<EFBFBD><EFBFBD>v<EFBFBD>eg
@ResponseText NVARCHAR(4000) OUTPUT
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
-- Insert statements for procedure here
DECLARE @data varchar(8000);
DECLARE @ApiUrl VARCHAR(200);
DECLARE @RequestType VARCHAR(5);--<EFBFBD><EFBFBD>Bl{|<EFBFBD>W:POST,GET
DECLARE @date2 varchar(100);
set @date2 = CONVERT(varchar(100), @date3, 0)
--API0W@W
set @ApiUrl='http://192.168.1.105/api/Common/getSubscribeMessage?userId='+@userId+'&thing2='+
@thing2+'&name1='+@name1+'&date3='+@date2;
set @RequestType='GET';
--<EFBFBD>S<EFBFBD>penc
set @data=''
Declare @Object as Int
Exec sp_OACreate 'Msxml2.ServerXMLHTTP.3.0', @Object OUT
Exec sp_OAMethod @Object, 'open', NULL, @RequestType,@ApiUrl,'false'
IF @RequestType='POST'
BEGIN
Exec sp_OAMethod @Object, 'setRequestHeader', NULL, 'Content-Type','application/x-www-form-urlencoded'
END
Exec sp_OAMethod @Object, 'setRequestHeader', NULL, 'token','C4A62EC0-E5D3-4EBF-A5FA-E56AA89633C0'
Exec sp_OAMethod @Object, 'send', NULL, @data --<EFBFBD>S<EFBFBD>penc
Exec sp_OAMethod @Object, 'responseText', @ResponseText OUTPUT
--EXEC sp_OAGetErrorInfo @Object --_8^<EFBFBD><EFBFBD><EFBFBD>Q
--Select @ResponseText as ResponseText
--Select * from [dbo].[ParseJSON](@ResponseText)
Exec sp_OADestroy @Object
END
2023-10-26 16:16:06 +08:00
GO
2023-10-26 15:38:13 +08:00
--<EFBFBD>k)Y NHS4<EFBFBD>p<EFBFBD>[<EFBFBD>egbL<EFBFBD> <EFBFBD><EFBFBD>g<EFBFBD><EFBFBD>@b g<EFBFBD>e<EFBFBD>]<EFBFBD>~Heh<EFBFBD> <EFBFBD>S_)Y<EFBFBD>l gkX<EFBFBD>Qpenc<EFBFBD>v<EFBFBD>N <EFBFBD>6qT<EFBFBD>c<EFBFBD>
CREATE PROCEDURE [dbo].[Sp_APP_PerformanceByTime]
AS
BEGIN
declare @ResponseText NVARCHAR(4000);
DECLARE @PostUserid nvarchar(2000);
--<EFBFBD>[IN8nh<EFBFBD>g<EFBFBD><EFBFBD>
DECLARE @Userid nvarchar(50);--(u7bid
DECLARE My_Cursor CURSOR --<EFBFBD>[IN8nh
FOR ( select Top 1 Child3.CreateMan from CQMS_Performance_Child3 Child3
LEFT JOIN CQMS_Performance as Perfor ON Perfor.PerformanceGid=Child3.PerformanceGid
where Child3.WorkPlan=''
and CONVERT(varchar(100), Child3.CurrentDate, 23)=CONVERT(varchar(100), GETDATE(), 23) )
OPEN My_Cursor;--Sb_8nh
FETCH NEXT FROM My_Cursor INTO @Userid;--<EFBFBD><EFBFBD><EFBFBD>S,{NL<EFBFBD>penc
WHILE @@FETCH_STATUS=0
--ُ̑<EFBFBD>[8nh<EFBFBD>v<EFBFBD>r`ۏL<EFBFBD>$R<EFBFBD>e <EFBFBD><EFBFBD>Y<EFBFBD>g:N0 <EFBFBD><EFBFBD><EFBFBD>f8nh-N g<P
BEGIN
declare @dateNow datetime;
set @dateNow=getdate();
--gbL<EFBFBD><EFBFBD>c<EFBFBD>apiX[<EFBFBD> z
exec Proc_CallWebApi @Userid,'<00>`<60>N<EFBFBD>e<EFBFBD>v<EFBFBD>e<EFBFBD>]<5D>~He\*gkX<6B>Q','<00>|<7C>~<7E>{tXT',@dateNow,@ResponseText output;
FETCH NEXT
FROM
My_Cursor INTO @Userid;
END CLOSE My_Cursor;--sQ<EFBFBD><EFBFBD>8nh
DEALLOCATE My_Cursor;--ʑ>e8nh
END
2023-10-26 16:16:06 +08:00
GO
ALTER PROCEDURE [dbo].[Sp_APP_GetToDoItems]
@projectId NVARCHAR(50)=NULL,
@userId NVARCHAR(200)=NULL
AS
/*<EFBFBD><EFBFBD><EFBFBD>SS_MR<EFBFBD>N<EFBFBD>_<EFBFBD>R<EFBFBD>Ny<EFBFBD>*/
BEGIN
SELECT HazardRegisterId AS DataId
,'B6BE5FE0-CB84-47FF-A6C3-5AD9E1CCE079' AS MenuId
,'<00>[hQ<68>]<5D>h' AS MenuName
,register.RegisterDef AS Content
,UserId
,users.UserName
,register.RegisterDate AS DataTime
,CONVERT(varchar(100),register.RegisterDate, 23) AS DataTimeStr
,'/pagesHSSE/safe/inspecitonconfirm' AS UrlStr
FROM HSSE_Hazard_HazardRegister AS register
LEFT JOIN Sys_User AS users ON users.UserId =@userId
WHERE register.ProjectId=@projectId AND
((register.states = '1' AND (register.ResponsibleMan =@userId OR register.CCManIds LIKE ('%'+@userId+'%') ))
OR (register.states = '2' AND register.CheckManId =@userId))
UNION ALL
SELECT PlanId AS DataId
,'B782A26B-D85C-4F84-8B45-F7AA47B3159E' AS MenuId
,'<00>W<EFBFBD><57><EFBFBD><EFBFBD>R' AS MenuName
,PlanName AS Content
,UserId
,users.UserName
,DesignerDate AS DataTime
,CONVERT(varchar(100),DesignerDate, 23) AS DataTimeStr
,'/pagesTest/test/trainindex' AS UrlStr
FROM Training_Plan AS ePlan
LEFT JOIN Sys_User AS users ON ePlan.DesignerId= users.UserId
WHERE (ePlan.ProjectId=@projectId or (@projectId is null and ePlan.ProjectId is null))
AND (States = '0' OR States = '1' ) AND ePlan.DesignerId =@userId
UNION ALL
SELECT TestPlanId AS DataId
,'FAF7F4A4-A4BC-4D94-9E88-0CF5A380DB34' AS MenuId
,'<03>Ջ<EFBFBD><D58B>R' AS MenuName
,PlanName AS Content
,UserId
,users.UserName
,PlanDate AS DataTime
,CONVERT(varchar(100),PlanDate, 23) AS DataTimeStr
,'/pagesTest/test/testplan' AS UrlStr
FROM Training_TestPlan AS TPlan
LEFT JOIN Sys_User AS users ON users.UserId =TPlan.PlanManId
WHERE (TPlan.ProjectId=@projectId or (@projectId is null and TPlan.ProjectId is null))
AND (States = '0' OR States = '1' ) AND PlanManId =@userId
UNION ALL
SELECT TaskId AS DataId
,'E108F75D-89D0-4DCA-8356-A156C328805C' AS MenuId
,'<00>W<EFBFBD><57><EFBFBD>N<EFBFBD>R' AS MenuName
,Plans.PlanName AS Content
,users.UserId
,users.UserName
,TaskDate AS DataTime
,CONVERT(varchar(100),TaskDate, 23) AS DataTimeStr
,('/pagesTest/test/taskindex') AS UrlStr
FROM Training_Task AS Task
LEFT JOIN Sys_User AS users ON users.UserId =@userId
LEFT JOIN Training_Plan AS Plans ON Plans.PlanId =Task.PlanId
WHERE (Task.ProjectId=@projectId or (@projectId is null and Task.ProjectId is null))
AND (Task.States IS NULL OR Task.States != 2)
AND Task.UserId = @userId
UNION ALL
SELECT TestRecordId AS DataId
,'0EEB138D-84F9-4686-8CBB-CAEAA6CF1B2A' AS MenuId
,'kbx<03>Ջ' AS MenuName
,TestPlan.PlanName AS Content
,TestRecord.TestManId
,Person.PersonName
,TestPlan.TestStartTime AS DataTime
,CONVERT(varchar(100),TestPlan.TestStartTime, 23) AS DataTimeStr
,('/pages/temp_index/index') AS UrlStr
FROM Training_TestRecord AS TestRecord
left join Training_TestPlan as TestPlan on TestRecord.TestPlanId = TestPlan.TestPlanId
left join SitePerson_Person as Person on Person.PersonId = TestRecord.TestManId
left join Sys_User as uses on Person.IdentityCard = uses.IdentityCard
WHERE (TestRecord.ProjectId=@projectId or (@projectId is null and TestRecord.ProjectId is null))
AND TestPlan.States ='1'
AND TestRecord.TestEndTime IS NULL
AND (TestRecord.TestManId = @userId or uses.UserId = @userId)
UNION ALL
SELECT FireWorkId AS DataId
,'2E58D4F1-2FF1-450E-8A00-1CE3BBCF8D4B' AS MenuId
,'<00>Rkp\ON' AS MenuName
,LicenseCode AS Content
,UserId
,users.UserName
,ApplyDate AS DataTime
,CONVERT(varchar(100),ApplyDate, 23) AS DataTimeStr
,(CASE WHEN States = '0' THEN '/pagesWork/dhuo/add'
ELSE '/pagesWork/dhuo/approval' END) AS UrlStr
FROM License_FireWork AS License
LEFT JOIN Sys_User AS users ON users.UserId =License.NextManId
WHERE License.ProjectId=@projectId
AND (States = '0' OR States = '1' OR States= '6')
AND License.NextManId LIKE '%'+ @userId+'%'
UNION ALL
SELECT HeightWorkId AS DataId
,'DA1CAE8E-B5BF-4AC0-9996-AF6CAA412CA9' AS MenuId
,'ؚY\ON' AS MenuName
,LicenseCode AS Content
,UserId
,users.UserName
,ApplyDate AS DataTime
,CONVERT(varchar(100),ApplyDate, 23) AS DataTimeStr
,(CASE WHEN States = '0' THEN '/pagesWork/gchu/add'
ELSE '/pagesWork/dhuo/approval' END) AS UrlStr
FROM License_HeightWork AS License
LEFT JOIN Sys_User AS users ON users.UserId =License.NextManId
WHERE License.ProjectId=@projectId
AND (States = '0' OR States = '1' OR States= '6')
AND License.NextManId LIKE '%'+ @userId+'%'
UNION ALL
SELECT LimitedSpaceId AS DataId
,'AEC9166D-1C91-45F0-8BFE-D3D0479A28C7' AS MenuId
,'<00>SP<53>zz<7A><7A>' AS MenuName
,LicenseCode AS Content
,UserId
,users.UserName
,ApplyDate AS DataTime
,CONVERT(varchar(100),ApplyDate, 23) AS DataTimeStr
,(CASE WHEN States = '0' THEN '/pagesWork/sxkj/add'
ELSE '/pagesWork/dhuo/approval' END) AS UrlStr
FROM License_LimitedSpace AS License
LEFT JOIN Sys_User AS users ON users.UserId =License.NextManId
WHERE License.ProjectId=@projectId
AND (States = '0' OR States = '1' OR States= '6')
AND License.NextManId LIKE '%'+ @userId+'%'
UNION ALL
SELECT RadialWorkId AS DataId
,'F72FF20B-D3EB-46A5-97F7-C99B2473A140' AS MenuId
,'\<5C>~\ON' AS MenuName
,LicenseCode AS Content
,UserId
,users.UserName
,ApplyDate AS DataTime
,CONVERT(varchar(100),ApplyDate, 23) AS DataTimeStr
,(CASE WHEN States = '0' THEN '/pagesWork/sx/add'
ELSE '/pagesWork/dhuo/approval' END) AS UrlStr
FROM License_RadialWork AS License
LEFT JOIN Sys_User AS users ON users.UserId =License.NextManId
WHERE License.ProjectId=@projectId
AND (States = '0' OR States = '1' OR States= '6')
AND License.NextManId LIKE '%'+ @userId+'%'
UNION ALL
SELECT OpenCircuitId AS DataId
,'4E607E83-41FC-4F49-B26F-A21CFE38328F' AS MenuId
,'<00>e<EFBFBD><65>(`SS<53>)' AS MenuName
,LicenseCode AS Content
,UserId
,users.UserName
,ApplyDate AS DataTime
,CONVERT(varchar(100),ApplyDate, 23) AS DataTimeStr
,(CASE WHEN States = '0' THEN '/pagesWork/dlu/add'
ELSE '/pagesWork/dhuo/approval' END) AS UrlStr
FROM License_OpenCircuit AS License
LEFT JOIN Sys_User AS users ON users.UserId =License.NextManId
WHERE License.ProjectId=@projectId
AND (States = '0' OR States = '1' OR States= '6')
AND License.NextManId LIKE '%'+ @userId+'%'
UNION ALL
SELECT BreakGroundId AS DataId
,'755C6AC9-2E38-4D4F-AF33-33CB1744A907' AS MenuId
,'<00>RW\ON' AS MenuName
,LicenseCode AS Content
,UserId
,users.UserName
,ApplyDate AS DataTime
,CONVERT(varchar(100),ApplyDate, 23) AS DataTimeStr
,(CASE WHEN States = '0' THEN '/pagesWork/dtu/add'
ELSE '/pagesWork/dhuo/approval' END) AS UrlStr
FROM License_BreakGround AS License
LEFT JOIN Sys_User AS users ON users.UserId =License.NextManId
WHERE License.ProjectId=@projectId
AND (States = '0' OR States = '1' OR States= '6')
AND License.NextManId LIKE '%'+ @userId+'%'
UNION ALL
SELECT NightWorkId AS DataId
,'7BBAE649-7B00-4475-A911-BFE3A37AC55B' AS MenuId
,'Y<><59><EFBFBD>e<EFBFBD>]' AS MenuName
,LicenseCode AS Content
,UserId
,users.UserName
,ApplyDate AS DataTime
,CONVERT(varchar(100),ApplyDate, 23) AS DataTimeStr
,(CASE WHEN States = '0' THEN '/pagesWork/yjsg/add'
ELSE '/pagesWork/dhuo/approval' END) AS UrlStr
FROM License_NightWork AS License
LEFT JOIN Sys_User AS users ON users.UserId =License.NextManId
WHERE License.ProjectId=@projectId
AND (States = '0' OR States = '1' OR States= '6')
AND License.NextManId LIKE '%'+ @userId+'%'
UNION ALL
SELECT LiftingWorkId AS DataId
,'A1BE3AB6-9D4A-41E7-8870-E73423165451' AS MenuId
,'
\ON' AS MenuName
,LicenseCode AS Content
,UserId
,users.UserName
,ApplyDate AS DataTime
,CONVERT(varchar(100),ApplyDate, 23) AS DataTimeStr
,(CASE WHEN States = '0' THEN '/pagesWork/dzhuang/add'
ELSE '/pagesWork/dhuo/approval' END) AS UrlStr
FROM License_LiftingWork AS License
LEFT JOIN Sys_User AS users ON users.UserId =License.NextManId
WHERE License.ProjectId=@projectId
AND (States = '0' OR States = '1' OR States= '6')
AND License.NextManId LIKE '%'+ @userId+'%'
UNION ALL
SELECT ElectricityId AS DataId
,'48F64E0F-38B2-4BDC-9B61-6200BD02CBF5' AS MenuId
,'4N<34>e(u5u' AS MenuName
,LicenseCode AS Content
,UserId
,users.UserName
,ApplyDate AS DataTime
,CONVERT(varchar(100),ApplyDate, 23) AS DataTimeStr
,(CASE WHEN States = '0' THEN '/pagesWork/ldian/add'
ELSE '/pagesWork/dhuo/approval' END) AS UrlStr
FROM License_Electricity AS License
LEFT JOIN Sys_User AS users ON users.UserId =License.NextManId
WHERE License.ProjectId=@projectId
AND (States = '0' OR States = '1' OR States= '6')
AND License.NextManId LIKE '%'+ @userId+'%'
UNION ALL
SELECT RectifyNoticesId AS DataId
,'0038D764-D628-46F0-94FF-D0A22C3C45A3' AS MenuId
,'<00><><EFBFBD>`te9e' AS MenuName
,(CASE WHEN Rectify.States =1 THEN '<00>_~{<7B>S<1A>'
WHEN Rectify.States =2 THEN '<00>_te9e<1A>'
WHEN Rectify.States =3 THEN '<00>_<EFBFBD>[8h<1A>'
WHEN Rectify.States =4 THEN '<00>_ Y<EFBFBD>g<1A>'
WHEN Rectify.States =5 THEN '<00>]<5D>[b<1A>'
ELSE '<00>_<EFBFBD>c<EFBFBD>N<1A>' END + RectifyNoticesCode) AS Content
,users.UserId
,users.UserName
,CheckedDate AS DataTime
,CONVERT(varchar(100),CheckedDate, 23) AS DataTimeStr
,(CASE WHEN ISNULL(Rectify.States,0) =0 THEN '/pagesHSSE/rn/rn_add' --<EFBFBD>c<EFBFBD>N
WHEN Rectify.States =1 THEN '/pagesHSSE/rn/rn_approval' --~{<EFBFBD>S
WHEN Rectify.States =2 THEN '/pagesHSSE/rn/rn_rectify' --te9e
WHEN Rectify.States =3 THEN '/pagesHSSE/rn/rn_rectifycf' --<EFBFBD>[8h
WHEN Rectify.States =4 THEN '/pagesHSSE/rn/rn_confirm' -- Y<EFBFBD>g
ELSE '/pagesHSSE/rn/rn_add' END) AS UrlStr
FROM Check_RectifyNotices AS Rectify
LEFT JOIN Sys_User AS users ON users.UserId =@userId
WHERE Rectify.Projectid=@projectId AND Rectify.States <> 5
AND ((ISNULL(Rectify.States,0) =0 AND Rectify.CompleteManId LIKE '%'+ @userId+'%')
OR (Rectify.States =1 AND Rectify.SignPerson LIKE '%'+ @userId+'%')
OR (Rectify.States =2 AND Rectify.DutyPersonId LIKE '%'+ @userId+'%')
OR (Rectify.States =3 AND Rectify.UnitHeadManId LIKE '%'+ @userId+'%')
OR (Rectify.States =4 AND Rectify.CheckPerson LIKE '%'+ @userId+'%')
OR (Rectify.ProfessionalEngineerId LIKE '%'+ @userId+'%' AND (ProfessionalEngineerTime1 IS NULL OR ProfessionalEngineerTime2 IS NULL))
OR (Rectify.ConstructionManagerId LIKE '%'+ @userId+'%' AND (ConstructionManagerTime1 IS NULL OR ConstructionManagerTime2 IS NULL))
OR (Rectify.ProjectManagerId LIKE '%'+ @userId+'%' AND (ProjectManagerTime1 IS NULL OR ProjectManagerTime2 IS NULL)))
UNION ALL
SELECT PersonId AS DataId
,'EE260447-028F-46AF-8864-9A5DC9DAA5BD' AS MenuId
,'<00>s:W<>NXT' AS MenuName
,Person.PersonName AS Content
,users.UserId
,users.UserName
,Person.InTime AS DataTime
,CONVERT(varchar(100),Person.InTime, 23) AS DataTimeStr
,('/pagesHSSE/info/peopledetail') AS UrlStr
FROM SitePerson_Person AS Person
LEFT JOIN Sys_User AS users ON users.UserId =@userId
WHERE Person.ProjectId=@projectId AND (Person.IsUsed IS NULL OR Person.IsUsed= 0)
AND Person.AuditorId = @userId AND Person.AuditorDate IS NULL
UNION ALL
SELECT PauseNoticeId AS DataId
,'C81DB7ED-165E-4C69-86B0-A3AAE37059FE' AS MenuId
,'<00>f\P<>N' AS MenuName
,(CASE WHEN PauseNotice.PauseStates =1 THEN '<00>_~{<7B>S<1A>'
WHEN PauseNotice.PauseStates =2 THEN '<00>_yb<79>Q<1A>'
WHEN PauseNotice.PauseStates =3 THEN '<00>_<EFBFBD>c6e<1A>'
ELSE '<00>_<EFBFBD>c<EFBFBD>N<1A>' END + PauseNoticeCode) AS Content
,users.UserId
,users.UserName
,PauseTime AS DataTime
,CONVERT(varchar(100),PauseTime, 23) AS DataTimeStr
,(CASE WHEN ISNULL(PauseNotice.PauseStates,0) =0 THEN '/pagesHSSE/info/stop_add' --<EFBFBD>_<EFBFBD>c<EFBFBD>N
WHEN PauseNotice.PauseStates =1 AND PauseNotice.SignManId=@userId THEN '/pagesHSSE/info/stop_approval' --<EFBFBD>_~{<EFBFBD>S
WHEN PauseNotice.PauseStates =2 AND PauseNotice.ApproveManId=@userId THEN '/pagesHSSE/info/stop_confirm' --<EFBFBD>_yb<EFBFBD>Q
WHEN PauseNotice.PauseStates =3 AND PauseNotice.DutyPersonId=@userId THEN '/pagesHSSE/info/stop_feedback' --<EFBFBD>_<EFBFBD>c6e
ELSE '/pagesHSSE/info/stop_add' END) AS UrlStr
FROM Check_PauseNotice AS PauseNotice
LEFT JOIN Sys_User AS users ON users.UserId =@userId
WHERE PauseNotice.ProjectId=@projectId AND PauseNotice.PauseStates <> 4
AND ((ISNULL(PauseNotice.PauseStates,0) =0 AND PauseNotice.CompileManId LIKE '%'+ @userId+'%')
OR (PauseNotice.PauseStates =1 AND PauseNotice.SignManId LIKE '%'+ @userId+'%')
OR (PauseNotice.PauseStates =2 AND PauseNotice.ApproveManId LIKE '%'+ @userId+'%')
OR (PauseNotice.PauseStates =3 AND PauseNotice.DutyPersonId LIKE '%'+ @userId+'%')
OR (PauseNotice.ProfessionalEngineerId LIKE '%'+ @userId+'%' AND ProfessionalEngineerTime IS NULL)
OR (PauseNotice.ConstructionManagerId LIKE '%'+ @userId+'%' AND ConstructionManagerTime IS NULL)
OR (PauseNotice.UnitHeadManId LIKE '%'+ @userId+'%' AND UnitHeadManTime IS NULL)
OR (PauseNotice.SupervisorManId LIKE '%'+ @userId+'%' AND SupervisorManTime IS NULL)
OR (PauseNotice.OwnerId LIKE '%'+ @userId+'%' AND OwnerTime IS NULL))
UNION ALL
SELECT PunishNoticeId AS DataId
,'755F1C1D-2178-47D8-9F82-A501B53A2436' AS MenuId
,'YZUS' AS MenuName
,(CASE WHEN PunishNotice.PunishStates =1 THEN '<00>_~{<7B>S<1A>'
WHEN PunishNotice.PunishStates =2 THEN '<00>_yb<79>Q<1A>'
WHEN PunishNotice.PunishStates =3 THEN '<00>_<EFBFBD>Vgb<1A>'
ELSE '<00>_<EFBFBD>c<EFBFBD>N<1A>' END + PunishNoticeCode) AS Content
,users.UserId
,users.UserName
,PunishNoticeDate AS DataTime
,CONVERT(varchar(100),PunishNoticeDate, 23) AS DataTimeStr
,(CASE WHEN ISNULL(PunishNotice.PunishStates,0) =0 THEN '/pagesTest/punish/add' --<EFBFBD>_<EFBFBD>c<EFBFBD>N
WHEN PunishNotice.PunishStates =1 AND PunishNotice.SignMan=@userId THEN '/pagesTest/punish/approval' --<EFBFBD>_~{<EFBFBD>S
WHEN PunishNotice.PunishStates =2 AND PunishNotice.ApproveMan=@userId THEN '/pagesTest/punish/rectify' --<EFBFBD>_yb<EFBFBD>Q
WHEN PunishNotice.PunishStates =3 AND PunishNotice.DutyPersonId=@userId THEN '/pagesTest/punish/rectifycf' --<EFBFBD>_<EFBFBD>Vgb
ELSE '/pagesTest/punish/detail' END) AS UrlStr
FROM Check_PunishNotice AS PunishNotice
LEFT JOIN Sys_User AS users ON users.UserId =@userId
WHERE PunishNotice.ProjectId=@projectId AND PunishNotice.PunishStates <> 4
AND ((ISNULL(PunishNotice.PunishStates,0) =0 AND PunishNotice.CompileMan LIKE '%'+ @userId+'%')
OR (PunishNotice.PunishStates =1 AND PunishNotice.SignMan LIKE '%'+ @userId+'%')
OR (PunishNotice.PunishStates =2 AND PunishNotice.ApproveMan LIKE '%'+ @userId+'%')
OR (PunishNotice.PunishStates =3 AND PunishNotice.DutyPersonId LIKE '%'+ @userId+'%')
OR (PunishNotice.ProfessionalEngineerId LIKE '%'+ @userId+'%' AND ProfessionalEngineerTime IS NULL)
OR (PunishNotice.ConstructionManagerId LIKE '%'+ @userId+'%' AND ConstructionManagerTime IS NULL)
OR (PunishNotice.UnitHeadManId LIKE '%'+ @userId+'%' AND UnitHeadManTime IS NULL))
UNION ALL
SELECT CheckSpecialId AS DataId
,'1B08048F-93ED-4E84-AE65-DB7917EA2DFB' AS MenuId
,'Ny<4E><79>h<EFBFBD>g' AS MenuName
,checkspecial.CheckSpecialCode+'Ny<4E><79>h<EFBFBD>g<EFBFBD>_<EFBFBD>[8h' AS Content
,UserId
,users.UserName
,checkspecial.CheckTime AS DataTime
,CONVERT(varchar(100),checkspecial.CheckTime, 23) AS DataTimeStr
,'/pagesHSSE/grow/special_detail' AS UrlStr
FROM Check_CheckSpecial AS checkspecial
LEFT JOIN Sys_User AS users ON users.UserId =@userId
WHERE checkspecial.ProjectId=@projectId AND
checkspecial.States='1' and checkspecial.ResponsibleMan=@userId
UNION ALL
SELECT ConstructSolutionId AS DataId
,'91C4BFDB-0A51-4992-99CC-EB4EC185593D' AS MenuId
,'<00>e<EFBFBD>]<5D>eHh<48>_Yt' AS MenuName
,Solution.SolutionName AS Content
,UserId
,users.UserName
,Solution.CompileDate AS DataTime
,CONVERT(varchar(100),Solution.CompileDate, 23) AS DataTimeStr
,'/pagesQ/eq_fangan/detail' AS UrlStr
FROM Solution_CQMSConstructSolution AS Solution
LEFT JOIN Sys_User AS users ON users.UserId =@userId
WHERE Solution.ProjectId=@projectId and
Solution.State!='3' AND Solution.ConstructSolutionId in (select ConstructSolutionId from Solution_CQMSConstructSolutionApprove approve where approve.ApproveType!='S' and approve.ApproveMan=@userId and approve.ApproveDate is null )
UNION ALL
SELECT CheckSpecialId AS DataId
,'1B08048F-93ED-4E84-AE65-DB7917EA2DFB' AS MenuId
,'Ny<4E><79>h<EFBFBD>g' AS MenuName
,checkspecial.CheckSpecialCode+'Ny<4E><79>h<EFBFBD>g<EFBFBD>_nx<6E><78>' AS Content
,UserId
,users.UserName
,checkspecial.CheckTime AS DataTime
,CONVERT(varchar(100),checkspecial.CheckTime, 23) AS DataTimeStr
,'/pagesHSSE/grow/special_detail' AS UrlStr
FROM Check_CheckSpecial AS checkspecial
LEFT JOIN Sys_User AS users ON users.UserId =@userId
WHERE checkspecial.ProjectId=@projectId AND
checkspecial.States='2' and checkspecial.CompileMan=@userId
UNION ALL
SELECT Top 1 Child3.PerformanceGid AS DataId
,'B96FEF05-CA28-4450-ACE6-9FA654CE7F6D' AS MenuId
,'<00>e<EFBFBD>]<5D>~He' AS MenuName
,'<00>N<EFBFBD>e<EFBFBD>e<EFBFBD>]<5D>~He<48>_kX<6B>Q' AS Content
,UserId
,users.UserName
,Child3.CurrentDate AS DataTime
,CONVERT(varchar(100),Child3.CurrentDate, 23) AS DataTimeStr
,'pages/baseinfo/shigonginfo' AS UrlStr
FROM CQMS_Performance_Child3 AS Child3
LEFT JOIN Sys_User AS users ON users.UserId =@userId
LEFT JOIN CQMS_Performance as Perfor ON Perfor.PerformanceGid=Child3.PerformanceGid
WHERE Child3.ProjectId=@projectId AND
Child3.WorkPlan='' and Child3.CreateMan=@userId and
CONVERT(varchar(100), Child3.CurrentDate, 23)=CONVERT(varchar(100), GETDATE(), 23)
ORDER BY DataTime DESC
END
2023-10-26 15:38:13 +08:00