mybatis中 等于的条件怎么写

wylc123 1年前 ⋅ 756 阅读

经常在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>
Markup
更多内容请访问:IT源点

相关文章推荐

全部评论: 0

    我有话说: