Fork me on GitHub

mybatis的xml中使用foreach循环拼接(sql中的 in 语法)

其中stateLists是一个字符串数组,也是参数

and state in

<foreach collection="stateLists" separator="," index="index" item="item" open="(" close=")">
#{item}
</foreach>
posted @ 2020-07-06 14:30  涛声-依旧  阅读(4815)  评论(0)    收藏  举报