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

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.djhk.common.utils.DateUtils;
import com.djhk.uav.uav.mapper.UavOperatorAbilityMapper;
import com.djhk.uav.uav.model.UavOperatorAbility;
import com.djhk.uav.uav.service.IUavOperatorAbilityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 飞手-能力Service业务层处理
 *
 * @author jiachengshuai
 * @date 2022-09-26
 */
@Service
public class UavOperatorAbilityServiceImpl extends ServiceImpl<UavOperatorAbilityMapper, UavOperatorAbility> implements IUavOperatorAbilityService
{
    @Autowired
    private UavOperatorAbilityMapper uavOperatorAbilityMapper;

    /**
     * 查询飞手-能力
     *
     * @param id 飞手-能力主键
     * @return 飞手-能力
     */
    @Override
    public UavOperatorAbility selectUavOperatorAbilityById(Long id)
    {
        return uavOperatorAbilityMapper.selectUavOperatorAbilityById(id);
    }

    /**
     * 查询飞手-能力列表
     *
     * @param uavOperatorAbility 飞手-能力
     * @return 飞手-能力
     */
    @Override
    public List<UavOperatorAbility> selectUavOperatorAbilityList(UavOperatorAbility uavOperatorAbility)
    {
        return uavOperatorAbilityMapper.selectUavOperatorAbilityList(uavOperatorAbility);
    }

    /**
     * 新增飞手-能力
     *
     * @param uavOperatorAbility 飞手-能力
     * @return 结果
     */
    @Override
    public int insertUavOperatorAbility(UavOperatorAbility uavOperatorAbility)
    {
        uavOperatorAbility.setCreateTime(DateUtils.getNowDate());
        return uavOperatorAbilityMapper.insertUavOperatorAbility(uavOperatorAbility);
    }

    @Override
    public boolean insertUavOperatorAbilityList(List<UavOperatorAbility> entityList) {
        return this.saveBatch(entityList);
    }

    /**
     * 修改飞手-能力
     *
     * @param uavOperatorAbility 飞手-能力
     * @return 结果
     */
    @Override
    public int updateUavOperatorAbility(UavOperatorAbility uavOperatorAbility)
    {
        uavOperatorAbility.setUpdateTime(DateUtils.getNowDate());
        return uavOperatorAbilityMapper.updateUavOperatorAbility(uavOperatorAbility);
    }

    /**
     * 批量删除飞手-能力
     *
     * @param ids 需要删除的飞手-能力主键
     * @return 结果
     */
    @Override
    public int deleteUavOperatorAbilityByIds(Long[] ids)
    {
        return uavOperatorAbilityMapper.deleteUavOperatorAbilityByIds(ids);
    }

    /**
     * 删除飞手-能力信息
     *
     * @param id 飞手-能力主键
     * @return 结果
     */
    @Override
    public int deleteUavOperatorAbilityById(Long id)
    {
        return uavOperatorAbilityMapper.deleteUavOperatorAbilityById(id);
    }
}
