where 1=1 ${if(year==2021,"如果是2021的条件","不是2021的条件")}
——--------------------------------------
--project_code的a项目和其他正常项目;year!=2021时,取project_code的b项目和其他正常项目
WHERE
(case
when year = 2021
then project_code = "A" AND project_code = "其他正常项目"
else project_code = "B" AND project_code = "其他正常项目"
end)
-------------------------------------------------------------
sqlserver where后面的case when好像只能这样查