package com.xinyilu.system.service.teacherInfo.impl;

import com.xinyilu.common.utils.DateUtils;
import com.xinyilu.system.domain.teacherInfo.ClassTeacherInfo;
import com.xinyilu.system.mapper.teacherInfo.ClassTeacherInfoMapper;
import com.xinyilu.system.service.teacherInfo.IClassTeacherInfoService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 班级教师关系管理Service业务层处理
 *
 * @author jihan
 * @date 2022-08-05
 */
@Service
public class ClassTeacherInfoServiceImpl implements IClassTeacherInfoService {
    @Resource
    private ClassTeacherInfoMapper classTeacherInfoMapper;

    /**
     * 查询班级教师关系管理
     *
     * @param id 班级教师关系管理主键
     * @return 班级教师关系管理
     */
    @Override
    public ClassTeacherInfo selectClassTeacherInfoById(Long id) {
        return classTeacherInfoMapper.selectClassTeacherInfoById(id);
    }

    /**
     * 查询班级教师关系管理列表
     *
     * @param classTeacherInfo 班级教师关系管理
     * @return 班级教师关系管理
     */
    @Override
    public List<ClassTeacherInfo> selectClassTeacherInfoList(ClassTeacherInfo classTeacherInfo) {
        return classTeacherInfoMapper.selectClassTeacherInfoList(classTeacherInfo);
    }

    /**
     * 新增班级教师关系管理
     *
     * @param classTeacherInfo 班级教师关系管理
     * @return 结果
     */
    @Override
    public int insertClassTeacherInfo(ClassTeacherInfo classTeacherInfo) {
        classTeacherInfo.setCreateTime(DateUtils.getNowDate());
        return classTeacherInfoMapper.insertClassTeacherInfo(classTeacherInfo);
    }

    /**
     * 修改班级教师关系管理
     *
     * @param classTeacherInfo 班级教师关系管理
     * @return 结果
     */
    @Override
    public int updateClassTeacherInfo(ClassTeacherInfo classTeacherInfo) {
        classTeacherInfo.setUpdateTime(DateUtils.getNowDate());
        return classTeacherInfoMapper.updateClassTeacherInfo(classTeacherInfo);
    }

    /**
     * 批量删除班级教师关系管理
     *
     * @param ids 需要删除的班级教师关系管理主键
     * @return 结果
     */
    @Override
    public int deleteClassTeacherInfoByIds(Long[] ids) {
        return classTeacherInfoMapper.deleteClassTeacherInfoByIds(ids);
    }

    /**
     * 删除班级教师关系管理信息
     *
     * @param id 班级教师关系管理主键
     * @return 结果
     */
    @Override
    public int deleteClassTeacherInfoById(Long id) {
        return classTeacherInfoMapper.deleteClassTeacherInfoById(id);
    }
}
