${if(day = "01","and substr(a.ZDATE,0,6) = to_char(sysdate-1,'yyyymm')","and substr(a.ZDATE,0,6) = to_char(sysdate-1,'yyyymm')")}
这样写会报错,有好的方法吗?
拼接的sql都能跑吗
判断条件是,day="1"
报错是你的语句问题,检查下
${if(day_s=1," and substr(a.ZDATE,1,6)=to_char(to_char(add_months(last_day(sysdate),-1),'yyyy-MM-dd'),'yyyymm')","and substr(a.ZDATE,1,6) = to_char(sysdate,'yyyymm')")}