码迷,mamicode.com
首页 > 其他好文 > 详细

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

时间:2018-08-08 15:41:12      阅读:899      评论:0      收藏:0      [点我收藏+]

标签:cloud   uid   ==   dss   color   foreach   string   需要   bsp   

经常在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>

 

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

标签:cloud   uid   ==   dss   color   foreach   string   需要   bsp   

原文地址:https://www.cnblogs.com/sxdcgaq8080/p/9443023.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!