fix: ReportRepository method name mismatch (targetDate)
This commit is contained in:
@@ -64,7 +64,12 @@ public class ReportService {
|
||||
|
||||
public Page<WorkReportResponse> findByUserId(Long userId, ReportStatus status, String type, LocalDate targetDate, Pageable pageable) {
|
||||
ReportType reportType = type != null ? ReportType.valueOf(type) : null;
|
||||
Page<Report> reports = reportRepository.findByUser_EmpIdAndStatusAndReportType(userId, status, reportType, targetDate, pageable);
|
||||
Page<Report> reports;
|
||||
if (targetDate != null) {
|
||||
reports = reportRepository.findByUser_EmpIdAndStatusAndReportTypeAndTargetDate(userId, status, reportType, targetDate, pageable);
|
||||
} else {
|
||||
reports = reportRepository.findByUser_EmpIdAndStatusAndReportType(userId, status, reportType, pageable);
|
||||
}
|
||||
return reports.map(this::toWorkReportResponse);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user