package com.usky.fire.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.usky.common.security.utils.SecurityUtils;
import com.usky.fire.domain.PatrolInspectionRoute;
import com.usky.fire.mapper.PatrolInspectionRouteMapper;
import com.usky.fire.service.PatrolInspectionRouteService;
import com.usky.common.mybatis.core.AbstractCrudService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author fu
 * @since 2024-06-13
 */
@Service
public class PatrolInspectionRouteServiceImpl extends AbstractCrudService<PatrolInspectionRouteMapper, PatrolInspectionRoute> implements PatrolInspectionRouteService {

    @Override
    public List<PatrolInspectionRoute> routeList() {
        LambdaQueryWrapper<PatrolInspectionRoute> queryWrapper = Wrappers.lambdaQuery();
        queryWrapper.select(PatrolInspectionRoute::getId, PatrolInspectionRoute::getRouteName)
                .eq(PatrolInspectionRoute::getTenantId, SecurityUtils.getTenantId());
        List<PatrolInspectionRoute> routeList = this.list(queryWrapper);
        return routeList;
    }
}
