From this site
http://www.etymonline.com/index.php Yankee Doodle Look up Yankee Doodle at Dictionary.com
popular tune of the Amer. Revolution, apparently written c.1755 by British Army surgeon Dr. Richard Schuckburgh while campaigning with Amherst's force in upper New York during the French and Indian War. The original verses mocked the colonial troops serving alongside the regulars, and the Doodle element just may have been, or hinted at, the 18c. slang term for "p_e_n_i_s." The song naturally was popular with British troops in the colonies, but after the colonials began to win skirmishes with them in 1775, they took the tune as a patriotic prize and re-worked the lyrics. The current version seems to have been written in 1776 by Edward Bangs, a Harvard sophomore who also was Minuteman.
Yankee Look up Yankee at Dictionary.com
1683, a name applied disparagingly by Du. settlers in New Amsterdam (New York) to English colonists in neighboring Connecticut. It may be from Du. Janke, lit. "Little John," dim. of common personal name Jan; or it may be from Jan Kes familiar form of "John Cornelius," or perhaps an alt. of Jan Kees, dial. variant of Jan Kaas, lit. "John Cheese," the generic nickname the Flemings used for Dutchmen. It originally seems to have been applied insultingly to Dutch, especially freebooters, before they turned around and slapped it on the English. A less-likely theory is that it represents some southern New England Algonquian language mangling of English. In Eng. a term of contempt (1750s) before its use as a general term for "native of New England" (1765); during the American Revolution it became a disparaging British word for all American native or inhabitants. Shortened form Yank in reference to "an American" first recorded 1778.
Looks like Mexico borrowed the word from the Dutch.