剛遇到一個問題!!!
平常寫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就行了。