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

import com.ssj.bean.kmt.kmt.domain.KmtExerciseBookLib;
import com.ssj.dao.kmt.kmt.dao.KmtExerciseBookLibDao;
import com.ssj.framework.core.common.service.BaseServiceImpl;
import com.ssj.service.kmt.service.KmtExerciseBookLibService;
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 yanghuan
 * @title: KmtExerciseBookLibServiceImpl
 * @projectName ssj
 * @description: TODO
 * @date 2020/4/14 17:14
 */
@Transactional
@Service
public class KmtExerciseBookLibServiceImpl extends BaseServiceImpl<KmtExerciseBookLib, String> implements KmtExerciseBookLibService {

    @Autowired
    private KmtExerciseBookLibDao dao;

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

    @Override
    public List<KmtExerciseBookLib> findByLibId(String libId) {
        return dao.findByLibIdAndIsDelete(libId, 0);
    }

    @Override
    public List<KmtExerciseBookLib> findByExerciseBookId(String exerciseBookId) {
        return dao.findByExerciseBookIdAndIsDelete(exerciseBookId, 0);
    }
}
