年月字段为字符型,但截取后不能传参输入年份查询为空${IF(len(rptYearMonth)=0,""," and d.RPTYEARMONTH='"+left(rptYearMonth,4)+"'")}
RPTYEARMONTH你这个字段什么格式啊,要转成年才行哦
${IF(len(rptYearMonth)=0,""," and SUBSTR(d.RPTYEARMONTH,1,4)='"+left(rptYearMonth,4)+"'")}