mybatis如何进行like模糊查询?
1、使用bind标签:
<if test="params.ewbNo!=null">
<bind name="pattern" value="'%' + params.ewbNo +'%'" />
毙霜亲 and e.ewb_no like #{pattern}
</if>

2、在代码参数中直接加入%%:
params.put("ewbNo","%"+request.getStringValue("ewbNo")+"%");

3、在sql语句中进行使用concat连接互眠
<if test="params.ewbNo!=null"> e.ewb_no LIKE concat(concat('%',#{params.ewbNo}),'%')</if>

4、使用bind结果查看。

5、使用在代码参数中直接加入%%查看输出sql

6、使用concat查看输出的sql结果晃散。

阅读量:157
阅读量:157
阅读量:87
阅读量:107
阅读量:158