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.SysTeacherConferenceMeetingMaterialsMapper;
import com.srs.teacher.domain.SysTeacherConferenceMeetingMaterials;
import com.srs.teacher.service.ISysTeacherConferenceMeetingMaterialsService;

/**
 * 业绩考核-个人填报-考勤管理-会议佐证材料Service业务层处理
 *
 * @author chc
 * @date 2024-06-11
 */
@Service
public class SysTeacherConferenceMeetingMaterialsServiceImpl extends ServiceImpl<SysTeacherConferenceMeetingMaterialsMapper, SysTeacherConferenceMeetingMaterials> implements ISysTeacherConferenceMeetingMaterialsService {
    @Autowired
    private SysTeacherConferenceMeetingMaterialsMapper sysTeacherConferenceMeetingMaterialsMapper;

    /**
     * 查询业绩考核-个人填报-考勤管理-会议佐证材料
     *
     * @param id 业绩考核-个人填报-考勤管理-会议佐证材料主键
     * @return 业绩考核-个人填报-考勤管理-会议佐证材料
     */
    @Override
    public SysTeacherConferenceMeetingMaterials selectSysTeacherConferenceMeetingMaterialsById(Long id) {
        return sysTeacherConferenceMeetingMaterialsMapper.selectSysTeacherConferenceMeetingMaterialsById(id);
    }

    /**
     * 根据辅导员名称、年份 月份 查询业绩考核-个人填报-考勤管理-会议佐证材料
     *
     * @param fdyName 辅导员名称主键
     * @return 业绩考核-个人填报-考勤管理-会议佐证材料
     */
    @Override
    public List<SysTeacherConferenceMeetingMaterials> selectSysTeacherConferenceMeetingMaterialsByFdyName(String fdyName, String fillingYear, String fillingMonth) {
        return sysTeacherConferenceMeetingMaterialsMapper.selectSysTeacherConferenceMeetingMaterialsByFdyName(fdyName, fillingYear, fillingMonth);
    }

    /**
     * 查询业绩考核-个人填报-考勤管理-会议佐证材料列表
     *
     * @param sysTeacherConferenceMeetingMaterials 业绩考核-个人填报-考勤管理-会议佐证材料
     * @return 业绩考核-个人填报-考勤管理-会议佐证材料
     */
    @Override
    public List<SysTeacherConferenceMeetingMaterials> selectSysTeacherConferenceMeetingMaterialsList(SysTeacherConferenceMeetingMaterials sysTeacherConferenceMeetingMaterials) {
        sysTeacherConferenceMeetingMaterials.setFdyName(SecurityUtils.getLoginUser().getUser().getNickName());
        return sysTeacherConferenceMeetingMaterialsMapper.selectSysTeacherConferenceMeetingMaterialsList(sysTeacherConferenceMeetingMaterials);
    }

    /**
     * 新增业绩考核-个人填报-考勤管理-会议佐证材料
     *
     * @param sysTeacherConferenceMeetingMaterials 业绩考核-个人填报-考勤管理-会议佐证材料
     * @return 结果
     */
    @Override
    public int insertSysTeacherConferenceMeetingMaterials(SysTeacherConferenceMeetingMaterials sysTeacherConferenceMeetingMaterials) {
        sysTeacherConferenceMeetingMaterials.setFdyName(SecurityUtils.getLoginUser().getUser().getNickName());
        if (sysTeacherConferenceMeetingMaterials.getId() != null) {
            return sysTeacherConferenceMeetingMaterialsMapper.updateSysTeacherConferenceMeetingMaterials(sysTeacherConferenceMeetingMaterials);
        }
        return sysTeacherConferenceMeetingMaterialsMapper.insertSysTeacherConferenceMeetingMaterials(sysTeacherConferenceMeetingMaterials);
    }

    /**
     * 修改业绩考核-个人填报-考勤管理-会议佐证材料
     *
     * @param sysTeacherConferenceMeetingMaterials 业绩考核-个人填报-考勤管理-会议佐证材料
     * @return 结果
     */
    @Override
    public int updateSysTeacherConferenceMeetingMaterials(SysTeacherConferenceMeetingMaterials sysTeacherConferenceMeetingMaterials) {
        sysTeacherConferenceMeetingMaterials.setFdyName(SecurityUtils.getLoginUser().getUser().getNickName());
        return sysTeacherConferenceMeetingMaterialsMapper.updateSysTeacherConferenceMeetingMaterials(sysTeacherConferenceMeetingMaterials);
    }

    /**
     * 批量删除业绩考核-个人填报-考勤管理-会议佐证材料
     *
     * @param ids 需要删除的业绩考核-个人填报-考勤管理-会议佐证材料主键
     * @return 结果
     */
    @Override
    public int deleteSysTeacherConferenceMeetingMaterialsByIds(Long[] ids) {
        return sysTeacherConferenceMeetingMaterialsMapper.deleteSysTeacherConferenceMeetingMaterialsByIds(ids);
    }

    /**
     * 删除业绩考核-个人填报-考勤管理-会议佐证材料信息
     *
     * @param id 业绩考核-个人填报-考勤管理-会议佐证材料主键
     * @return 结果
     */
    @Override
    public int deleteSysTeacherConferenceMeetingMaterialsById(Long id) {
        return sysTeacherConferenceMeetingMaterialsMapper.deleteSysTeacherConferenceMeetingMaterialsById(id);
    }
}
