package com.zbf.system.service.impl;

import java.util.List;
import com.zbf.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; //添加
import com.zbf.system.mapper.TBaseStorageAreaMapper;
import com.zbf.system.domain.TBaseStorageArea;
import com.zbf.system.service.ITBaseStorageAreaService;

/**
 * 仓库库区Service业务层处理
 *
 * @author tony
 * @date 2024-06-16
 */
@Service
public class TBaseStorageAreaServiceImpl extends ServiceImpl<TBaseStorageAreaMapper, TBaseStorageArea> implements ITBaseStorageAreaService //修改
{
    @Autowired
    private TBaseStorageAreaMapper tBaseStorageAreaMapper;

    /**
     * 查询仓库库区
     *
     * @param id 仓库库区主键
     * @return 仓库库区
     */
    @Override
    public TBaseStorageArea selectTBaseStorageAreaById(Long id)
    {
        return tBaseStorageAreaMapper.selectTBaseStorageAreaById(id);
    }

    /**
     * 查询仓库库区列表
     *
     * @param tBaseStorageArea 仓库库区
     * @return 仓库库区
     */
    @Override
    public List<TBaseStorageArea> selectTBaseStorageAreaList(TBaseStorageArea tBaseStorageArea)
    {
        return tBaseStorageAreaMapper.selectTBaseStorageAreaList(tBaseStorageArea);
    }

    /**
     * 新增仓库库区
     *
     * @param tBaseStorageArea 仓库库区
     * @return 结果
     */
    @Override
    public int insertTBaseStorageArea(TBaseStorageArea tBaseStorageArea)
    {
        tBaseStorageArea.setCreateTime(DateUtils.getNowDate());
        return tBaseStorageAreaMapper.insertTBaseStorageArea(tBaseStorageArea);
    }

    /**
     * 修改仓库库区
     *
     * @param tBaseStorageArea 仓库库区
     * @return 结果
     */
    @Override
    public int updateTBaseStorageArea(TBaseStorageArea tBaseStorageArea)
    {
                tBaseStorageArea.setUpdateTime(DateUtils.getNowDate());
        return tBaseStorageAreaMapper.updateTBaseStorageArea(tBaseStorageArea);
    }

    /**
     * 批量删除仓库库区
     *
     * @param ids 需要删除的仓库库区主键
     * @return 结果
     */
    @Override
    public int deleteTBaseStorageAreaByIds(Long[] ids)
    {
        return tBaseStorageAreaMapper.deleteTBaseStorageAreaByIds(ids);
    }

    /**
     * 删除仓库库区信息
     *
     * @param id 仓库库区主键
     * @return 结果
     */
    @Override
    public int deleteTBaseStorageAreaById(Long id)
    {
        return tBaseStorageAreaMapper.deleteTBaseStorageAreaById(id);
    }


    /**
     * 批量禁用
     *
     * @param id 仓库库区主键
     * @return 结果
     */
    @Override
    public int disabledTBaseStorageAreaByIds(Long[] ids) {
        return tBaseStorageAreaMapper.disabledTBaseStorageAreaByIds(ids);
    }

    /**
     * 批量启用
     *
     * @param id 仓库库区主键
     * @return 结果
     */
    @Override
    public int enableTBaseStorageAreaByIds(Long[] ids) {
        return tBaseStorageAreaMapper.enableTBaseStorageAreaByIds(ids);
    }

    /**
     * 修改状态
     *
     * @param tBaseStorageArea 工序管理主键
     * @return 结果
     */
    @Override
    public int updateStatus(TBaseStorageArea tBaseStorageArea) {
        return tBaseStorageAreaMapper.updateTBaseStorageArea(tBaseStorageArea);
    }
    /**
     *查询库存库区库位信息
     * @param tBaseStorageArea
     * @return 结果
     */
    @Override
    public List<TBaseStorageArea> getBaseStorageAreaList(TBaseStorageArea tBaseStorageArea) {
        return tBaseStorageAreaMapper.selectTBaseStorageAreaList(tBaseStorageArea);
    }

}
