package com.fzm.mall.server.front.goods.mapper;

import com.fzm.mall.server.front.goods.model.Nft;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author fzm
 * @since 2021-09-14
 */
public interface NftMapper extends BaseMapper<Nft> {

    @Update("update goods_nft stock = stock - #{number} , update_time = #{time} where id = #{id} and update_time = #{updateTime} and stock >= #{number}")
    int delStock(@Param("id") Long id, @Param("number") Integer number, @Param("updateTime") Long updateTime, @Param("time") long currentTimeMillis);
}
