The question was ORIGINS. There are over 250 traditional versions listed in Steve Roud's folk song index, and many late broadside copies in his broadside ballad index. [Many with tunes in Bronson's 'The Traditional Tunes of the Child Ballads'.]
Prof Child took the Douce collection copy to be of the late 17th century, but Sarah Bates was the widow of Charles Bates, and Charles was still active in 1702.