任何人都可以帮我为以下查询的GORM编写等效的HQL查询:
SELECT count(DISTINCT cast(t.disburse_time AS DATE))
FROM transactions_details t
WHERE (t.status_id = 5 OR t.status_id = 6 OR t.status_id = 7)
ORDER BY t.disburse_time;
答案 0 :(得分:1)
尝试以下方法:
Transactions_details.createCriteria().list() {
projections {
countDistinct( 'disburse_time' )
}
'in' ( 'status_id', [5,6,7] )
order 'disburse_time'
}