Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix grant loader coeus SQL #115

Merged
merged 3 commits into from
May 24, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,14 @@ public class CoeusConnector implements GrantConnector {
"LEFT JOIN COEUS.SWIFT_SPONSOR D ON A.PRIME_SPONSOR_CODE = D.SPONSOR_CODE " +
"WHERE (B.ABBREVIATED_ROLE = 'P' OR B.ABBREVIATED_ROLE = 'C' " +
"OR REGEXP_LIKE (UPPER(B.ROLE), '^CO ?-?INVESTIGATOR$')) " +
"AND A.PROPOSAL_STATUS = 'Funded' " +
"AND A.GRANT_NUMBER IS NOT NULL " +
"AND EXISTS (" +
" select * from COEUS.JHU_FACULTY_FORCE_PROP EA where" +
" EA.UPDATE_TIMESTAMP > ?" +
" AND TO_DATE(EA.AWARD_END, 'MM/DD/YYYY') >= TO_DATE(?, 'MM/DD/YYYY')" +
" and EA.PROPOSAL_STATUS = 'Funded'" +
" and EA.GRANT_NUMBER = A.GRANT_NUMBER ";
" AND EA.GRANT_NUMBER = A.GRANT_NUMBER" +
" AND EA.PROPOSAL_STATUS = 'Funded' ";

private static final String SELECT_USER_SQL =
"SELECT " +
Expand Down Expand Up @@ -213,8 +215,8 @@ private List<GrantIngestRecord> retrieveGrantUpdates(String startDate, String aw

private String buildGrantQueryString(String grant) {
return StringUtils.isEmpty(grant)
? SELECT_GRANT_SQL + "AND A.GRANT_NUMBER IS NOT NULL)"
: SELECT_GRANT_SQL + "AND A.GRANT_NUMBER = ?)";
? SELECT_GRANT_SQL + "AND EA.GRANT_NUMBER IS NOT NULL)"
: SELECT_GRANT_SQL + "AND EA.GRANT_NUMBER = ?)";
}

private List<GrantIngestRecord> retrieveFunderUpdates(Set<String> funderIds) throws SQLException {
Expand Down
Loading