首页 > 代码库 > mybatis:Parameter 'list' not found. Available parameters are [templateId, param1, param2, valueList]

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

我的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]