参数查询问题,报表设置了两个参数 month , type ,我想查询时,不选 参数则查询全部,选中参数就按参数查询,这个 where 后面要怎样写的。
,
如下表述试了,不行,要怎样更改sql 语句的
${if(len(type) == 0,"","and a.type ='" + type + "'")}
select * from 表
where 1=1
${if(len(month) == 0,"","and a.month='" + month+ "'")}
where 1=1 ${if(len(type) == 0,"","and a.type ='" + type + "'")}
---------------
最好参数名不要和系统函数重名MONTH可以改成 month_