有这样的要求
inTransaction {
from(AppDb.bills, AppDb.legals)((billCount, legal) =>
where(legal.id in (
from(AppDb.bills)(bill =>
where(bill.individualId === individualId and bill.deleted === false)
select (bill.legalId)).distinct
) and billCount.individualId === individualId and billCount.legalId === legal.id)
groupBy(legal.id, legal.name, legal.address, legal.siteUrl, legal.logoId, legal.phoneNumber, legal.email)
compute(legal.id, legal.name, legal.address, legal.siteUrl, legal.logoId, legal.phoneNumber, legal.email, count(billCount.id))
).toList
}
方法计算不能接受 8 个字段,只有 7 个和更少。
def compute[T1,T2,T3,T4,T5,T6,T7]
(e1: =>TypedExpressionNode[T1], e2: =>TypedExpressionNode[T2], e3: =>TypedExpressionNode[T3], e4: =>TypedExpressionNode[T4],
e5: =>TypedExpressionNode[T5], e6: =>TypedExpressionNode[T6], e7: =>TypedExpressionNode[T7]): ComputeStateFromGroupByState[G,Product7[T1,T2,T3,T4,T5,T6,T7]] =
new GroupWithMeasuresQueryYield[G,Product7[T1,T2,T3,T4,T5,T6,T7]](
this.queryElementzz,
this.groupByClauseClosure,
this.unevaluatedHavingClause,
() =>List(e1, e2, e3, e4, e5, e6, e7)
)
我怎么解决这个问题?