package com.uavps.system.service.impl;

import com.uavps.common.utils.DateUtils;
import com.uavps.system.domain.UavpsAircraft;
import com.uavps.system.mapper.UavpsAircraftMapper;
import com.uavps.system.service.IUavpsAircraftService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 飞机数据Service业务层处理
 *
 * @author ruoyi
 * @date 2025-01-16
 */
@Service
public class UavpsAircraftServiceImpl implements IUavpsAircraftService {
    @Autowired
    private UavpsAircraftMapper uavpsAircraftMapper;

    /**
     * 查询飞机数据
     *
     * @param bizId 飞机数据主键
     * @return 飞机数据
     */
    @Override
    public List<UavpsAircraft> selectUavpsAircraftByBizId(String bizId) {
        return uavpsAircraftMapper.selectUavpsAircraftByBizId(bizId);
    }

    /**
     * 查询飞机数据列表
     *
     * @param uavpsAircraft 飞机数据
     * @return 飞机数据
     */
    @Override
    public List<UavpsAircraft> selectUavpsAircraftList(UavpsAircraft uavpsAircraft) {
        return uavpsAircraftMapper.selectUavpsAircraftList(uavpsAircraft);
    }

    /**
     * 新增飞机数据
     *
     * @param uavpsAircraft 飞机数据
     * @return 结果
     */
    @Override
    public int insertUavpsAircraft(UavpsAircraft uavpsAircraft) {
        uavpsAircraft.setCreateTime(DateUtils.getNowDate());
        return uavpsAircraftMapper.insertUavpsAircraft(uavpsAircraft);
    }

    /**
     * 修改飞机数据
     *
     * @param uavpsAircraft 飞机数据
     * @return 结果
     */
    @Override
    public int updateUavpsAircraft(UavpsAircraft uavpsAircraft) {
        uavpsAircraft.setUpdateTime(DateUtils.getNowDate());
        return uavpsAircraftMapper.updateUavpsAircraft(uavpsAircraft);
    }

    /**
     * 批量删除飞机数据
     *
     * @param bizIds 需要删除的飞机数据主键
     * @return 结果
     */
    @Override
    public int deleteUavpsAircraftByBizIds(String[] bizIds) {
        return uavpsAircraftMapper.deleteUavpsAircraftByBizIds(bizIds);
    }

    /**
     * 删除飞机数据信息
     *
     * @param bizId 飞机数据主键
     * @return 结果
     */
    @Override
    public int deleteUavpsAircraftByBizId(String bizId) {
        return uavpsAircraftMapper.deleteUavpsAircraftByBizId(bizId);
    }
}
