在${}中,你判断数据库字段,不能直接是数据库语句,需要用sql()函数查询出和NF判断
${if(NF!=sql("数据库连接名","你的查询语句",1,1),"XXX1","XXXX2")}
========
你的就是
${if(NF!=sql("数据库连接名","select to_char(sysdate,'yyyy') as y from dual",1,1),"XXX1","XXXX2")}
======
PS,你的反正取当年,为何要数据库取,直接帆软函数判断就可以
${if(NF!=year(today()),"XXX1","XXXX2")}