package com.srs.routine.service.impl;

import java.util.List;

import com.srs.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import com.srs.routine.mapper.RtStuLeaveOperationRecordsMapper;
import com.srs.routine.domain.RtStuLeaveOperationRecords;
import com.srs.routine.service.IRtStuLeaveOperationRecordsService;

/**
 * 请假操作记录Service业务层处理
 *
 * @author LSD
 * @date 2024-03-30
 */
@Service
public class RtStuLeaveOperationRecordsServiceImpl extends ServiceImpl<RtStuLeaveOperationRecordsMapper, RtStuLeaveOperationRecords> implements IRtStuLeaveOperationRecordsService {
    @Autowired
    private RtStuLeaveOperationRecordsMapper rtStuLeaveOperationRecordsMapper;

    /**
     * 查询请假操作记录
     *
     * @param operationRecordsId 请假操作记录主键
     * @return 请假操作记录
     */
    @Override
    public RtStuLeaveOperationRecords selectRtStuLeaveOperationRecordsByOperationRecordsId(Long operationRecordsId) {
        return rtStuLeaveOperationRecordsMapper.selectRtStuLeaveOperationRecordsByOperationRecordsId(operationRecordsId);
    }

    /**
     * 查询请假操作记录列表
     *
     * @param rtStuLeaveOperationRecords 请假操作记录
     * @return 请假操作记录
     */
    @Override
    public List<RtStuLeaveOperationRecords> selectRtStuLeaveOperationRecordsList(RtStuLeaveOperationRecords rtStuLeaveOperationRecords) {
        return rtStuLeaveOperationRecordsMapper.selectRtStuLeaveOperationRecordsList(rtStuLeaveOperationRecords);
    }

    /**
     * 新增请假操作记录
     *
     * @param rtStuLeaveOperationRecords 请假操作记录
     * @return 结果
     */
    @Override
    public int insertRtStuLeaveOperationRecords(RtStuLeaveOperationRecords rtStuLeaveOperationRecords) {
        rtStuLeaveOperationRecords.setCreateTime(DateUtils.getNowDate());
        return rtStuLeaveOperationRecordsMapper.insertRtStuLeaveOperationRecords(rtStuLeaveOperationRecords);
    }

    /**
     * 修改请假操作记录
     *
     * @param rtStuLeaveOperationRecords 请假操作记录
     * @return 结果
     */
    @Override
    public int updateRtStuLeaveOperationRecords(RtStuLeaveOperationRecords rtStuLeaveOperationRecords) {
        rtStuLeaveOperationRecords.setUpdateTime(DateUtils.getNowDate());
        return rtStuLeaveOperationRecordsMapper.updateRtStuLeaveOperationRecords(rtStuLeaveOperationRecords);
    }

    /**
     * 批量删除请假操作记录
     *
     * @param operationRecordsIds 需要删除的请假操作记录主键
     * @return 结果
     */
    @Override
    public int deleteRtStuLeaveOperationRecordsByOperationRecordsIds(Long[] operationRecordsIds) {
        return rtStuLeaveOperationRecordsMapper.deleteRtStuLeaveOperationRecordsByOperationRecordsIds(operationRecordsIds);
    }

    /**
     * 删除请假操作记录信息
     *
     * @param operationRecordsId 请假操作记录主键
     * @return 结果
     */
    @Override
    public int deleteRtStuLeaveOperationRecordsByOperationRecordsId(Long operationRecordsId) {
        return rtStuLeaveOperationRecordsMapper.deleteRtStuLeaveOperationRecordsByOperationRecordsId(operationRecordsId);
    }
}
