mybatis多个参数 if怎么写

如题所述

mybatis在<if>中传入一个简单类型参数的两种写法。
第一使用注释:
public long getAllCustomerQuantity(@Param("mobileFlag") boolean mobileFlag);
<select id="getAllCustomerQuantity" resultType="java.lang.Long" parameterType="boolean">
SELECT COUNT(*) FROM CUSTOMER AS cutomer WHERE cutomer.USE_FLAG = 1;
<if test="mobileFlag == true">
AND cutomer.STATUS_CODE='2'
</if>
</select>
温馨提示:答案为网友推荐,仅供参考
相似回答