Step 1: Consider the first integral.
\[
I_1=\int_0^{2\pi}\cos mx\cos nx\,dx
\]
Using the orthogonality property,
\[
\int_0^{2\pi}\cos mx\cos nx\,dx=0,\quad m\neq n
\]
and
\[
\int_0^{2\pi}\cos^2 mx\,dx=\pi,\quad m=n
\]
Therefore,
\[
I_1=\pi,\quad m=n
\]
Step 2: Consider the second integral.
\[
I_2=\int_{-\pi}^{\pi}\sin mx\cos nx\,dx
\]
Here,
\[
\sin mx
\]
is an odd function and
\[
\cos nx
\]
is an even function.
So,
\[
\sin mx\cos nx
\]
is an odd function.
The integral of an odd function over \([-\pi,\pi]\) is zero.
Hence,
\[
I_2=0
\]
Step 3: Add both integrals.
\[
I_1+I_2=\pi+0
\]
\[
I_1+I_2=\pi
\]
Step 4: Final conclusion.
Therefore,
\[
\boxed{\pi,\ \text{if }m=n,\ m,n\in\mathbb{Z}}
\]