Created
May 8, 2020 14:33
-
-
Save fee1good/7b59a2c49eb8fa3c720f2fa535496b03 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private <T extends EDoc<T>> Specification<T> findByPaymentDocumentNumber(String payDocNum) { | |
log.debug("findByPaymentDocumentNumber() - start: payDocNum = {}", payDocNum); | |
Specification<T> result = null; | |
if (StringUtils.isNotEmpty(payDocNum)) { | |
result = (root, query, criteriaBuilder) -> | |
criteriaBuilder.like(root.join("requestDocumentAttachmentList").get("paymentNumber"), "%" + payDocNum + "%"); | |
} | |
log.debug("findByPaymentDocumentNumber() - end"); | |
return result; | |
} | |
private <T extends EDoc<T>> Specification<T> findByPaymentDocumentDateTo(Date payDocDateTo, Integer offset) { | |
log.debug("findByPaymentDocumentDateTo() - start: payDocDateTo = {}, offset = {}", payDocDateTo, offset); | |
Specification<T> result = null; | |
if (payDocDateTo != null) { | |
final Date date = addDays(addMinutes(payDocDateTo, offset), 1); | |
result = (root, query, criteriaBuilder) -> criteriaBuilder.lessThanOrEqualTo( | |
root.join("requestDocumentAttachmentList").get("paymentDate"), date); | |
} | |
log.debug("findByPaymentDocumentDateTo() - end"); | |
return result; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment