0

这是我的选择声明

SelectQuery<Record> selectQueryPayment = transaction.selectQuery();
    selectQueryPayment.addSelect(AccountPayment.ACCOUNT_PAYMENT.PAYMENT_NUMBER,AccountPayment.ACCOUNT_PAYMENT.PAYMENT_AMOUNT,AccountPayment.ACCOUNT_PAYMENT.PAYMENT_TYPE,
                     AccountPayment.ACCOUNT_PAYMENT.PAYMENT_DATE,AccountPayment.ACCOUNT_PAYMENT.PAYMENT_AMOUNT,AccountPayment.ACCOUNT_PAYMENT.PAYMENT_AMOUNT.subtract(AccountPayment.ACCOUNT_PAYMENT.AMOUNT_REFUNDED.add(AccountPayment.ACCOUNT_PAYMENT.AMOUNT_APPLIED)));

在这里您可以看到带有一些计算的复杂选择

ACCOUNT_PAYMENT.PAYMENT_AMOUNT.subtract(AccountPayment.ACCOUNT_PAYMENT.AMOUNT_REFUNDED.add(AccountPayment.ACCOUNT_PAYMENT.AMOUNT_APPLIED))

如何为此创建别名?然后从中取回数据?

4

1 回答 1

1

好的,我得到了我们可以使用的解决方案

AccountPayment.ACCOUNT_PAYMENT.PAYMENT_AMOUNT.subtract(AccountPayment.ACCOUNT_PAYMENT.AMOUNT_REFUNDED.add(AccountPayment.ACCOUNT_PAYMENT.AMOUNT_APPLIED)).as("OverPayment")

我们必须增加as("Alias Name")并获得我们必须使用的价值

     Result<Record> resultPayment = selectQueryPayment.fetch();
           for(Record record : resultPayment){
           feeAmount =  resultPayment.getValues("OverPayment");

}

于 2013-10-31T10:36:04.483 回答