avan

  博客园 :: 首页 :: 新随笔 :: 联系 :: 订阅 :: 管理 ::

记录mybatis 的坑

<choose>
<when test="isoverfulfil = 'c'">
and pro.Loan_Money*concat("1.",pro.overpercent) >= pro.get_Loan_Money + #{sumMoney,jdbcType=NUMERIC};
</when>
<otherwise>
and pro.loan_Money >= pro.get_Loan_Money + #{sumMoney,jdbcType=NUMERIC};
</otherwise>
</choose>

 

<when test="isoverfulfil = 'c'">  永远判断为真 ,应该<when test="isoverfulfil == 'c'"> 才会进行逻辑判断。

初学的菜菜们记住了。

 

=========================================================

 

<if test="isExpired=='Y'">
and msg.expire_time &lt; now()

</if>

会报NumberFormatException,这样就可以了。

<if test="isExpired=='Y'.toString()">
and msg.expire_time &lt; now()
</if>

 

附上:XML转义字符



 

                     &lt;                                 

                     <

                     小于号                                           

                     &gt;

                     >                                      

                     大于号

                     &amp;

                     &

                     和

                     &apos;

                     ’

                     单引号

                     &quot;

                     "

                     双引号

 
posted on 2015-04-10 19:28  avan  阅读(72)  评论(0)    收藏  举报