package com.yanzhu.base.service.impl;

import java.util.List;
import com.yanzhu.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.yanzhu.base.mapper.BaseAssetsTypeMapper;
import com.yanzhu.base.domain.BaseAssetsType;
import com.yanzhu.base.service.IBaseAssetsTypeService;

/**
 * 物资类型Service业务层处理
 * 
 * @author yanZhu
 * @date 2024-02-24
 */
@Service
public class BaseAssetsTypeServiceImpl implements IBaseAssetsTypeService 
{
    @Autowired
    private BaseAssetsTypeMapper baseAssetsTypeMapper;

    /**
     * 查询物资类型
     * 
     * @param id 物资类型主键
     * @return 物资类型
     */
    @Override
    public BaseAssetsType selectBaseAssetsTypeById(Long id)
    {
        return baseAssetsTypeMapper.selectBaseAssetsTypeById(id);
    }

    /**
     * 查询物资类型列表
     * 
     * @param baseAssetsType 物资类型
     * @return 物资类型
     */
    @Override
    public List<BaseAssetsType> selectBaseAssetsTypeList(BaseAssetsType baseAssetsType)
    {
        return baseAssetsTypeMapper.selectBaseAssetsTypeList(baseAssetsType);
    }

    /**
     * 新增物资类型
     * 
     * @param baseAssetsType 物资类型
     * @return 结果
     */
    @Override
    public int insertBaseAssetsType(BaseAssetsType baseAssetsType)
    {
        baseAssetsType.setCreateTime(DateUtils.getNowDate());
        return baseAssetsTypeMapper.insertBaseAssetsType(baseAssetsType);
    }

    /**
     * 修改物资类型
     * 
     * @param baseAssetsType 物资类型
     * @return 结果
     */
    @Override
    public int updateBaseAssetsType(BaseAssetsType baseAssetsType)
    {
        baseAssetsType.setUpdateTime(DateUtils.getNowDate());
        return baseAssetsTypeMapper.updateBaseAssetsType(baseAssetsType);
    }

    /**
     * 批量删除物资类型
     * 
     * @param ids 需要删除的物资类型主键
     * @return 结果
     */
    @Override
    public int deleteBaseAssetsTypeByIds(Long[] ids)
    {
        return baseAssetsTypeMapper.deleteBaseAssetsTypeByIds(ids);
    }

    /**
     * 删除物资类型信息
     * 
     * @param id 物资类型主键
     * @return 结果
     */
    @Override
    public int deleteBaseAssetsTypeById(Long id)
    {
        return baseAssetsTypeMapper.deleteBaseAssetsTypeById(id);
    }
}
