xin
2025-09-25 3e64a254550804933633fd88182f20d43dd2e718
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package com.oying.modules.pc.product.mapper;
 
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.oying.modules.pc.product.domain.Product;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
 
import java.util.List;
 
@Mapper
public interface ProductStockMapper extends BaseMapper<Product> {
 
    List<Product> selectLowStockProducts(@Param("threshold") Integer threshold);
 
    int updateStock(@Param("productId") Long productId, @Param("quantity") Integer quantity, @Param("version") Long version);
 
    int increaseStock(@Param("productId") Long productId, @Param("amount") Integer amount, @Param("version") Long version);
 
    int decreaseStock(@Param("productId") Long productId, @Param("amount") Integer amount, @Param("version") Long version);
 
    int batchUpdateStock(List<Product> products);
 
}