MyBatis 判断条件为等于的问题
在双引号里面再判断不为空,使用单引号
<if test="productId != null and productId !=''" >
and a.product_id = #{productId,jdbcType=VARCHAR}
</if>
<if test="type!=null and type!=''">
AND type = #{type}
</if>
<if test="extraSql != null and extraSql !=''">
AND ${extraSql}
</if>
网友评论