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


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

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

同理,类似的

原符号  替换符号 
 <       &lt; 
 <=    &lt;=
 >      &gt; 
 >=    &gt;=
 &      &amp;
 '        &apos;
 "       &quot;


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM