起步软件技术论坛
搜索
 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 5916|回复: 10

[结贴] grid汇总问题

[复制链接]

92

主题

254

帖子

638

积分

高级会员

Rank: 4

积分
638
QQ
发表于 2017-4-14 14:57:13 | 显示全部楼层 |阅读模式
QQ图片20170414145036.png

如图,复杂查询添加了YSZLF和WSZJ两列,在页面中的grid中,这两列我想通过 汇总 ,其他金额列的 都是通过设置 aggregate的值,让后在 grid的footdata中设置如下:
$model.mainData.getAggregateValue("QMGZK") 获取汇总列的,请问的 YSZLF和WSZJ汇总改如何实现?
PS:汇总的数据是所有值的汇总,而非当前分页中的值, 用过 sum() 和sumbyall()都不管用。

91

主题

13万

帖子

3万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
36067
发表于 2017-4-14 16:07:21 | 显示全部楼层
远程的联系方法QQ1392416607,添加好友时,需在备注里注明其论坛名字及ID,公司等信息
发远程时同时也发一下帖子地址,方便了解要解决的问题  WeX5教程  WeX5下载



如按照该方法解决,请及时跟帖,便于版主结贴
回复 支持 反对

使用道具 举报

92

主题

254

帖子

638

积分

高级会员

Rank: 4

积分
638
QQ
 楼主| 发表于 2017-4-14 17:18:01 | 显示全部楼层
jishuang 发表于 2017-4-14 16:07
http://doc.wex5.com/?p=3416

用的$model.mainData.sum("YSZLF") 不行的啊,这个计算的只是当前分页的 汇总数啊,我要的是全部数据的汇总
回复 支持 反对

使用道具 举报

91

主题

13万

帖子

3万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
36067
发表于 2017-4-14 17:34:54 | 显示全部楼层
2楼的链接中有说明aggregate怎么设置啊
queryAction.png
远程的联系方法QQ1392416607,添加好友时,需在备注里注明其论坛名字及ID,公司等信息
发远程时同时也发一下帖子地址,方便了解要解决的问题  WeX5教程  WeX5下载



如按照该方法解决,请及时跟帖,便于版主结贴
回复 支持 反对

使用道具 举报

92

主题

254

帖子

638

积分

高级会员

Rank: 4

积分
638
QQ
 楼主| 发表于 2017-4-17 08:23:54 | 显示全部楼层
jishuang 发表于 2017-4-14 17:34
2楼的链接中有说明aggregate怎么设置啊

但是这两个字段不是HX_ProjectApply里面的啊,是自定义字段, 该如何写? 直接 sum(YSZLF) as ysf,sum(WSZJ) as wsf? 好像不行嘛
回复 支持 反对

使用道具 举报

91

主题

13万

帖子

3万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
36067
发表于 2017-4-17 10:20:46 | 显示全部楼层
直接 sum(YSZLF) as ysf,sum(WSZJ) as wsf? 好像不行嘛

具体什么提示信息
远程的联系方法QQ1392416607,添加好友时,需在备注里注明其论坛名字及ID,公司等信息
发远程时同时也发一下帖子地址,方便了解要解决的问题  WeX5教程  WeX5下载



如按照该方法解决,请及时跟帖,便于版主结贴
回复 支持 反对

使用道具 举报

92

主题

254

帖子

638

积分

高级会员

Rank: 4

积分
638
QQ
 楼主| 发表于 2017-4-17 10:25:52 | 显示全部楼层
jishuang 发表于 2017-4-14 17:34
2楼的链接中有说明aggregate怎么设置啊

