package com.srs.system.service.impl;

import java.util.List;

import com.srs.common.utils.DateUtils;
import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import com.srs.system.mapper.QgzxTeacherMapper;
import com.srs.system.domain.QgzxTeacher;
import com.srs.system.service.IQgzxTeacherService;

/**
 * 教职工信息Service业务层处理
 *
 * @author srs
 * @date 2025-07-14
 */
@Service
public class QgzxTeacherServiceImpl extends ServiceImpl<QgzxTeacherMapper,QgzxTeacher> implements IQgzxTeacherService {
    @Autowired
    private QgzxTeacherMapper qgzxTeacherMapper;

    /**
     * 查询教职工信息
     *
     * @param teacherId 教职工信息主键
     * @return 教职工信息
     */
    @Override
    public QgzxTeacher selectQgzxTeacherByTeacherId(Long teacherId) {
        return qgzxTeacherMapper.selectQgzxTeacherByTeacherId(teacherId);
    }

    /**
     * 查询教职工信息列表
     *
     * @param qgzxTeacher 教职工信息
     * @return 教职工信息
     */
    @Override
    public List<QgzxTeacher> selectQgzxTeacherList(QgzxTeacher qgzxTeacher) {
        return qgzxTeacherMapper.selectQgzxTeacherList(qgzxTeacher);
    }

    /**
     * 新增教职工信息
     *
     * @param qgzxTeacher 教职工信息
     * @return 结果
     */
    @Override
    public int insertQgzxTeacher(QgzxTeacher qgzxTeacher) {
                qgzxTeacher.setCreateTime(DateUtils.getNowDate());
            return qgzxTeacherMapper.insertQgzxTeacher(qgzxTeacher);
    }

    /**
     * 修改教职工信息
     *
     * @param qgzxTeacher 教职工信息
     * @return 结果
     */
    @Override
    public int updateQgzxTeacher(QgzxTeacher qgzxTeacher) {
                qgzxTeacher.setUpdateTime(DateUtils.getNowDate());
        return qgzxTeacherMapper.updateQgzxTeacher(qgzxTeacher);
    }

    /**
     * 批量删除教职工信息
     *
     * @param teacherIds 需要删除的教职工信息主键
     * @return 结果
     */
    @Override
    public int deleteQgzxTeacherByTeacherIds(Long[] teacherIds) {
        return qgzxTeacherMapper.deleteQgzxTeacherByTeacherIds(teacherIds);
    }

    /**
     * 删除教职工信息信息
     *
     * @param teacherId 教职工信息主键
     * @return 结果
     */
    @Override
    public int deleteQgzxTeacherByTeacherId(Long teacherId) {
        return qgzxTeacherMapper.deleteQgzxTeacherByTeacherId(teacherId);
    }
}
