In MyBatis, you mark the places where parameters should be inserted into your SQL like so:
SELECT * FROM Person WHERE id = #{id}
We can make use of Bind. The bind element lets you create a variable out of an expression and bind it to the context. For example:
SELECT A.ID_VIAJE ID, A.NOMBRE, A.DESCRIPCION, A.FINICIO, A.FFIN, A.LOGO, A.URL, A.ID_CLIENTE IDCLIENTE, B.NOMBRE CLIENTE FROM VIAJE A INNER JOIN CLIENTE B ON (A.ID_CLIENTE = B.ID_CLIENTE) WHERE A.ESTATUS = 1 AND A.NOMBRE LIKE #{pattern}
Taking into account that the parameter to look for is P_NAME.