public User queryUserByLike(@Param("arg") String arg);
方式一:
<select id="queryUserByLike" resultType="org.example.entity.User"> select * from t_user where name like '%${arg}%' </select>
方式二:
<select id="queryUserByLike" resultType="org.example.entity.User"> select * from t_user where name like concat('%',#{arg},'%') </select>
方式三:
<select id="queryUserByLike" resultType="org.example.entity.User"> select * from t_user where name like "%"#{arg}"%" </select>
标签:like,模糊,查询,user,arg,mybatis,where,select,name From: https://www.cnblogs.com/ixtao/p/17162011.html