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

import com.djhk.uav.uav.mapper.UavRealInfoMapper;
import com.djhk.uav.uav.model.UavRealInfo;
import com.djhk.uav.uav.service.IUavRealInfoService;
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 UavRealInfoServiceImpl implements IUavRealInfoService
{
    @Autowired
    private UavRealInfoMapper uavRealInfoMapper;

    @Override
    public UavRealInfo selectUavRealInfoByUavId(Long id) {
        return uavRealInfoMapper.selectUavRealInfoByUavId(id);
    }

    @Override
    public List<UavRealInfo> selectUavRealInfoList(UavRealInfo uavRealInfo) {
        return uavRealInfoMapper.selectUavRealInfoList(uavRealInfo);
    }

    @Override
    public int insertUavRealInfo(UavRealInfo uavRealInfo) {
        return uavRealInfoMapper.insertUavRealInfo(uavRealInfo);
    }

    @Override
    public int updateUavRealInfo(UavRealInfo uavRealInfo) {
        return uavRealInfoMapper.updateUavRealInfo(uavRealInfo);
    }

    @Override
    public int deleteUavRealInfoByUavId(Long id) {
        return uavRealInfoMapper.deleteUavRealInfoByUavId(id);
    }

    @Override
    public int deleteUavRealInfoByUavIds(Long[] ids) {
        int i = 0;
        for (Long id : ids) {
            uavRealInfoMapper.deleteUavRealInfoByUavId(id);
            i++;
        }
        return i;
    }
}
