package com.srs.comprehensive.service.impl;

import java.util.Arrays;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.srs.comprehensive.mapper.TeacherEvaluationStatusMapper;
import com.srs.comprehensive.domain.TeacherEvaluationStatus;
import com.srs.comprehensive.service.ITeacherEvaluationStatusService;

/**
 * 辅导员综合评价状态Service业务层处理
 *
 * @author srs
 * @date 2024-01-20
 */
@Service
public class TeacherEvaluationStatusServiceImpl implements ITeacherEvaluationStatusService {
    @Autowired
    private TeacherEvaluationStatusMapper teacherEvaluationStatusMapper;

    /**
     * 查询辅导员综合评价状态
     *
     * @param id 辅导员综合评价状态主键
     * @return 辅导员综合评价状态
     */
    @Override
    public TeacherEvaluationStatus selectTeacherEvaluationStatusById(Long id) {
        return teacherEvaluationStatusMapper.selectById(id);
    }

    /**
     * 查询辅导员综合评价状态列表
     *
     * @param teacherEvaluationStatus 辅导员综合评价状态
     * @return 辅导员综合评价状态
     */
    @Override
    public List<TeacherEvaluationStatus> selectTeacherEvaluationStatusList(TeacherEvaluationStatus teacherEvaluationStatus) {
        return teacherEvaluationStatusMapper.selectTeacherEvaluationStatusList(teacherEvaluationStatus);
    }

    /**
     * 新增辅导员综合评价状态
     *
     * @param teacherEvaluationStatus 辅导员综合评价状态
     * @return 结果
     */
    @Override
    public int insertTeacherEvaluationStatus(TeacherEvaluationStatus teacherEvaluationStatus) {
        return teacherEvaluationStatusMapper.insert(teacherEvaluationStatus);
    }

    /**
     * 修改辅导员综合评价状态
     *
     * @param teacherEvaluationStatus 辅导员综合评价状态
     * @return 结果
     */
    @Override
    public int updateTeacherEvaluationStatus(TeacherEvaluationStatus teacherEvaluationStatus) {
        return teacherEvaluationStatusMapper.updateById(teacherEvaluationStatus);
    }

    /**
     * 批量删除辅导员综合评价状态
     *
     * @param ids 需要删除的辅导员综合评价状态主键
     * @return 结果
     */
    @Override
    public int deleteTeacherEvaluationStatusByIds(Long[] ids) {
        return teacherEvaluationStatusMapper.deleteBatchIds(Arrays.asList(ids));
    }

    /**
     * 删除辅导员综合评价状态信息
     *
     * @param id 辅导员综合评价状态主键
     * @return 结果
     */
    @Override
    public int deleteTeacherEvaluationStatusById(Long id) {
        return teacherEvaluationStatusMapper.deleteById(id);
    }

    /**
     * 查询辅导员待办事项数量
     *
     * @param teacherId 辅导员ID
     * @param stuYearId 学年ID
     * @return 待办事项数量
     */
    @Override
    public Integer selectTodoCountByTeacherAndYear(Long teacherId, Long stuYearId) {
        return teacherEvaluationStatusMapper.selectTodoCountByTeacherAndYear(teacherId, stuYearId);
    }

    /**
     * 查询综合评价成绩导入状态
     *
     * @param teacherId 辅导员ID
     * @param stuYearId 学年ID
     * @return 是否已导入成绩
     */
    @Override
    public Boolean selectScoreImportStatusByTeacherAndYear(Long teacherId, Long stuYearId) {
        return teacherEvaluationStatusMapper.selectScoreImportStatusByTeacherAndYear(teacherId, stuYearId);
    }

    /**
     * 获取所有辅导员基本信息
     *
     * @return 辅导员列表
     */
    @Override
    public List<TeacherEvaluationStatus> selectAllTeachers() {
        return teacherEvaluationStatusMapper.selectAllTeachers();
    }

    /**
     * 根据条件查询辅导员综合评价状态
     *
     * @param deptId 学院ID
     * @param teacherName 辅导员姓名
     * @param employeeId 工号
     * @param stuYearId 学年ID
     * @return 辅导员综合评价状态列表
     */
    @Override
    public List<TeacherEvaluationStatus> selectTeacherEvaluationStatusByCondition(
            Long deptId, String teacherName, String employeeId, Long stuYearId) {
        return teacherEvaluationStatusMapper.selectTeacherEvaluationStatusByCondition(
                deptId, teacherName, employeeId, stuYearId);
    }

    /**
     * 查询学院名称列表
     *
     * @return 学院列表
     */
    @Override
    public List<java.util.Map<String, Object>> selectDeptNameList() {
        return teacherEvaluationStatusMapper.selectDeptNameList();
    }
}
