【发布时间】:2013-10-31 21:10:19
【问题描述】:
这是我的问题..
SelectQuery<Record> selectQuery = transRefundFee.selectQuery();
selectQuery.addSelect(AccountBill.ACCOUNT_BILL.BILL_NUMBER,AccountBill.ACCOUNT_BILL.BILL_AMOUNT,AccountBill.ACCOUNT_BILL.TOTAL_PAID );
selectQuery.addFrom(AccountBill.ACCOUNT_BILL);
selectQuery.addConditions(AccountBill.ACCOUNT_BILL.FOLDER_RSN.eq(argFolderRSN));
我必须添加带有案例声明的 orderby 我们如何才能做到这一点我检查了Here 但它在我的情况下不起作用我像这样添加的任何其他方式
selectQuery.addOrderBy( DSL.decode().when(AccountBill.ACCOUNT_BILL.BILL_AMOUNT.le(new BigDecimal(0)),AccountBill.ACCOUNT_BILL.BILL_AMOUNT).then(AccountBill.ACCOUNT_BILL.BILL_AMOUNT) .otherwise(AccountBill.ACCOUNT_BILL.BILL_NUMBER));
但它的说法是The method then(TableField<AccountBillRecord,BigDecimal>) is undefined for the type CaseConditionStep<BigDecimal>
与下面的代码相同
selectQueryFee.addOrderBy(DSL.decode().when(AccountBill.ACCOUNT_BILL.BILL_AMOUNT.le(new BigDecimal(0))
.then(AccountBill.ACCOUNT_BILL.BILL_AMOUNT)
.otherwise(AccountBill.ACCOUNT_BILL.BILL_NUMBER)));
then(TableField) 方法未定义 对于类型条件
【问题讨论】:
-
您看过
SelectQueryJavadoc 吗?你试过什么?你在哪里/为什么失败了? -
@LuKas 编辑问题
-
哎呀。我注意到我在other question, which you've linked 中给出了错误的答案