KSQL的源码如下:
select HX_ProjectApply.*,SQL.isnull((select  sum(FI_RentWriteOff.fIncome) from FI_RentWriteOff FI_RentWriteOff  where  FI_RentWriteOff.fXJLID in (select  HX_YJXJL from HX_YJXJL HX_YJXJL  where  HX_YJXJL.fLXID = HX_ProjectApply AND HX_YJXJL.fQC <> 0 ) ), 0) as YSZLF,
SQL.isnull((select   sum(HX_YJXJL.fZLFSQ) + sum(HX_YJXJL.fQMGZF)  from HX_YJXJL HX_YJXJL  where HX_YJXJL.fLXID = HX_ProjectApply), 0) - SQL.isnull((select  sum(FI_RentWriteOff.fIncome) from FI_RentWriteOff FI_RentWriteOff  where  FI_RentWriteOff.fXJLID in (select  HX_YJXJL from HX_YJXJL HX_YJXJL  where  HX_YJXJL.fLXID = HX_ProjectApply AND HX_YJXJL.fQC <> 0 ) ), 0)  - SQL.isnull((select  sum(FI_LawRentOff.fHMJE) from FI_LawRentOff FI_LawRentOff  where  FI_LawRentOff.fZJZFBID in (select  HX_YJXJL from HX_YJXJL HX_YJXJL  where  HX_YJXJL.fLXID = HX_ProjectApply AND HX_YJXJL.fQC <> 0 ) ), 0) as WSZJ
    from HX_ProjectApply HX_ProjectApply

当 aggregate 设置如下:SUM(HX_ProjectApply.fContactValue) as ConValue,
SUM(HX_ProjectApply.fMargin) as Margin,
SUM(HX_ProjectApply.fQMGZK) as QMGZK,
SUM(HX_ProjectApply.fSXRZE) as SXRZE,
SUM(HX_ProjectApply.fContactValue*HX_ProjectApply.fYJIRR)/SUM(HX_ProjectApply.fContactValue) as IRR,
SUM(YSZLF) as yszf
其中  SUM(YSZLF) as yszf  是自定义字段,后续grid 要进行汇总的。


报错选下:


2017-04-17 08:45:52 excute stream action, params:{"accept":"application/json","action":"queryHX_ProjectApplyAction","actionFlag":"__action_0__","activity":"LoanCompleteActivity","contentType":"json","executeContext":"","executor":"","parameters":{"aggregateColumns":"ConValue,IRR,Margin,QMGZK,SXRZE,yszf","columns":"HX_ProjectApply,WSZJ,YSZLF,fAttachment,fBLDYRY,fBLDYSJ,fBZJCLFS,fBusinessType,fConHireDate,fContact,fContactValue,fContractDate,fContractMode,fContractNo,fContractPerson,fCustomCode,fCustomName,fCustomShortName,fDYDJSBH,fDYHTBH,fDeviceNo,fDevicePrice,fDuration,fEndDate,fEndFlag,fFirstPayment,fFirstPaymentRatio,fFlag,fGuaranteeType,fGuarantor,fGuarantorID,fHanding,fHandingRate,fHireDate,fIntentCode,fLoanCompleteMark,fLoanType,fMQFKR,fMargin,fMarginRate,fMortgage,fPrefix,fProcessName,fProjectCode,fQMGZK,fRFXL,fRepayCyc,fResidence,fSBFZDD,fSBGG,fSBLX,fSBMC,fSBSCS,fSBXH,fSBXSS,fSSBZ,fSXRZE,fSupShortName,fSupplier,fSupplierNo,fTrackNo,fValue,fYJIRR,fZLQMCLFS,version","filter":"(HX_ProjectApply.fFlag ='1' and HX_ProjectApply.fEndFlag ='0' and HX_ProjectApply.fLoanType ='分次放款' and HX_ProjectApply.fLoanCompleteMark ='0')","limit":-1,"offset":0,"variables":{}},"process":"/FinancialLease/HD/process/Lease/leaseProcess","translateParameter":{"cellnameByRelation":false,"dataType":"row-list","includeState":true,"rowsConfig":{"concept":"HX_ProjectApply","sequence":"HX_ProjectApply,WSZJ,YSZLF,fAttachment,fBLDYRY,fBLDYSJ,fBZJCLFS,fBusinessType,fConHireDate,fContact,fContactValue,fContractDate,fContractMode,fContractNo,fContractPerson,fCustomCode,fCustomName,fCustomShortName,fDYDJSBH,fDYHTBH,fDeviceNo,fDevicePrice,fDuration,fEndDate,fEndFlag,fFirstPayment,fFirstPaymentRatio,fFlag,fGuaranteeType,fGuarantor,fGuarantorID,fHanding,fHandingRate,fHireDate,fIntentCode,fLoanCompleteMark,fLoanType,fMQFKR,fMargin,fMarginRate,fMortgage,fPrefix,fProcessName,fProjectCode,fQMGZK,fRFXL,fRepayCyc,fResidence,fSBFZDD,fSBGG,fSBLX,fSBMC,fSBSCS,fSBXH,fSBXSS,fSSBZ,fSXRZE,fSupShortName,fSupplier,fSupplierNo,fTrackNo,fValue,fYJIRR,fZLQMCLFS,version"},"transformIdcolumn":true,"useNamespace":true}}
java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at com.justep.system.action.Engine.invokeActions(Native Method)
        at com.justep.system.action.Engine.invokeActions(Unknown Source)
        at com.justep.business.server.BusinessServer.doAction(Unknown Source)
        at com.justep.business.server.BusinessServer.doExcute(Unknown Source)
        at com.justep.business.server.BusinessServer.excute(Unknown Source)
        at com.justep.business.server.BusinessServer.excute(Unknown Source)
        at com.justep.business.server.BusinessServerServlet.execService(Unknown Source)
        at com.justep.business.server.BusinessServerServlet.service(Unknown Source)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
        at com.justep.x.bs.BusinessServerServlet.service(Unknown Source)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
        at java.lang.Thread.run(Thread.java:745)
