package com.ruoyi.system.service.columns.impl;

import java.time.LocalDateTime;
import java.util.List;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.columns.SysTeacher;
import com.ruoyi.system.mapper.colums.SysTeacherMapper;
import com.ruoyi.system.service.columns.ISysTeacherService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 员工信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-10-28
 */
@Service
public class SysTeacherServiceImpl implements ISysTeacherService
{
    @Autowired
    private SysTeacherMapper sysTeacherMapper;

    /**
     * 查询员工信息
     *
     * @param userId 员工信息主键
     * @return 员工信息
     */
    @Override
    public SysTeacher selectSysTeacherByUserId(Long userId)
    {
        return sysTeacherMapper.selectSysTeacherByUserId(userId);
    }

    /**
     * 查询员工信息列表
     * 
     * @param sysTeacher 员工信息
     * @return 员工信息
     */
    @Override
    public List<SysTeacher> selectSysTeacherList(SysTeacher sysTeacher)
    {
        return sysTeacherMapper.selectSysTeacherList(sysTeacher);
    }

    /**
     * 新增员工信息
     * 
     * @param sysTeacher 员工信息
     * @return 结果
     */
    @Override
    public int insertSysTeacher(SysTeacher sysTeacher)
    {
        sysTeacher.setCreateTime(LocalDateTime.now());
        return sysTeacherMapper.insertSysTeacher(sysTeacher);
    }

    /**
     * 修改员工信息
     * 
     * @param sysTeacher 员工信息
     * @return 结果
     */
    @Override
    public int updateSysTeacher(SysTeacher sysTeacher)
    {
        sysTeacher.setUpdateTime(LocalDateTime.now());
        return sysTeacherMapper.updateSysTeacher(sysTeacher);
    }

    /**
     * 批量删除员工信息
     * 
     * @param userIds 需要删除的员工信息主键
     * @return 结果
     */
    @Override
    public int deleteSysTeacherByUserIds(Long[] userIds)
    {
        return sysTeacherMapper.deleteSysTeacherByUserIds(userIds);
    }

    /**
     * 删除员工信息信息
     * 
     * @param userId 员工信息主键
     * @return 结果
     */
    @Override
    public int deleteSysTeacherByUserId(Long userId)
    {
        return sysTeacherMapper.deleteSysTeacherByUserId(userId);
    }
}
