I'll assume that by advanced you mean advanced undergrad, the other answers seem to mix different level books.
I find that most advanced physics (not just stat mech) books range from bad to awful. Sadly, most standard books used on courses fall into this category, i see some of them in the other comments (like Greiner and Pathria).
Also, the two books i consider best are not mentioned in any of the comments.
Theory books
I'll list them from simplest to hardest.
Tong, Statistical physics lectures: Excellent for a first look on stat mech as an advanced undergrad. Free, available in the link. excellent prose. Good conceptual explanations. It covers all the basic results. For more advanced things or in depth, you'll need to consult other sources. Overall the best option.
Reif, Fundamentals of statistical and thermal physics: Not just good explanations, also makes you know which are the important things on each subject. Excellent prose, great conceptual explanations. A bit old. Excellent for most topics. The last part covers advanced kinetic theory, irreversible processes and fluctuations. I'd check this one when Tong's lectures are not enough.
Landau and Lifshitz, Statistical Physics: Volume 5: Just as Reif, it lets you know which things are important, but indirectly. Basically, if it isn't important, it's not in this book. The writing is excellent. Good explanations. Focus on central concepts. A lot of subjects are treated differently to standard books, usually simpler and relying more on physical grounds. Won't lose time over non important things. Almost every subject's simplest solution is found in this book. Too hard for humans. I'd take this one as the third option, unless you are well versed in the subject of interest.
One of your requests is:
Have examples of calculating partition functions, hopefully not just the partition function for the ideal gas.
For this, i'd recommend a special book only for examples:
Example books
Cini, Fucito and Sbragalia, Solved Problems in Quantum and Statistical Mechanics: lots of examples, it has 200 pages of solved problems in stat mech. Decent explanations, way better than other more known solved problems books, like Kubo or Dalvit.
Another request was:
Mainly I just want it to be thorough and to include all the math.
Greiner books
Greiner, Stöcker, Neise and Rischke, Thermodynamics and statistical mechanics: It is thorough in the math steps and it has a lot of examples for a theory book. Explanations are bad. Writing not good. Physical arguments and concepts nowhere to be found. Will treat the most important results (for example, the canonical/Boltzmann distribution) in the same way as the most superfluous details. Derivation of quantum statistics is specially bad. Usually I don't recommend it at all, but you may find it useful to check specific math steps or examples.