In an error report, only the fields related to this Article are listed as follows: ReportPerson, ErrorID, and ReportTime) status, where the values are 0 (not resolved), 1 (processed), and 2 (resolved ).
What we need to do now is to count the total number of error points reported by each reporter and the total number of resolved errors in a certain period of time [beginTime, endTime] (where beginTime and endTime are transmitted by the front-end.
Copy codeThe Code is as follows:
Select a. ReportPerson, a. sumOfError, B. solvedError
From (select COUNT (ErrorID) as sumOfError, ReportPerson
From PCR_ConstructInfo
Where
(ReportTime> beginTime) and (ReportTime <endTime) group by ReportPerson)
A left join
(Select ReportPerson, COUNT (ErrorID) as solvedError
From PCR_ConstructInfo
Where (State = 2) and (ReportTime> beginTime) and (ReportTime <endTime) group by ReportPerson) B
On (a. ReportPerson = B. ReportPerson)
The generated result graph is: