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>