Похоже, вы забыли space
сразу после позиционных параметров . Попробуйте разделить позиционные параметры и точку с запятой , как в примере ниже.
@Query(value = "select * from Capping_Audit_Capture;\r\n"
+"where datepart(year, captured_time) = ?2 ;\r\n"
+"and datepart(month, captured_time) = ?3 ;\r\n"
+"and datepart(day, captured_time) <= 1 and check_point_id=?4 and line_id=?5 ", nativeQuery = true)