<select id="likeSelect" resultType="BaseResultMap" parameterType="java.util.HashMap"> SELECT * FROM test WHERE test_type LIKE CONCAT(CONCAT('%',#{keyword}),'%') OR test_title LIKE CONCAT(CONCAT('%',#{keyword}),'%') </select>
这种主要是使用的sql中的concat方法:将两个值连接起来