Example 7 Given the inequality
$$
\left|x^{2}-5 x+6\right| \leqslant x+a,
$$

where $a$ is a real parameter. If the inequality has exactly 3 integer solutions, find all values of $a$ that satisfy the condition.
(2005, Bulgarian Winter Mathematical Competition)
Explanation: Since we are considering integer roots, and all integers $x$ satisfy $-\infty<x \leqslant 2$ or $3 \leqslant x<+\infty$, we have
$$
x^{2}-5 x+6 \geqslant 0 \text {. }
$$

Thus, the original inequality becomes
$$
x^{2}-5 x+6 \leqslant x+a \text {, }
$$

which simplifies to $x^{2}-6 x+6-a \leqslant 0$.
Since the quadratic function $f(x)=x^{2}-6 x+6-a$ intersects the $x$-axis, we have
$$
\Delta=(-6)^{2}-4(6-a) \geqslant 0 \text {. }
$$

This gives $a \geqslant-3$, and
$$
3-\sqrt{a+3} \leqslant x \leqslant 3+\sqrt{a+3} \text {. }
$$

Therefore, $1 \leqslant \sqrt{a+3}<2$, which implies $-2 \leqslant a<1$.