mybatis sql语句转化

SELECT
<include refid="Base_Column_List"/>
FROM
mmall_product
<where>
<if test="productName != null">
and name=#{productName}
</if>
<if test="productId">
and id=#{productId}
</if>
</where>
<where>标签对作用:如果where标签下的if标签成立,则将成立的第一个if标签下的and或or转为 where
.
原文地址:https://www.cnblogs.com/Dar-/p/9061943.html