package com.ym.mec.biz.service.impl;

import com.ym.mec.biz.dal.dto.ClassGroupTeachers;
import com.ym.mec.biz.dal.entity.ClassGroup;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ym.mec.biz.dal.dao.ClassGroupTeacherMapperDao;
import com.ym.mec.biz.dal.entity.ClassGroupTeacherMapper;
import com.ym.mec.biz.service.ClassGroupTeacherMapperService;
import com.ym.mec.common.dal.BaseDAO;
import com.ym.mec.common.service.impl.BaseServiceImpl;

import java.util.List;

@Service
public class ClassGroupTeacherMapperServiceImpl extends BaseServiceImpl<Long, ClassGroupTeacherMapper> implements ClassGroupTeacherMapperService {

    @Autowired
    private ClassGroupTeacherMapperDao classGroupTeacherMapperDao;

    @Override
    public BaseDAO<Long, ClassGroupTeacherMapper> getDAO() {
        return classGroupTeacherMapperDao;
    }

    @Override
    public int classGroupTeachersInsert(List<ClassGroupTeacherMapper> classGroupTeacherMapperList) {
        return classGroupTeacherMapperDao.classGroupTeachersInsert(classGroupTeacherMapperList);
    }


    @Override
    public List<ClassGroupTeacherMapper> findClassGroupTeachers(List ClassGroupList) {
        return classGroupTeacherMapperDao.findClassGroupTeachers(ClassGroupList);
    }

    public boolean classGroupTeacherMapperUpdate(List<ClassGroupTeacherMapper> classGroupTeacherMapperList) throws Exception {
        for (ClassGroupTeacherMapper classGroupTeacherMapper : classGroupTeacherMapperList) {
            classGroupTeacherMapperDao.update(classGroupTeacherMapper);
        }
        return true;
    }

}