您的位置:首页 > 其它

MyBatis like 模糊查询,CONCAT 函数用法

2016-11-16 17:47 483 查看
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>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: