Dairy farms ordered to stop polluting rivers