select count(*) 数量 from fdjrb where code=2 ${if(year(date)=year(getdate()) && month(date)=month(getdate())," and fdjrb.date between DATEFROMPARTS(YEAR('"+CONCATENATE(date,"-01")+"'), MONTH('"+CONCATENATE(date,"-01")+"'), 1) and getdate()"," and fdjrb.date between DATEFROMPARTS(YEAR('"+CONCATENATE(date,"-01")+"'), MONTH('"+CONCATENATE(date,"-01")+"'), 1) and EOMONTH('"+CONCATENATE(date,"-01")+"')")}