package com.hw.wms.service.impl;

import java.util.List;
import com.hw.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.hw.wms.mapper.WmsBaseCategoryMapper;
import com.hw.wms.domain.WmsBaseCategory;
import com.hw.wms.service.IWmsBaseCategoryService;

/**
 * 仓库类别Service业务层处理
 * 
 * @author xs
 * @date 2023-12-20
 */
@Service
public class WmsBaseCategoryServiceImpl implements IWmsBaseCategoryService 
{
    @Autowired
    private WmsBaseCategoryMapper wmsBaseCategoryMapper;

    /**
     * 查询仓库类别
     * 
     * @param categoryId 仓库类别主键
     * @return 仓库类别
     */
    @Override
    public WmsBaseCategory selectWmsBaseCategoryByCategoryId(Long categoryId)
    {
        return wmsBaseCategoryMapper.selectWmsBaseCategoryByCategoryId(categoryId);
    }

    /**
     * 查询仓库类别列表
     * 
     * @param wmsBaseCategory 仓库类别
     * @return 仓库类别
     */
    @Override
    public List<WmsBaseCategory> selectWmsBaseCategoryList(WmsBaseCategory wmsBaseCategory)
    {
        return wmsBaseCategoryMapper.selectWmsBaseCategoryList(wmsBaseCategory);
    }

    /**
     * 新增仓库类别
     * 
     * @param wmsBaseCategory 仓库类别
     * @return 结果
     */
    @Override
    public int insertWmsBaseCategory(WmsBaseCategory wmsBaseCategory)
    {
        wmsBaseCategory.setCreateTime(DateUtils.getNowDate());
        return wmsBaseCategoryMapper.insertWmsBaseCategory(wmsBaseCategory);
    }

    /**
     * 修改仓库类别
     * 
     * @param wmsBaseCategory 仓库类别
     * @return 结果
     */
    @Override
    public int updateWmsBaseCategory(WmsBaseCategory wmsBaseCategory)
    {
        wmsBaseCategory.setUpdateTime(DateUtils.getNowDate());
        return wmsBaseCategoryMapper.updateWmsBaseCategory(wmsBaseCategory);
    }

    /**
     * 批量删除仓库类别
     * 
     * @param categoryIds 需要删除的仓库类别主键
     * @return 结果
     */
    @Override
    public int deleteWmsBaseCategoryByCategoryIds(Long[] categoryIds)
    {
        return wmsBaseCategoryMapper.deleteWmsBaseCategoryByCategoryIds(categoryIds);
    }

    /**
     * 删除仓库类别信息
     * 
     * @param categoryId 仓库类别主键
     * @return 结果
     */
    @Override
    public int deleteWmsBaseCategoryByCategoryId(Long categoryId)
    {
        return wmsBaseCategoryMapper.deleteWmsBaseCategoryByCategoryId(categoryId);
    }
}
