Open clusters in the Gaia-ESO Survey tracing the chemical history of the Milky Way