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


import com.djhk.common.utils.DateUtils;
import com.djhk.uav.uav.mapper.UavOrganizationDeviceMapper;
import com.djhk.uav.uav.model.UavOrganizationDevice;
import com.djhk.uav.uav.service.IUavOrganizationDeviceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 无人机编队详情Service业务层处理
 *
 * @author jiachengshuai
 * @date 2023-02-28
 */
@Service
public class UavOrganizationDeviceServiceImpl implements IUavOrganizationDeviceService
{
    @Autowired
    private UavOrganizationDeviceMapper uavOrganizationDeviceMapper;

    /**
     * 查询无人机编队详情
     *
     * @param id 无人机编队详情主键
     * @return 无人机编队详情
     */
    @Override
    public UavOrganizationDevice selectUavOrganizationDeviceById(Long id)
    {
        return uavOrganizationDeviceMapper.selectUavOrganizationDeviceById(id);
    }

    /**
     * 查询无人机编队详情列表
     *
     * @param uavOrganizationDevice 无人机编队详情
     * @return 无人机编队详情
     */
    @Override
    public List<UavOrganizationDevice> selectUavOrganizationDeviceList(UavOrganizationDevice uavOrganizationDevice)
    {
        return uavOrganizationDeviceMapper.selectUavOrganizationDeviceList(uavOrganizationDevice);
    }

    /**
     * 新增无人机编队详情
     *
     * @param uavOrganizationDevice 无人机编队详情
     * @return 结果
     */
    @Override
    public int insertUavOrganizationDevice(UavOrganizationDevice uavOrganizationDevice)
    {
        uavOrganizationDevice.setCreateTime(DateUtils.getNowDate());
        return uavOrganizationDeviceMapper.insertUavOrganizationDevice(uavOrganizationDevice);
    }

    /**
     * 修改无人机编队详情
     *
     * @param uavOrganizationDevice 无人机编队详情
     * @return 结果
     */
    @Override
    public int updateUavOrganizationDevice(UavOrganizationDevice uavOrganizationDevice)
    {
        uavOrganizationDevice.setUpdateTime(DateUtils.getNowDate());
        return uavOrganizationDeviceMapper.updateUavOrganizationDevice(uavOrganizationDevice);
    }

    /**
     * 批量删除无人机编队详情
     *
     * @param ids 需要删除的无人机编队详情主键
     * @return 结果
     */
    @Override
    public int deleteUavOrganizationDeviceByIds(Long[] ids)
    {
        return uavOrganizationDeviceMapper.deleteUavOrganizationDeviceByIds(ids);
    }

    /**
     * 删除无人机编队详情信息
     *
     * @param id 无人机编队详情主键
     * @return 结果
     */
    @Override
    public int deleteUavOrganizationDeviceById(Long id)
    {
        return uavOrganizationDeviceMapper.deleteUavOrganizationDeviceById(id);
    }
}
