Fixed query for getting unhandled reports to behave well with abused reports
This commit is contained in:
parent
2211e6c4ef
commit
5b685a3a86
@ -72,13 +72,13 @@ public class ReportRepository
|
|||||||
" ORDER BY `time` ASC;";
|
" ORDER BY `time` ASC;";
|
||||||
|
|
||||||
// TODO confirm working
|
// TODO confirm working
|
||||||
private static final String GET_UNHANDLED_REPORTS = "SELECT reports.id FROM reports" +
|
private static final String GET_UNHANDLED_REPORTS = "SELECT reports.id FROM reports\n" +
|
||||||
" LEFT JOIN reportResults ON reports.id = reportResults.reportId" +
|
" LEFT JOIN reportResults ON reports.id = reportResults.reportId\n" +
|
||||||
" LEFT JOIN reportHandlers ON reports.id = reportHandlers.reportId" +
|
" LEFT JOIN reportHandlers ON reports.id = reportHandlers.reportId\n" +
|
||||||
" AND (reportHandlers.aborted IS FALSE" +
|
"WHERE reportResults.reportId IS NULL\n" +
|
||||||
" AND reportHandlers.handlerId != ?)" +
|
"GROUP BY reports.id\n" +
|
||||||
" WHERE reportResults.reportId IS NULL" +
|
"HAVING SUM(IF(reportHandlers.handlerId != ?, 1, 0)) = COUNT(reportHandlers.handlerId)\n" +
|
||||||
" AND reportHandlers.reportId IS NULL;";
|
" AND SUM(IF(reportHandlers.aborted IS TRUE, 1, 0)) = COUNT(reportHandlers.handlerId);";
|
||||||
|
|
||||||
private static final String GET_ONGOING_REPORT = "SELECT reports.id FROM reports" +
|
private static final String GET_ONGOING_REPORT = "SELECT reports.id FROM reports" +
|
||||||
" LEFT JOIN reportResults ON reports.id = reportResults.reportId" +
|
" LEFT JOIN reportResults ON reports.id = reportResults.reportId" +
|
||||||
|
Loading…
Reference in New Issue
Block a user