You ordered and ate the food.
The waiter served you your food and brought you the check.
You've paid it (via cash or a credit card).
If cash, the waiter will say "Thank you!" when he or she picks it up.
If with a credit card, he or she will say "Thank you!" when they leave the paperwork.
Either way, as mmontero pointed out above, you would just say "You're welcome!" in response.
A cashier is someone who actually takes the money and puts it into the register.
A waiter is the person who took your order and brought you your food.
They are not usually the same person, so the order in which you list them is not important.
Both ways are acceptable.
While not a "rule," per se, if you use "a" before one, you should use it before the other, for balance, especially when writing (as you have done!). Speech is more informal and not doing so is okay.
Regardless, the response to "Thank you!" is always "You're welcome!"
I hope this helps you and clarifies all your questions!