package com.ssj.service.sys.integration;

import com.ssj.bean.sys.integration.Integration;
import com.ssj.dao.sys.integration.IntegrationDao;
import com.ssj.framework.core.common.service.BaseServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author Mount Liu
 * @date 2019-11-26
 */
@Service
@Transactional
public class IntegrationServiceImpl extends BaseServiceImpl<Integration, String> implements IntegrationService {

    @Autowired
    private IntegrationDao integrationDao;

    @Override
    public PagingAndSortingRepository<Integration, String> getDao() {
        return integrationDao;
    }

    @Override
    public Integration findByTeacherIdAndType(String teacherId, int type) {
        return integrationDao.findTopByTeacherIdAndType(teacherId, type);
    }
}
