a.check_date between ('${year1}-${month1}-26') and ('${year}-${month}-25') 能不能写成跟类似于${if(len(qlmc) == 0,"","and c.bridge_name like '%" + qlmc + "%'")}这种的。
直接拼接就好:
${if(len(year)> 0&&len(month)>0,""," and a.check_date between ('"+year1+"-"+month1+"-26') and ('"+year+"-"+month+"-25')")}
20190827-101554.mp4
看看吧
如果是日期类型不可以的;
你要是存的是文本到可以使用like
${if(len(year1)=0||len(month1)=0,"","and a.check_date>='"+date(year1,month1,26)+"'")} ${if(len(year)=0||len(month)=0,"","and a.check_date<='"+date(year,month,25)+"'")}