mybatis修改语句的写法记录

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/weixin_39704078/article/details/83270388

<update id="update"  parameterType="com.hndct.dao.entity.WalletInfoEntity" >
        update info t
        <trim prefix="set" suffixOverrides=",">
            <if test="name != null and name != ''">  
           t.name = #{name},
          </if>
          <if test="code != null and code != ''">  
               t.code = #{code},
          </if>
          <if test="mark != null and mark != ''">  
               t.mark = #{mark},
          </if>
          t.edit_time = now(),
          </trim>
         where t.id = #{id}
    </update>

猜你喜欢

转载自blog.csdn.net/weixin_39704078/article/details/83270388