Skip to content

Commit

Permalink
Merge branch 'kk-payment-query-optimization' into MERGE__koski-dev__O…
Browse files Browse the repository at this point in the history
…Y-4826__OK-770__OK-719__OK-784__OK-783__DEFAULT-FIX
  • Loading branch information
vaeinoe committed Jan 10, 2025
2 parents 5da6dc6 + a356260 commit f683cfb
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ npm-debug.log*
/blob-report/
/playwright/.cache/
.testcontainers.properties
.vscode
.vscode
27 changes: 16 additions & 11 deletions resources/sql/application-queries.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1372,16 +1372,21 @@ WHERE a.id in (:ids);

--name: yesql-get-latest-applications-for-kk-payment-processing
SELECT
la.key,
la.submitted,
la.haku,
la.hakukohde,
la.person_oid AS "person-oid",
a.key,
a.submitted,
a.haku,
a.hakukohde,
a.person_oid AS "person-oid",
(SELECT content
FROM answers_as_content
WHERE application_id = la.id) AS content
FROM latest_applications AS la
LEFT JOIN application_reviews AS ar ON ar.application_key = la.key
WHERE la.haku in (:haku_oids) AND
la.person_oid in (:person_oids) AND
FROM answers_as_content
WHERE application_id = a.id) AS content
FROM applications AS a
LEFT JOIN applications AS la
ON la.key = a.key AND
la.id > a.id
LEFT JOIN application_reviews AS ar
ON ar.application_key = a.key
WHERE la.id IS NULL AND
a.haku in (:haku_oids) AND
a.person_oid in (:person_oids) AND
ar.state <> 'inactivated';

0 comments on commit f683cfb

Please sign in to comment.