
mybatis
RussellChampagne
一个菜B,大四实习生,记录自己遇到过的问题
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
mybatis动态sql中,遇到的问题(1)
mybatis动态sql中,遇到的问题报错:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘and name like ‘%%’ limit 0,20’ at line 3...原创 2019-09-15 17:13:46 · 474 阅读 · 0 评论 -
mybatis中#和$的区别
mybatis中#和$的区别#{}:占位符号,可以防止sql注入(替换结果会增加单引号‘’)${}:sql拼接符号(替换结果不会增加单引号‘’,like和order by后使用,存在sql注入问题,需手动代码中过滤)简单的说就是,#{}在解析是会默认加上单引号select * from user where name = #{name};解析后select * from user wh...原创 2019-09-15 18:49:38 · 224 阅读 · 0 评论 -
mybatis中的大于,小于号的表达式
Mybatis中的大于,小于号的表达式下面这一串代码中的小于等于号中的**<**会被识别为标签,所以不能这样写 <if test="endTime != null"> and logintime <= #{endTime} </if>所以我们只能用其他方式表达小于等于号有两种写法第一种: <if test="endTime...原创 2019-10-01 16:29:07 · 1292 阅读 · 0 评论