package com.ym.mec.biz.dal.dao;

import com.ym.mec.biz.dal.entity.GoodsProcurement;
import com.ym.mec.common.dal.BaseDAO;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface GoodsProcurementDao extends BaseDAO<Long, GoodsProcurement> {

    int batchInsert(@Param("goodsProcurements") List<GoodsProcurement> goodsProcurements);

    List<GoodsProcurement> queryGoodsProcurements(Map<String, Object> params);
    int countGoodsProcurements(Map<String, Object> params);

    /**
     * @describe 获取有内部库存的清单
     * @author Joburgess
     * @date 2020.10.12
     * @param goodsId:
     * @return com.ym.mec.biz.dal.entity.GoodsProcurement
     */
    GoodsProcurement getWithStockSurplusProcurement(@Param("goodsId") Integer goodsId);

    /**
     * @describe 获取有税务库存的清单
     * @author Joburgess
     * @date 2020.10.12
     * @param goodsId:
     * @return com.ym.mec.biz.dal.entity.GoodsProcurement
     */
    GoodsProcurement getWithTaxStockSurplusProcurement(@Param("goodsId") Integer goodsId);

    /**
     * @describe 根据商品编号与批次号获取进货清单
     * @author Joburgess
     * @date 2020.10.12
     * @param goodsId:
     * @param batchNo:
     * @return com.ym.mec.biz.dal.entity.GoodsProcurement
     */
    GoodsProcurement getWithGoodsAndBatchNo(@Param("goodsId") Integer goodsId,
                                            @Param("batchNo") String batchNo);

}
