package com.djhk.uav.uav.service.impl;

import com.djhk.uav.uav.mapper.UavInformationMapper;
import com.djhk.uav.uav.model.UavInformation;
import com.djhk.uav.uav.service.IUavInformationService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @description
 * @author zhulongchuan
 * @date 2024/11/11
 * @version 1.0
 */
@Service
@Slf4j
public class UavInformationServiceImpl implements IUavInformationService
{
    @Autowired
    private UavInformationMapper uavInformationMapper;

    @Override
    public UavInformation selectUavInformationByUavId(Long uavId) {
        return uavInformationMapper.selectUavInformationByUavId(uavId);
    }

    @Override
    public List<UavInformation> selectUavInformationList(UavInformation uavInformationVo) {
        return uavInformationMapper.selectUavInformationList(uavInformationVo);
    }

    @Override
    public int insertUavInformation(UavInformation uavInformation) {
        return uavInformationMapper.insertUavInformation(uavInformation);
    }

    @Override
    public int updateUavInformation(UavInformation uavInformation) {
        return uavInformationMapper.updateUavInformation(uavInformation);
    }

    @Override
    public int deleteUavInformationByUavId(Long uavId) {
        return uavInformationMapper.deleteUavInformationByUavId(uavId);
    }

    @Override
    public int deleteUavInformationByUavIds(Long[] uavIds) {
        int i = 0;
        for (Long uavId : uavIds) {
            uavInformationMapper.deleteUavInformationByUavId(uavId);
            i++;
        }
        return i;
    }
}
