package com.bonus.canteen.core.supply.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.bonus.canteen.core.supply.domain.DrpOrderGoods;
import com.bonus.canteen.core.supply.dto.DrpOrderGoodsIntoDetailPageDTO;
import com.bonus.canteen.core.supply.dto.DrpOrderGoodsPageDTO;
import com.bonus.canteen.core.supply.dto.DrpSupplyStatisticsPageDTO;
import com.bonus.canteen.core.supply.po.DrpOrderNumAndAmountModel;
import com.bonus.canteen.core.supply.vo.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

@Mapper
public interface DrpOrderGoodsMapper extends BaseMapper<DrpOrderGoods> {
   List<DrpOrderGoodsPageVO> getDrpOrderGoodsList(@Param("content") DrpOrderGoodsPageDTO content, @Param("delFlag") Integer delFlag);

   DrpOrderGoodsVO getDrpOrderGoodsInfo(@Param("orderGoodsId") String orderGoodsId);

   List<DrpOrderGoodsPageVO> getDrpOrderGoodsSupplierList(@Param("content") DrpOrderGoodsPageDTO content, @Param("delFlag") Integer delFlag, @Param("userId") Long userId, @Param("approveStatus") Integer approveStatus);

   DrpOrderNumAndAmountModel selectOrderNumAndAmount(@Param("supplierId") Long supplierId, @Param("content") DrpSupplyStatisticsPageDTO content, @Param("supplierConfirmStatus") Integer supplierConfirmStatus);

   List<DrpSuggestedSuppliersVO> suggestedSuppliers(@Param("materialIdList") List<Long> content);

   List<DrpSuggestedSuppliersVO> suggestedSuppliersByCategory(@Param("categoryIdList") List<String> content);

   void plusIntoNum(@Param("orderGoodsId") String orderGoodsId, @Param("plusNum") BigDecimal plusNum);

   List<DrpOrderGoodsIsIntoPageVO> pageOrderGoodsIsInto(@Param("content") DrpOrderGoodsIntoDetailPageDTO content, @Param("supplierConfirm") Integer supplierConfirm, @Param("delFlag") Integer delFlag);

   void minusIntoNum(@Param("orderGoodsId") String orderGoodsId, @Param("minusNum") BigDecimal minusNum);

   DrpOrderGoodsTotalVO getTotal(@Param("crby") String crby);

   List<DrpOrderGoodsExportVO> getOrderGoodsMaterialListByOrderIdList(@Param("orderGoodsIdList") List<String> orderGoodsIdList);

   List<DrpMaterialLatestPriceVO> getDrpOrderGoodsLastPriceList(@Param("materialIdList") List<Long> materialIdList, @Param("canteenId") Long canteenId);
}
