定制版企业安全报表增加内容

This commit is contained in:
geh
2025-07-18 18:18:12 +08:00
parent ee4e3fae13
commit 97157b6145
10 changed files with 341 additions and 1 deletions
@@ -0,0 +1,42 @@
alter table Information_MillionsMonthlyReport add KeyWorkNum int null
alter table Information_MillionsMonthlyReport add KeyWorkOKNum int null
alter table Information_MillionsMonthlyReport add KeyWorkOKRate nvarchar(20) null
GO
/*************企业百万工时安全统计月报表**************/
ALTER VIEW [dbo].[View_Information_MillionsMonthlyReport]
AS
SELECT
Report.MillionsMonthlyReportId,
Report.UnitId,
Report.FillingDate,
Report.UpState,
(ISNULL(Group_0008.ConstText,'-') + ISNULL(Group_0009.ConstText,'-')) AS ReportDate,
Group_0008.ConstText as YearStr,
Group_0009.ConstText as MonthStr,
U.UnitName,
Report.Year,
Report.Month,
Report.DutyPerson,
Report.RecordableIncidentRate,
Report.LostTimeRate,
Report.LostTimeInjuryRate,
Report.DeathAccidentFrequency,
Report.AccidentMortality,
Report.HandleState,
Report.HandleMan,
Report.KeyWorkNum,
Report.KeyWorkOKNum,
Report.KeyWorkOKRate,
US.UserName
FROM dbo.Information_MillionsMonthlyReport AS Report
LEFT JOIN Base_Unit AS U ON U.UnitId=Report.UnitId
LEFT JOIN Sys_Const AS Group_0008 ON Group_0008.GroupId='0008' AND Group_0008.ConstValue =Report.[Year]
LEFT JOIN Sys_Const AS Group_0009 ON Group_0009.GroupId='0009' AND Group_0009.ConstValue =Report.[Month]
LEFT JOIN Sys_User AS US ON US.UserId=Report.HandleMan
GO