

INSERT INTO [dbo].[Sys_Menu] ( [MenuId], [MenuName], [Icon], [Url], [SortIndex], [SuperMenu], [MenuType], [IsOffice], [IsEnd], [IsUsed] )
VALUES
  ( N'AF67CC3D-A130-4074-AF31-803A9F3C7202', N'人力预警', NULL, N'JDGL/SGManPower/SGWarningDetailsEdit.aspx', 40, N'1BCD283A-F33C-488C-8FCA-F7B7B9C1A003', N'Menu_JDGL', '0', '0', '1' );
 go 
  

--创建人员考勤表的视图（统计项目,单位,装置,岗位具体考勤人数）
CREATE VIEW [View_EmployInOutRecord] AS

SELECT
  e.ProjectId,
  e.UnitId,
  e.PostId,
  e.RecordDate,
  p.WorkAreaId AS UnitWorkId,
  COUNT ( 1 ) AS ActualQuantity 
FROM
  T_d_EmployInOutRecord e
  INNER JOIN SitePerson_Person p ON e.IDCardNo = p.IdentityCard 
  AND e.ProjectId = p.ProjectId 
WHERE
  e.PostId IS NOT NULL 
  AND e.PostId != '' 
  AND e.ManHours = '8' 
GROUP BY
  e.ProjectId,
  e.UnitId,
  e.PostId,
  e.RecordDate,
  p.WorkAreaId