Files
SGGL_SHJ/DataBase/版本日志/SGGLDB_V2023-06-29.sql
T
2023-06-29 17:10:19 +08:00

60 lines
2.8 KiB
Transact-SQL

INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed)
VALUES('F004D9B0-6E6A-41E0-88F1-2306BB6397C6','本部检查项','BaseInfo/CheckTemplate.aspx',130,'8A2CEE72-2793-49C6-9E2E-E83B2676E2DD','Menu_SysSet',1,1,1)
GO
INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex)
VALUES('FBB8C0B9-0CA6-445A-B682-4AC3FFBE232A','F004D9B0-6E6A-41E0-88F1-2306BB6397C6','增加',1)
INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex)
VALUES('7190D868-0CE6-4FAC-944F-07032176E101','F004D9B0-6E6A-41E0-88F1-2306BB6397C6','修改',2)
INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex)
VALUES('6077EBFF-3905-4D1E-959B-0795E9A1627C','F004D9B0-6E6A-41E0-88F1-2306BB6397C6','删除',3)
INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex)
VALUES('0E2074B0-53AF-4075-8C69-2F5E10A1E791','F004D9B0-6E6A-41E0-88F1-2306BB6397C6','保存',4)
GO
--获取当前人项目级待办事项
ALTER PROCEDURE [dbo].[Sp_Project_GetToDoItems]
@projectId NVARCHAR(50)=NULL,
@personId NVARCHAR(200)=NULL
AS
/*获取当前人本部待办事项*/
BEGIN
SELECT CostManageId AS DataId
,'HSE费用申请' AS MenuName
,('HSE费用申请'+ CONVERT(varchar(100),CostManage.CostManageDate, 23)+'待处理。') AS Content
,PersonId
,persons.PersonName
,CostManage.CostManageDate AS DataTime
,CONVERT(varchar(100),CostManage.CostManageDate, 23) AS DataTimeStr
,(CASE WHEN CostManage.States = '0' THEN '../HSSE/CostGoods/CostManageEdit.aspx?CostManageId='+CostManageId
ELSE '../HSSE/CostGoods/CostManageAudit.aspx?CostManageId='+CostManageId END)AS PCUrl
FROM CostGoods_CostManage AS CostManage
LEFT JOIN Person_Persons AS persons ON CostManage.NextManId= persons.PersonId
WHERE CostManage.ProjectId=@projectId AND (CostManage.States = '0' or CostManage.States='1' )
AND CostManage.NextManId =@personId
UNION ALL
SELECT ActionPlan.ActionPlanListId AS DataId
,'安全实施计划' AS MenuName
,('安全实施计划'+ CONVERT(varchar(100),ActionPlan.CompileDate, 23)+'待处理。')+'待处理' AS Content
,approve.ApproveMan AS PersonId
,persons.PersonName
,CompileDate AS DataTime
,CONVERT(varchar(100),CompileDate, 23) AS DataTimeStr
,'../HSSE/ActionPlanListEdit.aspx?ActionPlanListId='+ActionPlan.ActionPlanListId AS PCUrl
FROM ActionPlan_ActionPlanList AS ActionPlan
LEFT JOIN ActionPlan_ActionPlanListApprove as approve on ActionPlan.ActionPlanListId=approve.ActionPlanListId and ApproveType!='S' and approve.ApproveMan='2dabba4e-19e3-4ccd-8382-7393d9084894'
LEFT JOIN Person_Persons AS persons ON persons.PersonId =approve.ApproveMan
WHERE ActionPlan.ProjectId=@projectId and ActionPlan.ActionPlanListId in (select ActionPlanListId from dbo.ActionPlan_ActionPlanListApprove
where PersonId=@PersonId and ApproveDate is null and ApproveType!='S')
ORDER BY DataTime DESC
END
GO