直接使用 contains 进行判断
<foreach collection="list" item="item" index="index" separator="AND" open="(" close=")"> <choose> <when test='item.cname.contains("select") or item.cname.contains("checkbox") or item.cname.contains("date")'> <if test='item.cname.contains("select") or item.cname.contains("checkbox")'> find_in_set(#{item.value},base.${item.cname}) </if> </when> <otherwise> base.${item.cname} = #{item.value} </otherwise> </choose> </foreach>
-----------------------------------------------------------------------
个人笔记,仅供参考