mybatis模糊查询字符串拼接like

方法一:

<if test="projectName != null "> and project_name like concat('%',#{projectName},'%') </if>

 

方法二:

<if test="projectName != null ">
<bind name="bindProjectName" value="'%'+projectName+'%'"></bind>
and project_name like #{bindProjectName}
</if>

 

 

posted @ 2021-10-23 21:02  木有呂朋友  阅读(261)  评论(0编辑  收藏  举报