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

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.bonus.canteen.core.supermarket.dto.SupermarketNotRemovedProductListDTO;
import com.bonus.canteen.core.supermarket.dto.SupermarketQueryProductInfoDTO;
import com.bonus.canteen.core.supermarket.model.SupermarketProduct;
import com.bonus.canteen.core.supermarket.po.GoodsBuyLimitModel;
import com.bonus.canteen.core.supermarket.po.InventoryNumModel;
import com.bonus.canteen.core.supermarket.vo.SupermarketNotRemovedProductListVO;
import com.bonus.canteen.core.supermarket.vo.SupermarketProductInfoImageVO;
import com.bonus.canteen.core.supermarket.vo.SupermarketQueryProductInfoVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

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

@Mapper
public interface SupermarketProductMapper extends BaseMapper<SupermarketProduct> {
//   Page<SupermarketProductPageVO> pageProductRelate(Page<SupermarketProductPageVO> resultPage, @Param("content") SupermarketProductPageDTO content, @Param("ifRelateDrp") Integer ifRelateDrp);
//
//   List<SupermarketProductPageVO> pageProductRelate(@Param("content") SupermarketProductPageDTO content, @Param("ifRelateDrp") Integer ifRelateDrp);
//
//   Page<SupermarketProductPageVO> pageProductNoRelate(Page<SupermarketProductPageVO> resultPage, @Param("content") SupermarketProductPageDTO content);
//
//   void saveBatchProduct(@Param("supermarketProductList") List<SupermarketProduct> supermarketProductList, @Param("username") String username);
//
//   List<SupermarketUnAddProductListVO> listUnAddProduct(@Param("content") SupermarketUnAddProductListDTO content, @Param("materialType") Integer materialType, @Param("delFlag") Integer delFlag);
//
//   Page<AndroidSupermarketProductPageVO> pageSupermarketProductRelateDrp(Page<AndroidSupermarketProductPageVO> resultPage, @Param("content") AndroidProductPageDTO content, @Param("putawayState") Integer putawayState, @Param("pinyinInitials") String pinyinInitials, @Param("pinyinFull") String pinyinFull);
//
//   List<net.xnzn.core.device.android.supermarket.vo.AndroidSupermarketProductPageVO> pageSupermarketProductRelateDrpV4(@Param("content") net.xnzn.core.device.android.supermarket.dto.AndroidProductPageDTO content, @Param("putawayState") Integer putawayState, @Param("pinyinInitials") String pinyinInitials, @Param("pinyinFull") String pinyinFull);
//
//   AndroidSupermarketProductPageVO getProductByBarCode(@Param("content") AndroidProductByBarCodeDTO content, @Param("putawayState") Integer putawayState);

   void minusInventoryByDetailId(@Param("supermarketId") Long supermarketId, @Param("detailId") Long detailId, @Param("saleNum") BigDecimal saleNum);

   void plusInventoryByDetailId(@Param("detailId") Long detailId, @Param("operateNum") BigDecimal operateNum);
//
//   Page<SupermarketInventoryMaterialPageVO> pageInventoryMaterial(Page<SupermarketInventoryMaterialPageVO> resultPage, @Param("content") SupermarketInventoryMaterialPageDTO content);
//
//   List<net.xnzn.core.device.android.supermarket.vo.SupermarketInventoryMaterialPageVO> pageInventoryMaterialV4(@Param("content") net.xnzn.core.device.android.supermarket.dto.SupermarketInventoryMaterialPageDTO content);
//
//   List<AppletSupermarketProductListVO> listProductCategory(@Param("supermarketId") Long supermarketId, @Param("putawayState") Integer putawayState, @Param("ifOnline") Integer ifOnline);
//
//   List<AppletSupermarketProductDetailListVO> listProductByCategoryId(@Param("supermarketId") Long supermarketId, @Param("putawayState") Integer putawayState, @Param("ifOnline") Integer ifOnline, @Param("categoryId") Long categoryId);

   List<GoodsBuyLimitModel> listGoodsBuyLimit(@Param("supermarketId") Long supermarketId, @Param("goodsList") List<Long> goodsList, @Param("putawayState") Integer putawayState);
//
//   Page<AndroidWeighProductPageVO> pageWeighProduct(Page<AndroidWeighProductPageVO> resultPage, @Param("content") SupermarketWeighProductPageDTO content, @Param("weightType") Integer weightType);
//
//   List<OpenSupermarketProductPushInfoVO> listProductPushInfo();
//
//   Integer checkIfUseInSupermarket(@Param("materialIdList") List<Long> materialIdList, @Param("delFlag") Integer delFlag);

   SupermarketQueryProductInfoVO getProductById(@Param("content") SupermarketQueryProductInfoDTO content);

   @Select({"select b.material_name,a.inventory_num from supermarket_product a LEFT JOIN menu_material b on b.material_id = a.material_id where supermarket_id = #{supermarketId} and supermarket_detail_id = #{supermarketDetailId}"})
   InventoryNumModel getProductInventory(@Param("supermarketId") Long supermarketId, @Param("supermarketDetailId") Long supermarketDetailId);
//
//   List<PriceByMaterialIdVO> getPriceByMaterialIds(@Param("materialIds") List<Long> materialIds, @Param("warehouseId") Long warehouseId);

   List<SupermarketNotRemovedProductListVO> listNotRemovedProduct(@Param("content") SupermarketNotRemovedProductListDTO content, @Param("ifRelateDrp") Integer ifRelateDrp);

   List<SupermarketProductInfoImageVO> getProductImg(@Param("goodsIdList") List<Long> goodsIdList);

//   List<SupermarketUnAddProductListVO> pageUnAddProduct(@Param("content") SupermarketUnAddProductPageDTO content, @Param("materialType") Integer materialType, @Param("delFlag") Integer delFlag);
}
