package com.jeeplus.modules.supply.materialLibrary.mapper;

import com.jeeplus.core.persistence.BaseMapper;
import com.jeeplus.core.persistence.annotation.MyBatisMapper;
import com.jeeplus.modules.supply.materialLibrary.entity.MaterialLibrary;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 物料库mapper
 * @author: 黄俊杰
 * @create: 2022-02-28 16:00
 */
@MyBatisMapper
public interface MaterialLibraryMapper extends BaseMapper<MaterialLibrary> {
    /**
     * 按物流编码list来查询
     * @param materialCodeList
     * @return
     */
    List<String> getMaterialCodeByMaterialCodeList(@Param("materialCodeList") List<String> materialCodeList);

    /**
     * 覆盖操作 根据物流编码物理删除旧数据
     * @param materialCodeList
     */
    void deleteMaterialLibraryByMaterialCodeList(@Param("materialCodeList") List<String> materialCodeList);

    /**
     * 批量新增
     * @param list
     * @return
     */
    Integer insertList(@Param("list") List<MaterialLibrary> list);

    /**
     * 批量删除
     * @param materialCodeList
     * @return
     */
    Integer deleteList(@Param("materialCodeList") List<String> materialCodeList);

    /**
     * 按物流编码list来查询
     * @param materialCodeList
     * @return
     */
    Integer getCountByMaterialCodeList(@Param("materialCodeList") List<String> materialCodeList);

    /**
     * 查询物料库表中数据量
     * @return
     */
    Integer getMaterialCodeByMaterialCount();

    /**
     * 删除物料库中所有数据
     * @return
     */
    Integer deleteAll();
}
