数据库模糊查询语句(mybatis中运用(xml文件))

时间:2017-03-01 18:08:58   收藏:0   阅读:528

其中concat未数据库中拼接字符串方法

方法1;

select distinct function_name,function_module,function_url,date
from agent_function
where
concat(‘‘,function_name,function_module) like CONCAT(‘%‘,#{_parameter}, ‘%‘)

 

方法2;

select distinct function_name,function_module,function_url,date
from agent_function
where function_name LIKE CONCAT(CONCAT(‘%‘, #{_parameter}), ‘%‘) or
function_module LIKE CONCAT(CONCAT(‘%‘, #{_parameter}), ‘%‘)

原文:http://www.cnblogs.com/mingqi/p/6485352.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!