package com.elephant.framework.galaxy.aroad.module.traffic.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.elephant.framework.galaxy.aroad.module.traffic.dto.CoordinateDto;
import com.elephant.framework.galaxy.aroad.module.traffic.entity.TrafficSpot;
import com.elephant.framework.galaxy.aroad.module.traffic.mapper.TrafficSpotMapper;
import com.elephant.framework.galaxy.aroad.module.traffic.service.TrafficSpotService;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 观测站点表
 *
 * @author Xingyuyang
 * @date 2019-04-29 14:38:10
 */
@Service
public class TrafficSpotServiceImpl extends ServiceImpl<TrafficSpotMapper, TrafficSpot> implements TrafficSpotService {

	public IPage<TrafficSpot> getTrafficSpotPage(Page<TrafficSpot> page,  TrafficSpot trafficSpot){
		return baseMapper.getTrafficSpotPage(page, trafficSpot);
	}

	@Cacheable(value = "trafficSpotCoordinates")
	public List<CoordinateDto> getCoordinates() {
		return baseMapper.getCoordinates();
	}
}