Caused by: com.justep.exception.BusinessException: 编码: JUSTEP150210; 提示: 执行KSQL出错, KSQL: SELECT SUM(HX_ProjectApply.fContactValue) as ConValue,
SUM(HX_ProjectApply.fMargin) as Margin,
SUM(HX_ProjectApply.fQMGZK) as QMGZK,
SUM(HX_ProjectApply.fSXRZE) as SXRZE,
SUM(HX_ProjectApply.fContactValue*HX_ProjectApply.fYJIRR)/SUM(HX_ProjectApply.fContactValue) as IRR,
SUM(YSZLF) as yszf  FROM HX_ProjectApply HX_ProjectApply WHERE ((HX_ProjectApply.fFlag ='1' and HX_ProjectApply.fEndFlag ='0' and HX_ProjectApply.fLoanType ='分次放款' and HX_ProjectApply.fLoanCompleteMark ='0'))
--> sql:
--> binds: []
        at com.justep.exception.BusinessException.create(Unknown Source)
        at com.justep.system.data.impl.TableUtilsImplement.ksqlSelect(Unknown Source)
        at com.justep.system.data.impl.TableUtilsImplement.ksqlSelect(Unknown Source)
        at com.justep.system.data.impl.TableUtilsImplement.ksqlSelect(Unknown Source)
        at com.justep.system.data.BizData.query(Unknown Source)
        at BizProcedure.query(BizProcedure.java:12)
        ... 27 more
Caused by: com.justep.exception.BusinessException: 编码: JUSTEP154054; 提示: KSQL语法错误, YSZLF找不到对应的符号描述
        at com.justep.exception.BusinessException.create(Unknown Source)
        at com.justep.util.Utils.check(Unknown Source)
        at com.justep.system.ksql.visitor.SQLVisitor.visit(Unknown Source)
        at com.justep.system.ksql.node.IdentiferNode.accept(Unknown Source)
        at com.justep.system.ksql.visitor.SQLVisitor.visitChildren(Unknown Source)
        at com.justep.system.ksql.visitor.SQLVisitor.visit(Unknown Source)
        at com.justep.system.ksql.node.FunctionNode.accept(Unknown Source)
        at com.justep.system.ksql.visitor.SQLVisitor.visitChildren(Unknown Source)
        at com.justep.system.ksql.visitor.SQLVisitor.visit(Unknown Source)
        at com.justep.system.ksql.node.SelectColumnNode.accept(Unknown Source)
        at com.justep.system.ksql.visitor.SQLVisitor.visitChildren(Unknown Source)
        at com.justep.system.ksql.visitor.SQLVisitor.visit(Unknown Source)
        at com.justep.system.ksql.visitor.QueryVisitor.visit(Unknown Source)
        at com.justep.system.ksql.node.SelectListNode.accept(Unknown Source)
        at com.justep.system.ksql.visitor.SQLVisitor.visitChildren(Unknown Source)
        at com.justep.system.ksql.visitor.SQLVisitor.visit(Unknown Source)
        at com.justep.system.ksql.node.SelectSentenceNode.accept(Unknown Source)
        at com.justep.system.ksql.visitor.SQLVisitor.visitChildren(Unknown Source)
        at com.justep.system.ksql.visitor.QueryVisitor.visit(Unknown Source)
        at com.justep.system.ksql.node.QuerySentence.accept(Unknown Source)

        ... 32 more



