MyBatis——模糊查询

时间:2023-12-22 08:56:02

在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>