刚遇到一个问题!!!

  平常写MyBatis if语句时,一般就不等于空并且不等于“ ”即

<if test="pd.shop_id!=null and pd.shop_id!=''>
   and
   shop_id = #{pd.shop_id}
</if>

  但如果这时需要添加一个条件,同时满足三个条件的情况,且最后一个条件是某某等于0,可以这样写

<if test="pd.shop_id!=null and pd.shop_id!=''and pd.super_id=='0'.toString()">
            and
            shop_id = #{pd.shop_id}
        </if>

  加个toString就行了。

 

参考文章:https://blog.csdn.net/ziany/article/details/79728016

相关文章:

  • 2022-12-23
  • 2021-09-01
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-13
  • 2021-11-06
猜你喜欢
  • 2021-06-07
  • 2021-11-25
  • 2021-04-02
  • 2021-10-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案