It can be either, depending on the context. You could say it to someone leaving your house, or when you leave your friends at a club, late at night, in which case it is 'goodbye'. You could also say it to your family before you go to bed, in which case it is more similar to the chinese 'have a sweet dream'.
'Have a sweet dream' does not really translate to English culture. The nearest is 'Sweet dreams', but that is something you would only say to your children, or very close family. To me, we would never say something like that to a friend.