刚刚发现《foreach》可以这么写,我真的很讨厌“不确定数量”这句话!!!
<if test="usedAreaList != null">
<foreach collection="dataList" index="index" item="item" separator="OR">
type LIKE CONCAT(CONCAT('%', #{item}), '%')
</foreach>)
</if>
之前使用mybatis的foreach标签,都是在用到in这个关键字时,便利集合时用的,separator这个属性一般都是英文逗号,这次意外的需求也让我知道,还是要继续修炼。