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


import com.djhk.common.api.RemoteDeptService;
import com.djhk.common.api.RemoteUserService;
import com.djhk.common.utils.DateUtils;
import com.djhk.common.utils.SecurityUtils;
import com.djhk.uav.uav.mapper.UavOperatorProfessionMapper;
import com.djhk.uav.uav.model.UavOperatorProfession;
import com.djhk.uav.uav.service.IUavOperatorProfessionService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 飞手管理Service业务层处理
 *
 * @author jiachengshuai
 * @date 2022-08-30
 */
@Service
@Slf4j
public class UavOperatorProfessionServiceImpl implements IUavOperatorProfessionService
{

    @Autowired
    private UavOperatorProfessionMapper uavOperatorProfessionMapper;

    @Autowired
    private RemoteUserService userService;

    @Autowired
    private RemoteDeptService deptService;


    @Override
    public UavOperatorProfession selectUavOperatorById(Long id) {
        return uavOperatorProfessionMapper.selectUavOperatorById(id);
    }

    @Override
    public List<UavOperatorProfession> selectUavOperatorList(UavOperatorProfession uavOperator) {
        return uavOperatorProfessionMapper.selectUavOperatorList(uavOperator);
    }

    @Override
    public int insertUavOperator(UavOperatorProfession uavOperator) {
        uavOperator.setCreateBy(SecurityUtils.getUsername());
        uavOperator.setCreateTime(DateUtils.getNowDate());
        return uavOperatorProfessionMapper.insertUavOperator(uavOperator);
    }

    @Override
    public int updateUavOperator(UavOperatorProfession uavOperator) {
        uavOperator.setUpdateTime(DateUtils.getNowDate());
        uavOperator.setUpdateBy(SecurityUtils.getUsername());
        return uavOperatorProfessionMapper.updateUavOperator(uavOperator);
    }

    @Override
    public int deleteUavOperatorById(Long id) {
        return uavOperatorProfessionMapper.deleteUavOperatorById(id);
    }

    @Override
    public int deleteUavOperatorByIds(Long[] ids) {
        return uavOperatorProfessionMapper.deleteUavOperatorByIds(ids);
    }
}
