package com.ruoyi.app.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.app.mapper.AppStorageMapper;
import com.ruoyi.app.domain.AppStorage;
import com.ruoyi.app.service.IAppStorageService;

/**
 * 仓库Service业务层处理
 *
 * @author ruoyi
 * @date 2025-03-04
 */
@Service
public class AppStorageServiceImpl implements IAppStorageService
{
    @Autowired
    private AppStorageMapper appStorageMapper;

    /**
     * 查询仓库
     *
     * @param id 仓库主键
     * @return 仓库
     */
    @Override
    public AppStorage selectAppStorageById(Long id)
    {
        return appStorageMapper.selectAppStorageById(id);
    }

    /**
     * 查询仓库列表
     *
     * @param appStorage 仓库
     * @return 仓库
     */
    @Override
    public List<AppStorage> selectAppStorageList(AppStorage appStorage)
    {
        return appStorageMapper.selectAppStorageList(appStorage);
    }

    /**
     * 新增仓库
     *
     * @param appStorage 仓库
     * @return 结果
     */
    @Override
    public int insertAppStorage(AppStorage appStorage)
    {
        appStorage.setCreateTime(DateUtils.getNowDate());
        return appStorageMapper.insertAppStorage(appStorage);
    }

    /**
     * 修改仓库
     *
     * @param appStorage 仓库
     * @return 结果
     */
    @Override
    public int updateAppStorage(AppStorage appStorage)
    {
        appStorage.setUpdateTime(DateUtils.getNowDate());
        return appStorageMapper.updateAppStorage(appStorage);
    }

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

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