package com.fms.system.service.impl;

import java.util.List;
import com.fms.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.fms.system.mapper.AircraftTypeMapper;
import com.fms.system.domain.AircraftType;
import com.fms.system.service.IAircraftTypeService;

/**
 * 机型Service业务层处理
 * 
 * @author Allen
 * @date 2024-06-09
 */
@Service
public class AircraftTypeServiceImpl implements IAircraftTypeService 
{
    @Autowired
    private AircraftTypeMapper aircraftTypeMapper;

    /**
     * 查询机型
     * 
     * @param aircraftTypeId 机型主键
     * @return 机型
     */
    @Override
    public AircraftType selectAircraftTypeByAircraftTypeId(Long aircraftTypeId)
    {
        return aircraftTypeMapper.selectAircraftTypeByAircraftTypeId(aircraftTypeId);
    }

    /**
     * 查询机型列表
     * 
     * @param aircraftType 机型
     * @return 机型
     */
    @Override
    public List<AircraftType> selectAircraftTypeList(AircraftType aircraftType)
    {
        return aircraftTypeMapper.selectAircraftTypeList(aircraftType);
    }

    /**
     * 新增机型
     * 
     * @param aircraftType 机型
     * @return 结果
     */
    @Override
    public int insertAircraftType(AircraftType aircraftType)
    {
        aircraftType.setCreateTime(DateUtils.getNowDate());
        return aircraftTypeMapper.insertAircraftType(aircraftType);
    }

    /**
     * 修改机型
     * 
     * @param aircraftType 机型
     * @return 结果
     */
    @Override
    public int updateAircraftType(AircraftType aircraftType)
    {
        aircraftType.setUpdateTime(DateUtils.getNowDate());
        return aircraftTypeMapper.updateAircraftType(aircraftType);
    }

    /**
     * 批量删除机型
     * 
     * @param aircraftTypeIds 需要删除的机型主键
     * @return 结果
     */
    @Override
    public int deleteAircraftTypeByAircraftTypeIds(Long[] aircraftTypeIds)
    {
        return aircraftTypeMapper.deleteAircraftTypeByAircraftTypeIds(aircraftTypeIds);
    }

    /**
     * 删除机型信息
     * 
     * @param aircraftTypeId 机型主键
     * @return 结果
     */
    @Override
    public int deleteAircraftTypeByAircraftTypeId(Long aircraftTypeId)
    {
        return aircraftTypeMapper.deleteAircraftTypeByAircraftTypeId(aircraftTypeId);
    }
}
