package com.bonus.material.warehouse.service.impl;

import java.util.List;
import com.bonus.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.bonus.material.warehouse.mapper.WhHouseSetMapper;
import com.bonus.material.warehouse.domain.WhHouseSet;
import com.bonus.material.warehouse.service.IWhHouseSetService;

/**
 * 仓库货架配置Service业务层处理
 * 
 * @author xsheng
 * @date 2024-09-27
 */
@Service
public class WhHouseSetServiceImpl implements IWhHouseSetService 
{
    @Autowired
    private WhHouseSetMapper whHouseSetMapper;

    /**
     * 查询仓库货架配置
     * 
     * @param id 仓库货架配置主键
     * @return 仓库货架配置
     */
    @Override
    public WhHouseSet selectWhHouseSetById(Long id)
    {
        return whHouseSetMapper.selectWhHouseSetById(id);
    }

    /**
     * 查询仓库货架配置列表
     * 
     * @param whHouseSet 仓库货架配置
     * @return 仓库货架配置
     */
    @Override
    public List<WhHouseSet> selectWhHouseSetList(WhHouseSet whHouseSet)
    {
        return whHouseSetMapper.selectWhHouseSetList(whHouseSet);
    }


    @Override
    public List<WhHouseSet> selectListByMaType(Long typeId) {
        return whHouseSetMapper.selectListByMaType(typeId);
    }
    ;


    /**
     * 新增仓库货架配置
     * 
     * @param whHouseSet 仓库货架配置
     * @return 结果
     */
    @Override
    public int insertWhHouseSet(WhHouseSet whHouseSet)
    {
        whHouseSet.setCreateTime(DateUtils.getNowDate());
        return whHouseSetMapper.insertWhHouseSet(whHouseSet);
    }

    /**
     * 修改仓库货架配置
     * 
     * @param whHouseSet 仓库货架配置
     * @return 结果
     */
    @Override
    public int updateWhHouseSet(WhHouseSet whHouseSet)
    {
        whHouseSet.setUpdateTime(DateUtils.getNowDate());
        return whHouseSetMapper.updateWhHouseSet(whHouseSet);
    }

    /**
     * 批量删除仓库货架配置
     * 
     * @param ids 需要删除的仓库货架配置主键
     * @return 结果
     */
    @Override
    public int deleteWhHouseSetByIds(Long[] ids)
    {
        return whHouseSetMapper.deleteWhHouseSetByIds(ids);
    }

    /**
     * 删除仓库货架配置信息
     * 
     * @param id 仓库货架配置主键
     * @return 结果
     */
    @Override
    public int deleteWhHouseSetById(Long id)
    {
        return whHouseSetMapper.deleteWhHouseSetById(id);
    }
}
