Millions of public sector workers, including teachers, police and junior doctors are to get pay rises between 5%-7%, the government says.