日期:2014-05-20  浏览次数:20829 次

关于Sqlmap中传list参数的用法!!!在线等求解!!!!
------------------------------JSP中:

 <%

 List list=TSGUtils.queryRoleCode2(userid); // 此时已得到值:[KSLD,BMLD,JSSLD]

%> 


<A class=tdblack href="${ctx}/SpesDispatchAction.do? efFormEname=TSGBook012&serviceName=VLTSGReviewHis&methodName=list&i-0-enables=1&i-0-reviewerRoleList="+<%=list%> target="mainFrame">审批管理</A>

-----------------------------queryRoleCode2 方法为:
/**
* 根据usercode查出roleCole
* @param usercode
* @return
*/
public static List queryRoleCode2(String usercode){
TSGRoleDao roleDao= (TSGRoleDao)BeanContext.getBean("daoTSGRole");
Map map = new HashMap();
map.put("userNo", usercode);
List list=roleDao.queryRoleCode(map);
List list2=new ArrayList();
for (int i = 0; i < list.size(); i++) {
list2.add(((Map)list.get(i)).get("ROLE_CODE").toString());
}
return list2!=null&&list2.size()>0?list2:null;
}





------------------sqlMap中:

<select id="queryVL" parameterClass="hashmap" resultClass="hashmap">
select 
REVIEW_ID as "reviewId"
FROM T_TSG_REVIEWHIS
where ENABLES='1'
<dynamic prepend=" AND ">
<isNotEmpty prepend=" AND " property="reviewId">REVIEW_ID like '%'||#reviewId#||'%'</isNotEmpty>  
<isNotNull property="reviewerRoleList" prepend=" and " >
REVIEWER_ROLE in
<iterate property="reviewerRoleList" conjunction="," open="(" close=")">#reviewerRoleList[]# </iterate>
</isNotNull>
</dynamic>
</select>


---------------报错:
com.ibatis.sqlmap.client.SqlMapException:ParameterObject or property was not a Collection, Array or Iterator.
后面省略。


应该传什么值呢?在线求解!!!!!



------解决方案--------------------
检查你reviewerRoleList传进去了个什么