liujie
2026-01-04 00c70fe8a833450fa8bc2bea7357e4e23d84f2f3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package com.ruoyi.system.mapper;
 
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.system.model.TBigGiftPackage;
import org.apache.ibatis.annotations.Param;
 
/**
 * <p>
 * 大礼包 Mapper 接口
 * </p>
 *
 * @author xiaochen
 * @since 2025-12-08
 */
public interface TBigGiftPackageMapper extends BaseMapper<TBigGiftPackage> {
 
    /**
     * 使用乐观锁扣减库存
     *
     * @param id       商品ID
     * @param quantity 扣减数量
     * @return 更新行数(0表示库存不足或并发冲突)
     */
    int deductInventory(@Param("id") Integer id, @Param("quantity") Integer quantity);
 
}