package com.aircraft.modules.route.service.impl;

import com.aircraft.modules.route.domain.CpRoute;
import com.aircraft.modules.route.domain.dto.CpRouteDTO;
import com.aircraft.modules.route.domain.dto.CpRouteVo;
import com.aircraft.modules.route.mapper.CpRouteMapper;
import com.aircraft.modules.route.service.CpRouteService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 路线表 服务实现类
 * </p>
 *
 * @author cli
 * @since 2025-07-10
 */
@Service
public class CpRouteServiceImpl extends ServiceImpl<CpRouteMapper, CpRoute> implements CpRouteService {
    @Autowired
    private CpRouteMapper cpRouteMapper;

    @Override
    public void updateDelFlagById(Long id, Integer delFlag) {
        baseMapper.updateDelFlagById(id, delFlag);
    }

    @Override
    public IPage<CpRouteVo> findByPage(Page<CpRouteVo> page, CpRouteDTO cpRouteDTO) {
        return cpRouteMapper.selectVoPage(page, cpRouteDTO);
    }

    @Override
    public List<CpRoute> obtainAllRoutes() {
        return this.list();
    }
}
