39 lines
1.6 KiB
MySQL
39 lines
1.6 KiB
MySQL
|
CREATE PROC [dbo].[spAbsenceDutyReport]
|
|||
|
@projectId NVARCHAR(50),
|
|||
|
@unitId NVARCHAR(max)= NULL,
|
|||
|
@workPostId NVARCHAR(max)= NULL,
|
|||
|
@day DATETIME = NULL
|
|||
|
AS
|
|||
|
/*****************ȱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա****************/
|
|||
|
SELECT Person.ProjectId
|
|||
|
,Person.UnitId
|
|||
|
,Unit.UnitName
|
|||
|
,Person.TeamGroupId
|
|||
|
,TeamGroup.TeamGroupName
|
|||
|
,Person.WorkPostId
|
|||
|
,WorkPost.WorkPostName
|
|||
|
,Person.PersonId
|
|||
|
,Person.PersonName
|
|||
|
,Person.IdentityCard
|
|||
|
FROM SitePerson_Person AS Person
|
|||
|
LEFT JOIN Base_Unit AS Unit ON Person.UnitId =Unit.UnitId
|
|||
|
LEFT JOIN ProjectData_TeamGroup AS TeamGroup ON Person.TeamGroupId =TeamGroup.TeamGroupId
|
|||
|
LEFT JOIN Base_WorkPost AS WorkPost ON Person.WorkPostId =WorkPost.WorkPostId
|
|||
|
LEFT JOIN (select distinct ProjectId,IDCardNo from T_d_EmployInOutRecord
|
|||
|
WHERE ((@day IS NULL AND CONVERT(varchar(12), RecordDate,23) = CONVERT(varchar(12), GETDATE(),23))
|
|||
|
OR CONVERT(varchar(12), RecordDate,23)= CONVERT(varchar(12),@day,23))) AS facerecord
|
|||
|
ON Person.IdentityCard =facerecord.IDCardNo
|
|||
|
and Person.ProjectId =facerecord.ProjectId
|
|||
|
WHERE Person.ProjectId = @ProjectId
|
|||
|
AND (@unitId like '%'+Person.UnitId+'%' OR @unitId IS NULL)
|
|||
|
AND (@WorkPostId like '%'+Person.WorkPostId+'%' OR @WorkPostId IS NULL)
|
|||
|
AND Person.IsUsed=1 AND Person.InTime<=GETDATE() AND (Person.OutTime IS NULL OR Person.OutTime>=GETDATE())
|
|||
|
AND facerecord.IDCardNo IS NULL
|
|||
|
ORDER BY Unit.UnitName,TeamGroup.TeamGroupName,WorkPost.WorkPostName,Person.PersonName
|
|||
|
|
|||
|
GO
|
|||
|
|
|||
|
|
|||
|
INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed)
|
|||
|
VALUES('984AB874-D5CB-4077-8ADB-6E154F5B636C','ȱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա','Door/AbsenceDuty.aspx',40,'0','Menu_PDigData',0,1,1)
|
|||
|
GO
|