Mybatis中like搭配concat的写法详解

网友投稿 623 2022-09-02


Mybatis中like搭配concat的写法详解

目录Mybatis like搭配concat写法在Mybatis中的写法Mybatis concat()函数模糊查询

Mybathttp://is like搭配concat写法

在Mybatis中的写法

select * from t_user where name like concat('%',#{name,jdbcType=VARCHAR},'%')

Mybatis concat()函数模糊查询

mysql 的 like,建议 like concat() 组合,可以防止sql注入

select info_id,login_name,ipaddr,login_location,browser,os,status,msg,login_time from sys_logininfor

AND ipaddr like concat('%', #{ipaddr}, '%')

AND status = #{status}

AND login_name like concat('%', #{loginName}, '%')

and date_format(login_time,'%y%m%d') anwca>= date_format(http://#{params.beginTime},'%y%m%d')

and date_format(login_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d')


版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:Django学习笔记之利用Form和Ajax实现注册功能(django与ajax交互)
下一篇:Django学习笔记之Models与ORM操作(Django ORM中的方法)
相关文章

 发表评论

暂时没有评论,来抢沙发吧~