SQL语句家参数报错,请帮忙解决下
管理员请帮忙看下SQL语句
select subscriberid,sign_name,sign_phone,apid,sign_card,Operate_Type,sign_status,createdate
from SubscriberInfo where 1=1
${has(startTime)?(" and to_date(senddate,'yyyy-MM-dd HH24:mi:ss') >= to_date('"+startTime+" 00:00:00','yyyy-MM-dd HH24:mi:ss')"):""}
${has(endTime)?(" and to_date(senddate,'yyyy-MM-dd HH24:mi:ss') <= to_date('"+endTime+" 23:59:59','yyyy-MM-dd HH24:mi:ss')"):""}
${has(apid)?(" and apid=" + apid):""}
${has(status)?(" and sign_status=" + status):""}
只要是加上后两他参数预览就报错,不加的话可以正常预览。
${has(apid)?(" and apid=" + apid):""}
${has(status)?(" and sign_status=" + status):""}
错误信息如下:
Exception in thread "Thread-13" java.lang.StackOverflowError
at bsh.NameSpace.getVariableImpl(NameSpace.java:536)
at bsh.NameSpace.getVariable(NameSpace.java:489)
at bsh.NameSpace.getVariable(NameSpace.java:474)
at bsh.Name.resolveThisFieldReference(Name.java:598)
at bsh.Name.consumeNextObjectField(Name.java:237)
at bsh.Name.toObject(Name.java:199)
at bsh.BSHAmbiguousName.toObject(BSHAmbiguousName.java:93)
at bsh.BSHPrimaryExpression.eval(BSHPrimaryExpression.java:106)
at bsh.BSHPrimaryExpression.eval(BSHPrimaryExpression.java:55)
at bsh.BSHArguments.getArguments(BSHArguments.java:65)
at bsh.NameSpace.invokeLocalMethod(NameSpace.java:1335)
at bsh.Name.invokeLocalMethod(Name.java:932)
at bsh.Name.invokeMethod(Name.java:818)
at bsh.BSHMethodInvocation.eval(BSHMethodInvocation.java:48)
at bsh.BSHPrimaryExpression.eval(BSHPrimaryExpression.java:114)
at bsh.BSHPrimaryExpression.eval(BSHPrimaryExpression.java:55)
at bsh.BSHIfStatement.evaluateCondition(BSHIfStatement.java:63)
at bsh.BSHTernaryExpression.eval(BSHTernaryExpression.java:54)
at bsh.Interpreter.eval(Interpreter.java:928)
at bsh.Interpreter.eval(Interpreter.java:775)
at bsh.Interpreter.eval(Interpreter.java:1030)
at bsh.Interpreter.eval(Interpreter.java:1020)
at jatools.engine.script.ReportContext.eval(ReportContext.java:273)
at jatools.engine.script.ReportContext.evalTemplate(ReportContext.java:224)
at jatools.data.reader.sql.SqlReader.readStart(SqlReader.java:205)
at jatools.data.reader.sql.SqlReader.getDataset(SqlReader.java:490)
at jatools.data.reader.sql.SqlReader.doRead(SqlReader.java:481)
at jatools.data.reader.AbstractDatasetReader.read(AbstractDatasetReader.java:88)
at jatools.dom.src.DatasetNodeSource.create(DatasetNodeSource.java:130)
at jatools.dom.NodeFactory.createChildNodes(NodeFactory.java:45)
at jatools.dom.ElementBase.getChildElements(ElementBase.java:500)
at jatools.dom.DatasetBasedNode.getLength(DatasetBasedNode.java:393)
at jatools.dom.DatasetBasedNode.getFirstChild(DatasetBasedNode.java:236)
at org.jaxen.dom.DocumentNavigator$1.getFirstNode(DocumentNavigator.java:155)
at org.jaxen.dom.DocumentNavigator$NodeIterator.<init>(DocumentNavigator.java:895)
at org.jaxen.dom.DocumentNavigator$1.<init>(DocumentNavigator.java:152)
at org.jaxen.dom.DocumentNavigator.getChildAxisIterator(DocumentNavigator.java:152)
at org.jaxen.expr.iter.IterableChildAxis.iterator(IterableChildAxis.java:76)
at org.jaxen.expr.DefaultNameStep.evaluate(DefaultNameStep.java:199)
at org.jaxen.expr.DefaultLocationPath.evaluate(DefaultLocationPath.java:140)
at org.jaxen.expr.DefaultAbsoluteLocationPath.evaluate(DefaultAbsoluteLocationPath.java:113)
at org.jaxen.expr.DefaultXPathExpr.asList(DefaultXPathExpr.java:102)
at org.jaxen.BaseXPath.selectNodesForContext(BaseXPath.java:674)
at org.jaxen.BaseXPath.selectNodes(BaseXPath.java:213)
at jatools.dom.src.xpath.XPath.selectNodes(XPath.java:137)
at jatools.dom.NodeProxy.value(NodeProxy.java:25)
at bsh.NameSpace.getVariable(NameSpace.java:494)
at bsh.NameSpace.getVariable(NameSpace.java:474)
at bsh.Name.resolveThisFieldReference(Name.java:598)
at bsh.Name.consumeNextObjectField(Name.java:237)
at bsh.Name.toObject(Name.java:199)
at bsh.BSHAmbiguousName.toObject(BSHAmbiguousName.java:93)
at bsh.BSHPrimaryExpression.eval(BSHPrimaryExpression.java:106)
at bsh.BSHPrimaryExpression.eval(BSHPrimaryExpression.java:55)
at bsh.BSHArguments.getArguments(BSHArguments.java:65)
at bsh.NameSpace.invokeLocalMethod(NameSpace.java:1335)
at bsh.Name.invokeLocalMethod(Name.java:932)
at bsh.Name.invokeMethod(Name.java:818)
at bsh.BSHMethodInvocation.eval(BSHMethodInvocation.java:48)
at bsh.BSHPrimaryExpression.eval(BSHPrimaryExpression.java:114)
at bsh.BSHPrimaryExpression.eval(BSHPrimaryExpression.java:55)
at bsh.BSHIfStatement.evaluateCondition(BSHIfStatement.java:63)
at bsh.BSHTernaryExpression.eval(BSHTernaryExpression.java:54)
at bsh.Interpreter.eval(Interpreter.java:816)
at bsh.Interpreter.eval(Interpreter.java:777)
at bsh.Interpreter.eval(Interpreter.java:1030)
at bsh.Interpreter.eval(Interpreter.java:1020)
at jatools.engine.script.ReportContext.eval(ReportContext.java:273)
at jatools.engine.script.ReportContext.evalTemplate(ReportContext.java:224)
at jatools.data.reader.sql.SqlReader.readStart(SqlReader.java:205)
at jatools.data.reader.sql.SqlReader.getDataset(SqlReader.java:490)
at jatools.data.reader.sql.SqlReader.doRead(SqlReader.java:481)
at jatools.data.reader.AbstractDatasetReader.read(AbstractDatasetReader.java:88)
at jatools.dom.src.DatasetNodeSource.create(DatasetNodeSource.java:130)
at jatools.dom.NodeFactory.createChildNodes(NodeFactory.java:45)
at jatools.dom.ElementBase.getChildElements(ElementBase.java:500)
at jatools.dom.DatasetBasedNode.getLength(DatasetBasedNode.java:393)
at jatools.dom.DatasetBasedNode.getFirstChild(DatasetBasedNode.java:236)
at org.jaxen.dom.DocumentNavigator$1.getFirstNode(DocumentNavigator.java:155)
at org.jaxen.dom.DocumentNavigator$NodeIterator.<init>(DocumentNavigator.java:895)
at org.jaxen.dom.DocumentNavigator$1.<init>(DocumentNavigator.java:152)
at org.jaxen.dom.DocumentNavigator.getChildAxisIterator(DocumentNavigator.java:152)
at org.jaxen.expr.iter.IterableChildAxis.iterator(IterableChildAxis.java:76)
at org.jaxen.expr.DefaultNameStep.evaluate(DefaultNameStep.java:199)
at org.jaxen.expr.DefaultLocationPath.evaluate(DefaultLocationPath.java:140)
at org.jaxen.expr.DefaultAbsoluteLocationPath.evaluate(DefaultAbsoluteLocationPath.java:113)
at org.jaxen.expr.DefaultXPathExpr.asList(DefaultXPathExpr.java:102)
at org.jaxen.BaseXPath.selectNodesForContext(BaseXPath.java:674)
at org.jaxen.BaseXPath.selectNodes(BaseXPath.java:213)
at jatools.dom.src.xpath.XPath.selectNodes(XPath.java:137)
at jatools.dom.NodeProxy.value(NodeProxy.java:25)
at bsh.NameSpace.getVariable(NameSpace.java:494)
at bsh.NameSpace.getVariable(NameSpace.java:474)
at bsh.Name.resolveThisFieldReference(Name.java:598)
at bsh.Name.consumeNextObjectField(Name.java:237)
at bsh.Name.toObject(Name.java:199)
at bsh.BSHAmbiguousName.toObject(BSHAmbiguousName.java:93)
at bsh.BSHPrimaryExpression.eval(BSHPrimaryExpression.java:106)
at bsh.BSHPrimaryExpression.eval(BSHPrimaryExpression.java:55)
at bsh.BSHArguments.getArguments(BSHArguments.java:65)
at bsh.NameSpace.invokeLocalMethod(NameSpace.java:1335)
at bsh.Name.invokeLocalMethod(Name.java:932)
at bsh.Name.invokeMethod(Name.java:818)
at bsh.BSHMethodInvocation.eval(BSHMethodInvocation.java:48)
at bsh.BSHPrimaryExpression.eval(BSHPrimaryExpression.java:114)
at bsh.BSHPrimaryExpression.eval(BSHPrimaryExpression.java:55)
at bsh.BSHIfStatement.evaluateCondition(BSHIfStatement.java:63)
at bsh.BSHTernaryExpression.eval(BSHTernaryExpression.java:54)
at bsh.Interpreter.eval(Interpreter.java:816)
at bsh.Interpreter.eval(Interpreter.java:777)
at bsh.Interpreter.eval(Interpreter.java:1030)
at bsh.Interpreter.eval(Interpreter.java:1020)
at jatools.engine.script.ReportContext.eval(ReportContext.java:273)
at jatools.engine.script.ReportContext.evalTemplate(ReportContext.java:224)
at jatools.data.reader.sql.SqlReader.readStart(SqlReader.java:205)
at jatools.data.reader.sql.SqlReader.getDataset(SqlReader.java:490)
at jatools.data.reader.sql.SqlReader.doRead(SqlReader.java:481)
at jatools.data.reader.AbstractDatasetReader.read(AbstractDatasetReader.java:88)
at jatools.dom.src.DatasetNodeSource.create(DatasetNodeSource.java:130)
at jatools.dom.NodeFactory.createChildNodes(NodeFactory.java:45)
at jatools.dom.ElementBase.getChildElements(ElementBase.java:500)
at jatools.dom.DatasetBasedNode.getLength(DatasetBasedNode.java:393)
at jatools.dom.DatasetBasedNode.getFirstChild(DatasetBasedNode.java:236)