参数不为空时写法:
范围写法:
请问这两种能写到一块嘛
建议换成
${if(len(date1)=0,""," and report_month>='"+date1+"'")}
${if(len(date2)=0,""," and report_month<='"+date2+"'")}
${if(and(len(date1)=0,len(date2)=0),""," and report_month between '"+date1+"' and '"+date2+"'")}