package com.ssj.service.kmt.kmt.service.impl;

import com.ssj.bean.kmt.kmt.domain.KmtExerciseBookTeacherRecord;
import com.ssj.dao.kmt.kmt.dao.KmtExerciseTeacherRecordDao;
import com.ssj.framework.core.common.service.BaseServiceImpl;
import com.ssj.service.kmt.service.KmtExerciseTeacherRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @Author: chchen
 * @Description
 * @Date Create in 10:58 2020/5/21
 * @Modified By
 */
@Transactional
@Service
public class KmtExerciseTeacherRecordServiceImpl extends BaseServiceImpl<KmtExerciseBookTeacherRecord, String> implements KmtExerciseTeacherRecordService {

    @Autowired
    private KmtExerciseTeacherRecordDao dao;

    @Override
    public PagingAndSortingRepository<KmtExerciseBookTeacherRecord, String> getDao() {
        return dao;
    }


    @Override
    public KmtExerciseBookTeacherRecord findByExerciseBookIdAndAuthorityType(String exerciseBookId, int type) {
        return dao.findByExerciseBookIdAndAuthorityType(exerciseBookId, type);
    }

    @Override
    public List<KmtExerciseBookTeacherRecord> findByExerciseBookId(String exerciseBookId) {
        return dao.findByExerciseBookIdAndLastFlag(exerciseBookId, 1);
    }
}
