xxxxxxxxxx
const withdraws: Remittances[] = await this.remittanceModel.findAll({
// where: { accountId: { [Op.in]: accountIds }, ...searchParams },
attributes: [
'id',
'createdTime',
'accountId',
'transactionid',
'status',
'address',
'addressname',
'amount',
'notes',
'prefix',
'reference',
'referenceData',
'feeamount',
'statusmessage',
'inquiryid',
'batchid',
'isdraft',
'amount',
[this.sequelize.literal('SUM(amount) OVER (PARTITION BY batchid)'), 'totalAmount'],
[this.sequelize.literal(' Count(batchid) OVER (PARTITION BY batchid'), 'batchCount'],
],