目前的写法是
${if(len(月份)==0, "", " and month in ('"+月份+"')")}
但是,现在月份控件(多选)的传值是01,02,03这种,不是 01','02','03 这种,怎么样改这个sql才能正确,不用in用or连接也行
用的复选按钮组控件~不能改分隔符
replace(月份,',',"','"),逗号替换成单引号加逗号
${if(len(月份)==0, "", " and month in ('"+replace(月份,',',"','")+"')")}
sql:
select 1 from dual where 1=1 ${if(len(月份)==0, "", " and month in ('"+replace(月份,',',"','")+"')")}
结果:
select 1 from dual where 1=1 and month in ('1','2')
分隔符 改成',' 语句不用改