码迷,mamicode.com
首页 > 其他好文 > 详细

mybatis:Parameter 'list' not found. Available parameters are [templateId, param1, param2, valueList]

时间:2016-09-26 11:04:08      阅读:457      评论:0      收藏:0      [点我收藏+]

标签:

我的EsdTemplateSealMapper.java里面定义的接口是这样的

public List<EsdTemplateSeal> getFilteOutSeal(@Param("filterList")List<String> list,@Param("templateId")String templateId);

 然后我的EsdTemplateSealMapper.xml里面的sql是这样的:

<select id="getFilteOutSeal" resultMap="BASE_RESULT_MAP">
        select t.TEMPLATE_ID, t.SEAL_ID, t.SEAL_TYPE, t.DATA_SRC, t.VERSION
        from ESD_TEMPLATE_SEAL t
        where t.TEMPLATE_ID=#{templateId,jdbcType=VARCHAR}
        and t.SEAL_TYPE not in
        <foreach item="item" collection="list" separator="," open="(" close=")" index="">  
          #{0}  
        </foreach>  
</select>

也写过这样的:

<select id="getFilteOutSeal" resultMap="BASE_RESULT_MAP">
        select t.TEMPLATE_ID, t.SEAL_ID, t.SEAL_TYPE, t.DATA_SRC, t.VERSION
        from ESD_TEMPLATE_SEAL t
        where t.TEMPLATE_ID=#{templateId,jdbcType=VARCHAR}
        and t.SEAL_TYPE not in
        <foreach item="item" collection="list" separator="," open="(" close=")" index="">  
          #{filterList}  
        </foreach>  
    </select>

控制台都报类似:“

org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.binding.BindingException: Parameter ‘list‘ not found. Available parameters are [templateId, param1, param2, valueList]

”的问题,

最终的解决方案是:

 

mybatis:Parameter 'list' not found. Available parameters are [templateId, param1, param2, valueList]

标签:

原文地址:http://www.cnblogs.com/baby-lijun/p/5908088.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!