Can someone explain to me what Taoism, and Confucianism and Buddhism, and how they all relate to each other. Out of personal interest.

I have heard these are (or were, before the Chinese communist part with Mao ) the 3 main philosophies in China which all related to each other.
Taoism = Body.
Buddhism = Mind
Confucianism = A form of moral guidance of class hierarchy.
Is this right, and is this a valid philosophy?