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);
|
|
}
|