where
task_id = #{taskId,jdbcType=VARCHAR}
<if test="particularYear != null and particularYear != ''">
and year(particular_year) = year(#{particularYear})
</if>
错误原因:
particularYear != ‘’
date格式不能判‘’
把这个条件删掉即可。