package com.srs.teacher.service.impl;

import java.util.List;

import com.srs.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import com.srs.teacher.mapper.SysTeacherKpiFillingGraduationGuidanceMapper;
import com.srs.teacher.domain.SysTeacherKpiFillingGraduationGuidance;
import com.srs.teacher.service.ISysTeacherKpiFillingGraduationGuidanceService;

/**
 * 业绩考核-个人填报-就业指导工作Service业务层处理
 *
 * @author
 * @date 2024-06-11
 */
@Service
public class SysTeacherKpiFillingGraduationGuidanceServiceImpl extends ServiceImpl<SysTeacherKpiFillingGraduationGuidanceMapper, SysTeacherKpiFillingGraduationGuidance> implements ISysTeacherKpiFillingGraduationGuidanceService {
    @Autowired
    private SysTeacherKpiFillingGraduationGuidanceMapper sysTeacherKpiFillingGraduationGuidanceMapper;

    /**
     * 查询业绩考核-个人填报-就业指导工作
     *
     * @param id 业绩考核-个人填报-就业指导工作主键
     * @return 业绩考核-个人填报-就业指导工作
     */
    @Override
    public SysTeacherKpiFillingGraduationGuidance selectSysTeacherKpiFillingGraduationGuidanceById(Long id) {
        return sysTeacherKpiFillingGraduationGuidanceMapper.selectSysTeacherKpiFillingGraduationGuidanceById(id);
    }

    /**
     * 查询业绩考核-个人填报-就业指导工作列表
     *
     * @param sysTeacherKpiFillingGraduationGuidance 业绩考核-个人填报-就业指导工作
     * @return 业绩考核-个人填报-就业指导工作
     */
    @Override
    public List<SysTeacherKpiFillingGraduationGuidance> selectSysTeacherKpiFillingGraduationGuidanceList(SysTeacherKpiFillingGraduationGuidance sysTeacherKpiFillingGraduationGuidance) {
        sysTeacherKpiFillingGraduationGuidance.setFdyName(SecurityUtils.getLoginUser().getUser().getNickName());
        return sysTeacherKpiFillingGraduationGuidanceMapper.selectSysTeacherKpiFillingGraduationGuidanceList(sysTeacherKpiFillingGraduationGuidance);
    }

    /**
     * 根据辅导员名称、年份 月份 查询
     *
     * @param fdyName 辅导员名称主键
     * @return 业绩考核-个人填报-就业指导工作集合
     */
    @Override
    public List<SysTeacherKpiFillingGraduationGuidance> selectSysTeacherKpiFillingGraduationGuidanceByFdyName(String fdyName, String fillingYear, String fillingMonth, String classType) {
        return sysTeacherKpiFillingGraduationGuidanceMapper.selectSysTeacherKpiFillingGraduationGuidanceByFdyName(fdyName, fillingYear, fillingMonth, classType);
    }

    /**
     * 新增业绩考核-个人填报-就业指导工作
     *
     * @param sysTeacherKpiFillingGraduationGuidance 业绩考核-个人填报-就业指导工作
     * @return 结果
     */
    @Override
    public int insertSysTeacherKpiFillingGraduationGuidance(SysTeacherKpiFillingGraduationGuidance sysTeacherKpiFillingGraduationGuidance) {
        sysTeacherKpiFillingGraduationGuidance.setFdyName(SecurityUtils.getLoginUser().getUser().getNickName());
        if (sysTeacherKpiFillingGraduationGuidance.getId() != null) {
            return sysTeacherKpiFillingGraduationGuidanceMapper.updateSysTeacherKpiFillingGraduationGuidance(sysTeacherKpiFillingGraduationGuidance);
        }
        return sysTeacherKpiFillingGraduationGuidanceMapper.insertSysTeacherKpiFillingGraduationGuidance(sysTeacherKpiFillingGraduationGuidance);
    }

    /**
     * 修改业绩考核-个人填报-就业指导工作
     *
     * @param sysTeacherKpiFillingGraduationGuidance 业绩考核-个人填报-就业指导工作
     * @return 结果
     */
    @Override
    public int updateSysTeacherKpiFillingGraduationGuidance(SysTeacherKpiFillingGraduationGuidance sysTeacherKpiFillingGraduationGuidance) {
        return sysTeacherKpiFillingGraduationGuidanceMapper.updateSysTeacherKpiFillingGraduationGuidance(sysTeacherKpiFillingGraduationGuidance);
    }

    /**
     * 批量删除业绩考核-个人填报-就业指导工作
     *
     * @param ids 需要删除的业绩考核-个人填报-就业指导工作主键
     * @return 结果
     */
    @Override
    public int deleteSysTeacherKpiFillingGraduationGuidanceByIds(Long[] ids) {
        return sysTeacherKpiFillingGraduationGuidanceMapper.deleteSysTeacherKpiFillingGraduationGuidanceByIds(ids);
    }

    /**
     * 删除业绩考核-个人填报-就业指导工作信息
     *
     * @param id 业绩考核-个人填报-就业指导工作主键
     * @return 结果
     */
    @Override
    public int deleteSysTeacherKpiFillingGraduationGuidanceById(Long id) {
        return sysTeacherKpiFillingGraduationGuidanceMapper.deleteSysTeacherKpiFillingGraduationGuidanceById(id);
    }
}
