sql中当查询条件为空时不作为查询条件,这个怎么写
select * from 表 where 1=1
${if(len(参数)==0,"","and 字段='"+参数+"'")}
${if(len(参数)=0,"","and 列名='"+参数+"'")}
帮助文档看 参数为空 选择全部
${IF(LEN(参数名)=0,""," AND 表字段 IN ('"+参数名+"') ")}