Mybaties配置文件mapper中的标签使用问题

   在开发过程中,碰到了 连续判断问题,后来发现可以嵌套使用。不过这种用法不多,可以进行简化


  1. //外面是双引号,里面就是单引号  
  2.   
  3.  test="contactPhone != null and contactPhone!= '' ">  
  4.     contact_phone = #{contactPhone}  
  5.   
  6.               
  7. //外面是单引号,里面就是双引号  
  8.  test='contactPhone != null and contactPhone != "" '>  
  9.     contact_phone = #{contactPhone}  
  10.   
  11.   
  12. //判断字符串等于某个值是需要使用外面单引号,里面双引号  
  13.  test='contactPhone == "abc" '>  
  14.     contact_phone = #{contactPhone}  
  15.    



你可能感兴趣的:(MySQL)