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.VideoUser;
import com.ssj.dao.sys.train.dao.TrainQueryDao;
import com.ssj.dao.sys.train.dao.VideoUserDao;
import com.ssj.framework.core.common.service.BaseServiceImpl;
import com.ssj.service.sys.train.service.VideoUserService;

@Service
@Transactional
public class VideoUserServiceImpl extends BaseServiceImpl<VideoUser, String> implements VideoUserService {

    @Autowired
    private VideoUserDao videoUserDao;
    
    @Autowired
    private TrainQueryDao trainQueryDao;

    @Override
	public PagingAndSortingRepository<VideoUser, String> getDao() {
		return videoUserDao;
	}

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

	@Override
	public List<Map<String, Object>> findTrainVideoUserByUserId(String userId) {
		return trainQueryDao.findTrainVideoUserByUserId(userId);
	}

	@Override
	public List<VideoUser> findVideoUserByUserIdAndRoleType(Integer roleType, String userId) {
		return videoUserDao.findVideoUserByUserIdAndRoleType(roleType, userId);
	}
	
	@Override
	public List<VideoUser> findVideoUserByUserIdAndVideoId(String videoId, String userId) {
		return videoUserDao.findVideoUserByUserIdAndVideoId(videoId, userId);
	}

	

}
