I wrote the following piece of code, which is working:
@Query(value = "Select s.* from cost s where s.price1 = :#{#req.price1} and s.price2 = :#{#req.price2}