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

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

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.ssj.bean.sys.train.bean.VideoInfo;
import com.ssj.dao.sys.train.dao.TrainQueryDao;
import com.ssj.dao.sys.train.dao.VideoInfoDao;
import com.ssj.framework.core.common.service.BaseServiceImpl;
import com.ssj.service.sys.train.service.VideoInfoService;

@Service
@Transactional
public class VideoInfoServiceImpl extends BaseServiceImpl<VideoInfo, String> implements VideoInfoService {

    @Autowired
    private VideoInfoDao videoInfoDao;
    
    @Autowired
    private TrainQueryDao trainQueryDao;

    @Override
	public PagingAndSortingRepository<VideoInfo, String> getDao() {
		return videoInfoDao;
	}

	@Override
	public Page<Map<String, Object>> findTrainVideoInfoByPage(Map<String, Object> params, Pageable pageable) {
		return trainQueryDao.findTrainVideoInfoByPage(params, pageable);
	}

	@Override
	public Page<Map<String, Object>> findMerchantTeaNumByPage(Map<String, Object> params, Pageable pageable) {
		return trainQueryDao.findMerchantTeaNumByPage(params, pageable);
	}

	@Override
	public List<Map<String, Object>> findTrainVideoUserByRoleType(String userId, Integer roleType, String module) {
		return trainQueryDao.findTrainVideoUserByRoleType(userId, roleType, module);
	}

	@Override
	public VideoInfo getVideoInfoByMax(Integer roleType, String id) {
		return videoInfoDao.getVideoInfoByMax(roleType, id);
	}

	@Override
	public VideoInfo getVideoInfoByIndes(Integer roleType, Integer indes) {
		return videoInfoDao.getVideoInfoByIndes(roleType, indes);
	}

	@Override
	public VideoInfo getVideoInfoByMaxIndes(Integer roleType) {
		return videoInfoDao.getVideoInfoByMaxIndes(roleType);
	}
	
	

}
