文本框名字是mc,数据集是select * from a where spmc='${mc}',要实现如果不输入就不筛选spmc这个字段,怎么写?
如同时有两个文本框都是这种情况,怎么写
select * from a where 1=1
${if(len(mc)=0,""," and spmc='"+mc+"'")}
${if(len(mc1)=0,""," and spmc1='"+mc1+"'")}
where 判断
where 1=1
${if(mc="", "", "and spmc like ('%"+replace(mc,"'","") +"%')")}