【mybatis】mybatis中 <if test=>等于的条件怎么写

常在mybatis中使用<if test="aa != '值'  ">的话 怎么怎么样

那么等于怎么写呢?

注意 要想使用 ==   仅仅需要将双引号和单引号的位置换一下即可!!! 

        

复制代码
<update id="updateGoodsShelf" parameterType="java.lang.String">
        update
        integral_goods
        set
        <if test='shelfFlag == "1"'>
            shelf_flag = ${@com.pisen.cloud.luna.ms.jifen.base.domain.IntegralGoods@SHELF_ON}
        </if>
        <if test='shelfFlag == "0"'>
            shelf_flag = ${@com.pisen.cloud.luna.ms.jifen.base.domain.IntegralGoods@SHELF_OFF}
        </if>
        where
        uid
        IN
        <foreach collection="list" item="item" index="index" open="(" separator="," close=")">
            #{item}
        </foreach>
    </update>
复制代码

猜你喜欢

转载自www.cnblogs.com/telwanggs/p/11026636.html
今日推荐