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

QQ登录

只需一步,快速开始

查看: 4150|回复: 1

[结贴] 过滤的问题

[复制链接]

506

主题

1631

帖子

3387

积分

论坛元老

Rank: 8Rank: 8

积分
3387
QQ
发表于 2017-4-29 16:39:18 | 显示全部楼层 |阅读模式
SAM_ASSET.fLibraryId = '"+row.getID()+"' and SAM_ASSET.fApprovedState='已发布' and (SAM_ASSET.fLibraryId in (select c.fLibraryId from SAM_ContactIs c where c.fPersonId='"+PersonID+"') or instr(SAM_ASSET.fSearchLibrary,'"+DeptID+"')>0)
上面的条件在SQL的where里没问题,但要想在X5的setFilter中起作用,不自己写SQL,有什么方法吗?现在用下面的方法报错:
mainData.setFilter("idFilter", "SAM_ASSET.fLibraryId = '"+row.getID()+"' and SAM_ASSET.fApprovedState='已发布' and (SAM_ASSET.fLibraryId in (select c.fLibraryId from SAM_ContactIs c where c.fPersonId='"+PersonID+"') or instr(SAM_ASSET.fSearchLibrary,'"+DeptID+"')>0)");
mainData.refreshData();
  1. 2017-04-29 16:38:47 excute stream action, params:{"accept":"application/json","action":"querySAM_ASSETAction","actionFlag":"__action_0__","activity":"mainActivity","contentType":"json","executeContext":"","executor":"","parameters":{"columns":"SAM_ASSET,fAbstract,fAcceptanceDate,fAgencyPublicationNumber,fApprovedState,fBizState,fBizStateName,fCategoryName,fClassificationMachanism,fComplianceToStandards,fCost,fCreateTime,fCreatorFId,fCreatorId,fCurrentActivities,fCurrentExecutors,fDistributionStatement,fDomain,fDomainName,fFacet,fFacetCategory,fFacetLabel,fFacetTerm,fIsAdopt,fIsAudit,fIsComplete,fIsJoin,fIsPass,fIsPublish,fKeyword,fLanguage,fLanguageName,fLibraryId,fLibraryName,fName,fProvider,fReference,fRegistryDate,fRegistryNumber,fRestriction,fRetrievableExtent,fSearchLibrary,fSearchLibraryName,fSearchWay,fSecretLevel,fSecretLevelName,fSecurityCategory,fSort,fTargetEnvironment,fTerm,fTermLabel,fTransferSize,fUrl,fVersionNumber,fVersiondate,fWarranties,version","filter":"(SAM_ASSET.fLibraryId = '565C51600E88462B80C8D256CB16BB8D' and SAM_ASSET.fApprovedState='已发布' and (SAM_ASSET.fLibraryId in (select c.fLibraryId from SAM_ContactIs c where c.fPersonId='fDf9xfCSNvdeDxJZvCX') or instr(SAM_ASSET.fSearchLibrary,'tW0iziUBPS1I37bhdAc')>0))","limit":20,"offset":0,"orderBy":"fCreateTime DESC","variables":{}},"process":"/portal/process/message/messageProcess","translateParameter":{"cellnameByRelation":false,"dataType":"row-list","includeState":true,"rowsConfig":{"concept":"SAM_ASSET","sequence":"SAM_ASSET,fAbstract,fAcceptanceDate,fAgencyPublicationNumber,fApprovedState,fBizState,fBizStateName,fCategoryName,fClassificationMachanism,fComplianceToStandards,fCost,fCreateTime,fCreatorFId,fCreatorId,fCurrentActivities,fCurrentExecutors,fDistributionStatement,fDomain,fDomainName,fFacet,fFacetCategory,fFacetLabel,fFacetTerm,fIsAdopt,fIsAudit,fIsComplete,fIsJoin,fIsPass,fIsPublish,fKeyword,fLanguage,fLanguageName,fLibraryId,fLibraryName,fName,fProvider,fReference,fRegistryDate,fRegistryNumber,fRestriction,fRetrievableExtent,fSearchLibrary,fSearchLibraryName,fSearchWay,fSecretLevel,fSecretLevelName,fSecurityCategory,fSort,fTargetEnvironment,fTerm,fTermLabel,fTransferSize,fUrl,fVersionNumber,fVersiondate,fWarranties,version"},"transformIdcolumn":true,"useNamespace":true}}
  2. java.lang.reflect.InvocationTargetException
  3.         at sun.reflect.GeneratedMethodAccessor138.invoke(Unknown Source)
  4.         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  5.         at java.lang.reflect.Method.invoke(Method.java:497)
  6.         at com.justep.system.action.Engine.invokeActions(Native Method)
  7.         at com.justep.system.action.Engine.invokeActions(Unknown Source)
  8.         at com.justep.business.server.BusinessServer.doAction(Unknown Source)
  9.         at com.justep.business.server.BusinessServer.doExcute(Unknown Source)
  10.         at com.justep.business.server.BusinessServer.excute(Unknown Source)
  11.         at com.justep.business.server.BusinessServer.excute(Unknown Source)
  12.         at com.justep.business.server.BusinessServerServlet.execService(Unknown Source)
  13.         at com.justep.business.server.BusinessServerServlet.service(Unknown Source)
  14.         at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
  15.         at com.justep.x.bs.BusinessServerServlet.service(Unknown Source)
  16.         at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
  17.         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
  18.         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
  19.         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
  20.         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
  21.         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
  22.         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
  23.         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
  24.         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
  25.         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)
  26.         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606)
  27.         at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
  28.         at java.lang.Thread.run(Thread.java:745)
  29. Caused by: com.justep.exception.BusinessException: 编码: JUSTEP150210; 提示: 执行KSQL出错, KSQL: SELECT SAM_ASSET.*  FROM SAM_ASSET SAM_ASSET WHERE ((SAM_ASSET.fLibraryId = '565C51600E88462B80C8D256CB16BB8D' and SAM_ASSET.fApprovedState='已发布' and (SAM_ASSET.fLibraryId in (select c.fLibraryId from SAM_ContactIs c where c.fPersonId='fDf9xfCSNvdeDxJZvCX') or instr(SAM_ASSET.fSearchLibrary,'tW0iziUBPS1I37bhdAc')>0))) ORDER BY fCreateTime DESC LIMIT 0, 20
  30. --> sql:
  31. --> binds: []
  32.         at com.justep.exception.BusinessException.create(Unknown Source)
  33.         at com.justep.system.data.impl.TableUtilsImplement.ksqlSelect(Unknown Source)
  34.         at com.justep.system.data.impl.TableUtilsImplement.ksqlSelect(Unknown Source)
  35.         at com.justep.system.data.impl.TableUtilsImplement.ksqlSelect(Unknown Source)
  36.         at com.justep.system.data.BizData.query(Unknown Source)
  37.         at BizProcedure.query(BizProcedure.java:12)
  38.         ... 26 more
  39. Caused by: com.justep.exception.BusinessException: 编码: JUSTEP154053; 提示: KSQL语法错误, columns中的列fLibraryId必须包含在select查出列中
  40.         at com.justep.exception.BusinessException.create(Unknown Source)
  41.         at com.justep.util.Utils.check(Unknown Source)
  42.         at com.justep.system.ksql.parser.AbstractParser.handleColumns(Unknown Source)
  43.         at com.justep.system.ksql.parser.AbstractParser.selectSentenceNode(Unknown Source)
  44.         at com.justep.system.ksql.parser.QueryParser.start(Unknown Source)
  45.         at com.justep.system.ksql.parser.QueryParser.start(Unknown Source)
  46.         at com.justep.system.ksql.parser.AbstractParser.parse(Unknown Source)
  47.         ... 31 more
复制代码



发表于 2017-5-2 09:51:31 | 显示全部楼层
columns中的列fLibraryId必须包含在select查出列中

请问你的mainData  组件中有没有这个列的定义呢??columns 属性有没有指定固定的几个列?
qq:1912779713
WeX5教程--WeX5下载
回复 支持 反对

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-11-24 07:38 , Processed in 0.104110 second(s), 23 queries .

Powered by Discuz! X3.4

© 2001-2013 Comsenz Inc.

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