首页 > 其他 > 详细

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

时间:2018-08-08 15:33:46      阅读:702      评论:0      收藏:0      [点我收藏+]

经常在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=>等于的条件怎么写

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!