package com.zcloud.service.onlinexxks.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.zcloud.entity.Page;
import com.zcloud.entity.PageData;
import com.zcloud.mapper.dsno3.task.CourseStudyVideoRecordMapper;
import com.zcloud.service.onlinexxks.CourseStudyVideoRecordService;

/**
 * 说明：课程学习视频记录
 * 作者：luoxiaobao
 * 时间：2021-11-24
 * 官网：www.zcloudchina.com
 */
@Service
@Transactional //开启事物
public class CourseStudyVideoRecordServiceImpl implements CourseStudyVideoRecordService{

	@Autowired
	private CourseStudyVideoRecordMapper coursestudyvideorecordMapper;

	/**新增
	 * @param pd
	 * @throws Exception
	 */
	public void save(PageData pd)throws Exception{
		coursestudyvideorecordMapper.save(pd);
	}

	/**删除
	 * @param pd
	 * @throws Exception
	 */
	public void delete(PageData pd)throws Exception{
		coursestudyvideorecordMapper.delete(pd);
	}

	/**修改
	 * @param pd
	 * @throws Exception
	 */
	public void edit(PageData pd)throws Exception{
		coursestudyvideorecordMapper.edit(pd);
	}

	/**列表
	 * @param page
	 * @throws Exception
	 */
	public List<PageData> list(Page page)throws Exception{
		return coursestudyvideorecordMapper.datalistPage(page);
	}

	/**列表(全部)
	 * @param pd
	 * @throws Exception
	 */
	public List<PageData> listAll(PageData pd)throws Exception{
		return coursestudyvideorecordMapper.listAll(pd);
	}

	/**通过id获取数据
	 * @param pd
	 * @throws Exception
	 */
	public PageData findById(PageData pd)throws Exception{
		return coursestudyvideorecordMapper.findById(pd);
	}

	/**批量删除
	 * @param pd
	 * @throws Exception
	 */
	public void deleteAll(PageData pd)throws Exception{
		coursestudyvideorecordMapper.deleteAll(pd);
	}

	/**列表(根据所选ID获取数据)
	 * @param pd
	 * @throws Exception
	 */
	public List<PageData> findByIds(PageData pd) throws Exception {
		return coursestudyvideorecordMapper.findByIds(pd);
	}
	public List<PageData> listAllByCount(PageData pd)throws Exception{
		return coursestudyvideorecordMapper.listAllByCount(pd);
	}

	/**
	 * 更新用户播放视频时长（涉及同一任务下有相同的课件）
	 * @param pd
	 */
	@Override
	public void editResourceTime(PageData pd) throws Exception {
		coursestudyvideorecordMapper.editResourceTime(pd);
	}
}

