I want to implement this query using jooq:
SELECT bank_id, array_agg(id) FROM aggregative_line_item GROUP BY bank_id ORDER BY sum(amount) desc;