package com.snack.server.module.seckill.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.snack.server.module.seckill.entity.SeckillActivity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface SeckillActivityMapper extends BaseMapper<SeckillActivity> {

    /**
     * 提前结束活动（管理端手动操作）
     */
    @Update("UPDATE seckill_activity SET status = 2 WHERE id = #{id} AND status = 1")
    int forceEnd(@Param("id") Long id);
}
