Various improvements and fixes to report related database queries
This commit is contained in:
parent
ce4672f026
commit
08f113bb99
@ -98,22 +98,22 @@ public class ReportRepository
|
||||
" LEFT JOIN reportResults ON reports.id = reportResults.reportId\n" +
|
||||
"WHERE reportResults.reportId IS NULL\n" +
|
||||
" AND reports.suspectId = ?\n" +
|
||||
" AND reports.region = ?;";
|
||||
" AND (reports.region IS NULL OR reports.region = ?);";
|
||||
|
||||
private static final String GET_ONGOING_REPORT_CATEGORY = "SELECT reports.id FROM reports\n" +
|
||||
" LEFT JOIN reportResults ON reports.id = reportResults.reportId\n" +
|
||||
"WHERE reportResults.reportId IS NULL\n" +
|
||||
" AND reports.suspectId = ?\n" +
|
||||
" AND reports.categoryId = ?\n" +
|
||||
" AND reports.region = ?;";
|
||||
" AND (reports.region IS NULL OR reports.region = ?);";
|
||||
|
||||
private static final String GET_REPORTS_HANDLING = "SELECT reports.id FROM reports\n" +
|
||||
" LEFT JOIN reportResults ON reports.id = reportResults.reportId\n" +
|
||||
" INNER JOIN reportHandlers ON reports.id = reportHandlers.reportId\n" +
|
||||
" AND reportHandlers.aborted IS FALSE\n" +
|
||||
" LEFT JOIN reportHandlers ON reports.id = reportHandlers.reportId\n" +
|
||||
"WHERE reportResults.reportId IS NULL\n" +
|
||||
" AND reportHandlers.handlerId = ?\n" +
|
||||
" AND reports.region = ?;";
|
||||
" AND reportHandlers.aborted IS FALSE\n" +
|
||||
" AND (reports.region IS NULL OR reports.region = ?);";
|
||||
|
||||
private static final String GET_USER_RESULT_COUNT = "SELECT COUNT(reports.id) AS resultCount" +
|
||||
" FROM reports, reportReasons, reportResults" +
|
||||
|
Loading…
Reference in New Issue
Block a user