回复 支持 反对

使用道具 举报

92

主题

254

帖子

638

积分

高级会员

Rank: 4

积分
638
QQ
 楼主| 发表于 2017-4-17 10:26:14 | 显示全部楼层
jishuang 发表于 2017-4-17 10:20
直接 sum(YSZLF) as ysf,sum(WSZJ) as wsf? 好像不行嘛

具体什么提示信息




当 aggregate 设置如下:SUM(HX_ProjectApply.fContactValue) as ConValue,
SUM(HX_ProjectApply.fMargin) as Margin,
SUM(HX_ProjectApply.fQMGZK) as QMGZK,
SUM(HX_ProjectApply.fSXRZE) as SXRZE,
SUM(HX_ProjectApply.fContactValue*HX_ProjectApply.fYJIRR)/SUM(HX_ProjectApply.fContactValue) as IRR,
SUM(SQL.isnull((select  sum(FI_RentWriteOff.fIncome) from FI_RentWriteOff FI_RentWriteOff  where  FI_RentWriteOff.fXJLID in (select  HX_YJXJL from HX_YJXJL HX_YJXJL  where  HX_YJXJL.fLXID = HX_ProjectApply AND HX_YJXJL.fQC <> 0 ) ), 0)) as yszf

报错选下:2017-04-17 08:35:50 excute stream action, params:{"accept":"application/json","action":"queryHX_ProjectApplyAction","actionFlag":"__action_0__","activity":"LoanCompleteActivity","contentType":"json","executeContext":"","executor":"","parameters":{"aggregateColumns":"ConValue,IRR,Margin,QMGZK,SXRZE,ysz","columns":"HX_ProjectApply,WSZJ,YSZLF,fAttachment,fBLDYRY,fBLDYSJ,fBZJCLFS,fBusinessType,fConHireDate,fContact,fContactValue,fContractDate,fContractMode,fContractNo,fContractPerson,fCustomCode,fCustomName,fCustomShortName,fDYDJSBH,fDYHTBH,fDeviceNo,fDevicePrice,fDuration,fEndDate,fEndFlag,fFirstPayment,fFirstPaymentRatio,fFlag,fGuaranteeType,fGuarantor,fGuarantorID,fHanding,fHandingRate,fHireDate,fIntentCode,fLoanCompleteMark,fLoanType,fMQFKR,fMargin,fMarginRate,fMortgage,fPrefix,fProcessName,fProjectCode,fQMGZK,fRFXL,fRepayCyc,fResidence,fSBFZDD,fSBGG,fSBLX,fSBMC,fSBSCS,fSBXH,fSBXSS,fSSBZ,fSXRZE,fSupShortName,fSupplier,fSupplierNo,fTrackNo,fValue,fYJIRR,fZLQMCLFS,version","filter":"(HX_ProjectApply.fFlag ='1' and HX_ProjectApply.fEndFlag ='0' and HX_ProjectApply.fLoanType ='分次放款' and HX_ProjectApply.fLoanCompleteMark ='0')","limit":-1,"offset":0,"variables":{}},"process":"/FinancialLease/HD/process/Lease/leaseProcess","translateParameter":{"cellnameByRelation":false,"dataType":"row-list","includeState":true,"rowsConfig":{"concept":"HX_ProjectApply","sequence":"HX_ProjectApply,WSZJ,YSZLF,fAttachment,fBLDYRY,fBLDYSJ,fBZJCLFS,fBusinessType,fConHireDate,fContact,fContactValue,fContractDate,fContractMode,fContractNo,fContractPerson,fCustomCode,fCustomName,fCustomShortName,fDYDJSBH,fDYHTBH,fDeviceNo,fDevicePrice,fDuration,fEndDate,fEndFlag,fFirstPayment,fFirstPaymentRatio,fFlag,fGuaranteeType,fGuarantor,fGuarantorID,fHanding,fHandingRate,fHireDate,fIntentCode,fLoanCompleteMark,fLoanType,fMQFKR,fMargin,fMarginRate,fMortgage,fPrefix,fProcessName,fProjectCode,fQMGZK,fRFXL,fRepayCyc,fResidence,fSBFZDD,fSBGG,fSBLX,fSBMC,fSBSCS,fSBXH,fSBXSS,fSSBZ,fSXRZE,fSupShortName,fSupplier,fSupplierNo,fTrackNo,fValue,fYJIRR,fZLQMCLFS,version"},"transformIdcolumn":true,"useNamespace":true}}
java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at com.justep.system.action.Engine.invokeActions(Native Method)
        at com.justep.system.action.Engine.invokeActions(Unknown Source)
        at com.justep.business.server.BusinessServer.doAction(Unknown Source)
        at com.justep.business.server.BusinessServer.doExcute(Unknown Source)
        at com.justep.business.server.BusinessServer.excute(Unknown Source)
        at com.justep.business.server.BusinessServer.excute(Unknown Source)
        at com.justep.business.server.BusinessServerServlet.execService(Unknown Source)
        at com.justep.business.server.BusinessServerServlet.service(Unknown Source)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
        at com.justep.x.bs.BusinessServerServlet.service(Unknown Source)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
        at java.lang.Thread.run(Thread.java:745)
