MyBatis转义

来源:互联网 发布:志愿者面试 知乎 编辑:程序博客网 时间:2024/05/23 15:18
比如在数据库中查询语句是:where   inv.amount < eit.thresholdnum 
两种方法 :
     一、直接使用转义符
     

                     &lt;                                 

                     <

                     小于号                                           

                     &gt;

                     >                                      

                     大于号

                     &amp;

                     &

                     和

                     &apos;

                     ’

                     单引号

                     &quot;

                     "

                     双引号

例子:where inv.amount &lt; eit.thresholdnum


   二、使用放在  <![CDATA[  ]]> 就可以了,例子:
where <![CDATA[inv.amount < eit.thresholdnum]]>
0 0
原创粉丝点击