Yang-Baxter equation and reflection equations in integrable models