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>

 

posted @ 2018-10-17 20:59  九零大叔芭蕉  阅读(143)  评论(0编辑  收藏  举报