package com.ssj.service.sys.counter.service.impl;

import java.util.Date;
import java.util.List;
import java.util.Map;

import org.springframework.transaction.annotation.Transactional;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.repository.PagingAndSortingRepository;
import com.alibaba.dubbo.config.annotation.Service;

import com.ssj.bean.sys.counter.domain.Counter;
import com.ssj.dao.sys.counter.dao.CounterDao;
import com.ssj.dao.sys.counter.dao.CounterSaveDao;
import com.ssj.framework.core.common.service.BaseServiceImpl;
import com.ssj.service.sys.counter.service.CounterService;


@Transactional
@Service(version = "1.0")
public class CounterServiceImpl extends BaseServiceImpl<Counter, String> implements CounterService {

	@Autowired
	private CounterDao dao;
	
	@Autowired
	private CounterSaveDao savedao;

	@Override
	public List<Map<String, Object>> selectByCounter(String libId,String type,
			Date startTime, Date endTime) {
		return dao.selectByCounter(libId, type,startTime, endTime);
	}

	@Override
	public PagingAndSortingRepository<Counter, String> getDao() {

		return null;
	}

	@Override
	public void saveCounter(Counter counter) {
		savedao.saveAndFlush(counter);
	}

	@Override
	public Integer frontByCounter(String libId, String type) {
		return dao.frontByCounter(libId, type);
	}

	@Override
	public List<Map<String, Object>> getNotActiveCounter(String libId,Boolean iscount) {
		return dao.getNotActiveCounter(libId,iscount);
	}

	@Override
	public List<Map<String, Object>> getPayUserCounter(String libId,Boolean iscount) {
		return dao.getPayUserCounter(libId,iscount);
	}

	@Override
	public List<Map<String, Object>> exportActive(String libId) {
		return dao.exportActive(libId);
	}

	@Override
	public List<Map<String, Object>> exportImminent(String libId) {
		return dao.exportImminent(libId);
	}

	@Override
	public List<Map<String, Object>> exportSilent(String libId) {
		return dao.exportSilent(libId);
	}

}
