MyBatis like 模糊查询,CONCAT 函数用法
以 MySQL 为例:
<select id="getByPage" resultType="com.test.domain.Users" parameterType="com.test.Param">
SELECT * FROM tb_users where isdeleted=1<if test="name!=null and name!=''">
AND nickname LIKE CONCAT('%', '${name}', '%')
</if>
ORDER BY createtime DESC
limit #{fromIndex},#{count}
</select>