<if test="param.type != null ">and type in <foreach item="item" index="index" collection="param.type" open="(" separator="," close=")"> #{item} </foreach></if>