package com.ylcm.sys.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ylcm.sys.domain.AdSpecial;
import com.ylcm.sys.form.AdSpecialAnalysisQueryForm;
import com.ylcm.sys.mapper.AdSpecialMapper;
import com.ylcm.sys.service.SpecialAnalysisService;
import com.ylcm.sys.vo.AdSpecialAnalysisVO;
import com.ylcm.sys.vo.AdSpecialTopVO;

@Service
public class SpecialAnalysisServiceImpl implements SpecialAnalysisService {

	@Resource
	private AdSpecialMapper adSpecialMapper;
	
	@Override
	public IPage<AdSpecialAnalysisVO> page(AdSpecialAnalysisQueryForm queryForm) {
		return adSpecialMapper.getPage(new Page<AdSpecial>(queryForm.getPageNo(), queryForm.getPageSize()), queryForm);
	}

	@Cacheable(value = "SpecialAnalysis",keyGenerator = "cacheKeyGenerator")
	@Override
	public List<AdSpecialTopVO> specialTop(Integer type, String startDate, String endDate) {
		return adSpecialMapper.specialTop(type, startDate, endDate);
	}

	
	
}
