Skip to content

Instantly share code, notes, and snippets.

@mr5z
Created November 14, 2017 18:05
Show Gist options
  • Save mr5z/f2bb48d207b163e65bf6fb65df550027 to your computer and use it in GitHub Desktop.
Save mr5z/f2bb48d207b163e65bf6fb65df550027 to your computer and use it in GitHub Desktop.
@Query("SELECT id, title, description, dateCreated, certificateLink, deliveryStatus, userId\n" +
"FROM Certificates\n" +
"WHERE userId = :userId\n" +
"ORDER BY expirationDate")
List<CertificateDto> getAllNotifications(long userId);
@Query("SELECT id, title, description, dateCreated, certificateLink, deliveryStatus, userId\n" +
"FROM Certificates\n" +
"WHERE userId = :userId AND\n" +
" expirationDate <= date('now', '+8 hour') AND -- TODO: get client timezone from header\n" +
" deliveryStatus = 0\n" +
"ORDER BY expirationDate")
List<CertificateDto> getPendingNotifications(long userId);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment