首页 > 数据库技术 > 详细

MyBatis在注解SQL中判断字符串类型不为空的正确使用方法

时间:2021-08-17 20:59:28      阅读:40      评论:0      收藏:0      [点我收藏+]

这里要判断类型为String的参数enterprise不为空,这里不能直接使用enterprise!=‘‘和enterprise!=‘‘
必须使用‘来表示‘
‘就是单引号

"<when test=‘enterprise!=null and enterprise!=&apos;&apos;‘>",
"and enterprise = #{enterprise}",
"</when>",

同理,类似的
原符号 替换符号
< <
<= <=

 &gt; 

= >=
& &
‘ ‘
" "

MyBatis在注解SQL中判断字符串类型不为空的正确使用方法

原文:https://www.cnblogs.com/yeyueweiliang/p/15152504.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!