ibatis中的查询语句中循环一个List作为参数,报错,求高手帮忙!!!

<isNotNullproperty="rightMonNumList"><iterateproperty="rightMonNumList">sum(CASEWHENT... <isNotNull property="rightMonNumList" >
<iterate property="rightMonNumList">
sum( CASE
WHEN T1.ACCT_MONTH = TO_CHAR(ADD_MONTHS(TO_DATE(#monthId#, 'YYYYMM'), -(#rightMonNum#-$rightMonNumList[]$)), 'YYYYMM') THEN
T1.USER_NUM
ELSE
0
END) USER_NUM_$rightMonNumList[]$,
sum(CASE
WHEN T1.ACCT_MONTH = TO_CHAR(ADD_MONTHS(TO_DATE(#monthId#, 'YYYYMM'), -(#rightMonNum#-$rightMonNumList[]$)), 'YYYYMM') THEN
T1.USER_GPRS_NUM
ELSE
0
END) USER_GPRS_NUM_$rightMonNumList[]$
</iterate>
</isNotNull>
这是select语句中的循环处,rightMonNumList中存的是整型的11,10,9....这样的数据,目的是查处每个月这些指标的总和 并返回一个List 在页面上显示多个月份的各项数据和总和。但是运行到sql语句是却报错,去掉循环部分查询的话是没有问题的,求高手帮帮忙啊。报错代码:
--- The error occurred in config/vass/flowanalysis/sqlmap-flowanalysis.xml.
--- The error occurred while preparing the mapped statement for execution.
--- Check the flowanalysis.select3gOnline.
--- Check the parameter map.
--- Cause: java.lang.NullPointerException; nested exception is com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in config/vass/flowanalysis/sqlmap-flowanalysis.xml.
--- The error occurred while preparing the mapped statement for execution.
--- Check the flowanalysis.select3gOnline.
--- Check the parameter map.
--- Cause: java.lang.NullPointerException
org.springframework.jdbc.UncategorizedSQLException: SqlMapClient operation; uncategorized SQLException for SQL []; SQL state [null]; error code [0];
--- The error occurred in config/vass/flowanalysis/sqlmap-flowanalysis.xml.
--- The error occurred while preparing the mapped statement for execution.
--- Check the flowanalysis.select3gOnline.
--- Check the parameter map.
--- Cause: java.lang.NullPointerException; nested exception is com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in config/vass/flowanalysis/sqlmap-flowanalysis.xml.
--- The error occurred while preparing the mapped statement for execution.
--- Check the flowanalysis.select3gOnline.
--- Check the parameter map.
真正是毫无头绪。。。。求高手帮忙!
展开
 我来答
世勇观经济
2012-02-03 · TA获得超过392个赞
知道小有建树答主
回答量:727
采纳率:8%
帮助的人:133万
展开全部
例子:
<isNotEmpty prepend="AND" property="adminLevelList">
m.ADMIN_LEVEL in
<iterate property="adminLevelList" open="(" close=")"
conjunction=",">
<![CDATA[
#adminLevelList[]#
]]>
</iterate>
</isNotEmpty>
本回答被提问者采纳
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
收起 1条折叠回答
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式