Caused by: com.justep.exception.BusinessException: 编码: JUSTEP150210; 提示: 执行KSQL出错, KSQL: SELECT SUM(HX_ProjectApply.fContactValue) as ConValue,
SUM(HX_ProjectApply.fMargin) as Margin,
SUM(HX_ProjectApply.fQMGZK) as QMGZK,
SUM(HX_ProjectApply.fSXRZE) as SXRZE,
SUM(HX_ProjectApply.fContactValue*HX_ProjectApply.fYJIRR)/SUM(HX_ProjectApply.fContactValue) as IRR,
SUM(SQL.isnull((select  sum(FI_RentWriteOff.fIncome) from FI_RentWriteOff FI_RentWriteOff  where  FI_RentWriteOff.fXJLID in (select  HX_YJXJL from HX_YJXJL HX_YJXJL  where  HX_YJXJL.fLXID = HX_ProjectApply AND HX_YJXJL.fQC <> 0 ) ), 0)) as ysz  FROM HX_ProjectApply HX_ProjectApply WHERE ((HX_ProjectApply.fFlag ='1' and HX_ProjectApply.fEndFlag ='0' and HX_ProjectApply.fLoanType ='分次放款' and HX_ProjectApply.fLoanCompleteMark ='0'))
--> sql: SELECT  SUM(HX_ProjectApply.FCONTACTVALUE) AS ConValue, SUM(HX_ProjectApply.FMARGIN) AS Margin, SUM(HX_ProjectApply.FQMGZK) AS QMGZK, SUM(HX_ProjectApply.FSXRZE) AS SXRZE, ( SUM(( HX_ProjectApply.FCONTACTVALUE * HX_ProjectApply.FYJIRR )) / SUM(HX_ProjectApply.FCONTACTVALUE) ) AS IRR, SUM(isnull((SELECT  SUM(FI_RentWriteOff.FINCOME) FROM FI_RENTWRITEOFF FI_RentWriteOff  WHERE FI_RentWriteOff.FXJLID IN (SELECT  HX_YJXJL.fID FROM HX_YJXJL HX_YJXJL  WHERE  (HX_YJXJL.FLXID = HX_ProjectApply.fID) AND (HX_YJXJL.FQC <> ?) )), ?)) AS ysz FROM HX_ProjectApply HX_ProjectApply  WHERE  (HX_ProjectApply.FFLAG = ?) AND (HX_ProjectApply.FENDFLAG = ?) AND (HX_ProjectApply.FLOANTYPE = ?) AND (HX_ProjectApply.FLOANCOMPLETEMARK = ?)
--> binds: [0, 0, 1, 0, 分次放款, 0]
        at com.justep.exception.BusinessException.create(Unknown Source)
        at com.justep.system.data.impl.TableUtilsImplement.ksqlSelect(Unknown Source)
        at com.justep.system.data.impl.TableUtilsImplement.ksqlSelect(Unknown Source)
        at com.justep.system.data.impl.TableUtilsImplement.ksqlSelect(Unknown Source)
        at com.justep.system.data.BizData.query(Unknown Source)
        at BizProcedure.query(BizProcedure.java:12)
        ... 27 more
