直接说做法吧 mybatis中一些特殊字符需要转义,实现方法就是将’'转义为’即可 例: " <if test='title != null and title != '''> ", " and TITLE like concat('%', #{title},'%')", " </if>", ok,成功解决!