1. 程式人生 > >mybatis sql語句轉化

mybatis sql語句轉化

rom lec bat 作用 轉化 and base 語句 sele

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

mybatis sql語句轉化