Korea was technically at war with China 22 times, although I've included some broad definitions, and some occurred before the dynasties were formally proclaimed:
Gojoseon: Yan (Warring States), Qin, Han
Buyeo: Former Yan
Goguryeo: Han, Gongsun clan, Cao Wei, Sima Jin, Former Yan, Later Yan, Sui, Tang
Baekje: Tang
Silla: Tang
Balhae: Tang, Liao
Goryeo: Liao, Jin, Yuan, Ming
Joseon: Qing
ROK: PRC (Also indirectly between DPRK and ROC)
In particular, there were seven campaigns each between the Sui/Tang and Goguryeo (70 years), and between the Yuan and Goryeo (40+ years, including a second phase around a century later, when the Yuan began to fall apart). Also, no conflicts technically occurred between the Ming and Goryeo, although the latter sent 50,000 troops to the border.
But this is nothing compared to the fact that Korea was continuously at war with itself from ~300 BC to AD 936 (with a break from 668-98, while a Balhae remnant (938-86) fought the Liao but did not go to war with Goryeo). Korea is still technically in a state of civil war since 1950, with both entities "claiming" authority over the entire peninsula.
The Chinese north and the Chinese south. Ever since the attempted Zhou conquest of Chu to the Taiping Rebellion. The south generally on the losing end.
China and Mongolia.
China and Vietnam.
This too, although there were long breaks within China after the Yuan conquered the Song in 1279.