mybatis如何把一个List<String>作为select查询的参数?

就比如说我要select这个list集合中包含的字段的值,我该怎么做?
select

#{item,jdbcType=VARCHAR}

from bus_bitem
where proc_inst_id = #{var.processInstanceId,jdbcType=VARCHAR}

    这样写就一直报错

select
foreach items="o" colleaction="list" index="index" open="" separator="," close="" >
#{list[${index}],jdbcType=VARCHAR}
</foreach
from table
Mybatis的foreach使用在select子句中时要这样写,你试一下,我没有测试

中间的foreach标签被弄掉了。。。

select
<foreach items="o" colleaction="list" open="" separator="," close="" >
#{o}
</foreach>
from table
把两个斜杠去掉
难道不是这样写吗?随便就可以百度到的啊,这样做的话要先判断list的值,保证不是一个空的list

直接上干货 添加一个引用 还可以重复利用

<sql id="whereConditions">
<dynamic prepend="where">
<isNotEmpty prepend="and" property="interceptTypeList">
<iterate property="interceptTypeList" open="(" conjunction=" or "   close=")">
                    intercept_type = #interceptTypeList[]#
</iterate>
</isNotEmpty>
</dynamic> 
</sql>