MyBatis——模糊查询

在mybatis中可以使用三种模糊查询的方式:

<!-- 模糊查询 -->
    <select id="selectListByTitle" parameterType="java.lang.String" resultType="com.yijian.mybatis.pojo.User">
        <!-- 三种方法都可以 -->
        select * from user where userName like '%${value}%' 

        select * from user where userName like "%"#{userName}"%" 

        select * from user where userName like concat("%",#{userName},"%")
    </select>
原文地址:https://www.cnblogs.com/whx20100101/p/9807064.html