This commit is contained in:
@@ -44,5 +44,5 @@ public interface LawCaseRepository extends JpaRepository<LawCase, Long> {
|
|||||||
@Query("SELECT COUNT(lc.id) FROM LawCase lc")
|
@Query("SELECT COUNT(lc.id) FROM LawCase lc")
|
||||||
Long getTotalLawCasesCount();
|
Long getTotalLawCasesCount();
|
||||||
|
|
||||||
Optional<LawCase> getLawCaseByViolationIdAndType(Long violationId, String lawCaseType);
|
Optional<LawCase> getLawCaseByViolationIdAndType(Long violationId, LawCaseType type);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ public class LawCaseService {
|
|||||||
|
|
||||||
public LawCase fetchByViolationId(Long violationId) {
|
public LawCase fetchByViolationId(Long violationId) {
|
||||||
Optional<LawCase> lawCaseByViolationIdAndType =
|
Optional<LawCase> lawCaseByViolationIdAndType =
|
||||||
lawCaseRepository.getLawCaseByViolationIdAndType(violationId, LawCaseType.ACTIVE.getName());
|
lawCaseRepository.getLawCaseByViolationIdAndType(violationId, LawCaseType.ACTIVE);
|
||||||
|
|
||||||
return lawCaseByViolationIdAndType.orElse(null);
|
return lawCaseByViolationIdAndType.orElse(null);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user