${if(len(参数) == 0,"","and 字段名 = '" + 参数 + "'")}
这样写还是必须要填一个参数才能展示
where后面改成下面的
where 1=1 ${if(len(a) == 0,"","and 字段名 = '" + a+ "'")}
这个不要了 改成where 1=1 就好了
这样,参数为空选择全部
where 1=1
${if(len(a)=0,"","and 赛道 = '"+a+"'")}
下拉框参数为空选择全部-https://help.fanruan.com/finereport/doc-view-2394.html
看下图,直接改成1=1,
多选:
where 1=1 ${if(len(a) == 0,"","and a in ('" + a + "')")}
单选 ${if(len(a) == 0,"","and a = '" + a + "'")}