Caused by: com.justep.exception.BusinessException: 编码: JUSTEP150039; 提示: 执行sql: SELECT  SUM(HX_ProjectApply.FCONTACTVALUE) AS ConValue, SUM(HX_ProjectApply.FMARGIN) AS Margin, SUM(HX_ProjectApply.FQMGZK) AS QMGZK, SUM(HX_ProjectApply.FSXRZE) AS SXRZE, ( SUM(( HX_ProjectApply.FCONTACTVALUE * HX_ProjectApply.FYJIRR )) / SUM(HX_ProjectApply.FCONTACTVALUE) ) AS IRR, SUM(isnull((SELECT  SUM(FI_RentWriteOff.FINCOME) FROM FI_RENTWRITEOFF FI_RentWriteOff  WHERE FI_RentWriteOff.FXJLID IN (SELECT  HX_YJXJL.fID FROM HX_YJXJL HX_YJXJL  WHERE  (HX_YJXJL.FLXID = HX_ProjectApply.fID) AND (HX_YJXJL.FQC <> ?) )), ?)) AS ysz FROM HX_ProjectApply HX_ProjectApply  WHERE  (HX_ProjectApply.FFLAG = ?) AND (HX_ProjectApply.FENDFLAG = ?) AND (HX_ProjectApply.FLOANTYPE = ?) AND (HX_ProjectApply.FLOANCOMPLETEMARK = ?) , binds: [0, 0, 1, 0, 分次放款, 0]出错
        at com.justep.exception.BusinessException.create(Unknown Source)
        at com.justep.system.ksql.KSQLUtils.execSqlSelect(Unknown Source)
        ... 32 more
Caused by: java.sql.SQLException: 不能对包含聚合或子查询的表达式执行聚合函数。
        at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:365)
        at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2781)
        at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2224)
        at net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:628)
        at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQLQuery(JtdsStatement.java:418)
        at net.sourceforge.jtds.jdbc.JtdsPreparedStatement.executeQuery(JtdsPreparedStatement.java:693)
        at org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:96)
        at org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:96)
        ... 33 more


请问下,KSQL中的YSZLF,WSZJ的汇总我该如何处理?
回复 支持 反对

使用道具 举报

91

主题

13万

帖子

3万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
36067
发表于 2017-4-17 11:14:46 | 显示全部楼层
这个不是ksql不支持,是sql不支持

这样复杂的语句,可以通过重写queryAction通过sql或者视图等方式实现,现在数据库中写sql实现需要的查询结果
远程的联系方法QQ1392416607,添加好友时,需在备注里注明其论坛名字及ID,公司等信息
发远程时同时也发一下帖子地址,方便了解要解决的问题  WeX5教程  WeX5下载



如按照该方法解决,请及时跟帖,便于版主结贴
回复 支持 反对

使用道具 举报

92

主题

254

帖子

638

积分

高级会员

Rank: 4

积分
638
QQ
 楼主| 发表于 2017-4-17 11:28:27 | 显示全部楼层
jishuang 发表于 2017-4-17 11:14
这个不是ksql不支持,是sql不支持

这样复杂的语句,可以通过重写queryAction通过sql或者视图等方式实现, ...

不是啊,我就是要能够汇总到这个列的信息啊,重新写queryAction,grid进行了过滤的话,结果就不对了
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|X3技术论坛|Justep Inc.    

GMT+8, 2024-11-23 22:01 , Processed in 0.059550 second(s), 26 queries .

Powered by Discuz! X3.4

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表