package com.hw.wms.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.hw.wms.mapper.WmsStockTotalMapper;
import com.hw.wms.domain.WmsStockTotal;
import com.hw.wms.service.IWmsStockTotalService;

/**
 * 原材料库存Service业务层处理
 *
 * @author xins
 * @date 2024-03-14
 */
@Service
public class WmsStockTotalServiceImpl implements IWmsStockTotalService
{
    @Autowired
    private WmsStockTotalMapper wmsStockTotalMapper;

    /**
     * 查询原材料库存
     *
     * @param stockTotalId 原材料库存主键
     * @return 原材料库存
     */
    @Override
    public WmsStockTotal selectWmsStockTotalByStockTotalId(Long stockTotalId)
    {
        return wmsStockTotalMapper.selectWmsStockTotalByStockTotalId(stockTotalId);
    }

    /**
     * 查询原材料库存列表
     *
     * @param wmsStockTotal 原材料库存
     * @return 原材料库存
     */
    @Override
    public List<WmsStockTotal> selectWmsStockTotalList(WmsStockTotal wmsStockTotal)
    {
        return wmsStockTotalMapper.selectWmsStockTotalList(wmsStockTotal);
    }

    /**
     * 新增原材料库存
     *
     * @param wmsStockTotal 原材料库存
     * @return 结果
     */
    @Override
    public int insertWmsStockTotal(WmsStockTotal wmsStockTotal)
    {
        return wmsStockTotalMapper.insertWmsStockTotal(wmsStockTotal);
    }

    /**
     * 修改原材料库存
     *
     * @param wmsStockTotal 原材料库存
     * @return 结果
     */
    @Override
    public int updateWmsStockTotal(WmsStockTotal wmsStockTotal)
    {
        return wmsStockTotalMapper.updateWmsStockTotal(wmsStockTotal);
    }

    /**
     * 批量删除原材料库存
     *
     * @param stockTotalIds 需要删除的原材料库存主键
     * @return 结果
     */
    @Override
    public int deleteWmsStockTotalByStockTotalIds(Long[] stockTotalIds)
    {
        return wmsStockTotalMapper.deleteWmsStockTotalByStockTotalIds(stockTotalIds);
    }

    /**
     * 删除原材料库存信息
     *
     * @param stockTotalId 原材料库存主键
     * @return 结果
     */
    @Override
    public int deleteWmsStockTotalByStockTotalId(Long stockTotalId)
    {
        return wmsStockTotalMapper.deleteWmsStockTotalByStockTotalId(stockTotalId);
    }







    /**
     * 查询总库存列表,Join material
     *
     * @param wmsStockTotal 总库存
     * @return 总库存
     */
    @Override
    public List<WmsStockTotal> selectWmsStockTotalJoinList(WmsStockTotal wmsStockTotal)
    {
        //todo:还需要计算锁库的数量
        return wmsStockTotalMapper.selectWmsStockTotalJoinList(wmsStockTotal);
    }

}
