package com.ruoyi.system.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.maintenance.MaintenanceStaff;
import com.ruoyi.system.mapper.MaintenanceStaffMapper;
import com.ruoyi.system.service.IMaintenanceStaffService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 维修人员管理Service业务层处理
 * 
 * @author boman
 * @date 2025-02-14
 */
@Service
public class MaintenanceStaffServiceImpl implements IMaintenanceStaffService 
{
    @Autowired
    private MaintenanceStaffMapper maintenanceStaffMapper;

    /**
     * 查询维修人员管理
     * 
     * @param staffId 维修人员管理主键
     * @return 维修人员管理
     */
    @Override
    public MaintenanceStaff selectMaintenanceStaffByStaffId(Long staffId)
    {
        return maintenanceStaffMapper.selectMaintenanceStaffByStaffId(staffId);
    }

    /**
     * 查询维修人员管理列表
     * 
     * @param maintenanceStaff 维修人员管理
     * @return 维修人员管理
     */
    @Override
    public List<MaintenanceStaff> selectMaintenanceStaffList(MaintenanceStaff maintenanceStaff)
    {
        return maintenanceStaffMapper.selectMaintenanceStaffList(maintenanceStaff);
    }

    /**
     * 新增维修人员管理
     * 
     * @param maintenanceStaff 维修人员管理
     * @return 结果
     */
    @Override
    public int insertMaintenanceStaff(MaintenanceStaff maintenanceStaff)
    {
        maintenanceStaff.setCreateTime(DateUtils.getNowDate());
        return maintenanceStaffMapper.insertMaintenanceStaff(maintenanceStaff);
    }

    /**
     * 修改维修人员管理
     * 
     * @param maintenanceStaff 维修人员管理
     * @return 结果
     */
    @Override
    public int updateMaintenanceStaff(MaintenanceStaff maintenanceStaff)
    {
        maintenanceStaff.setUpdateTime(DateUtils.getNowDate());
        return maintenanceStaffMapper.updateMaintenanceStaff(maintenanceStaff);
    }

    /**
     * 批量删除维修人员管理
     * 
     * @param staffIds 需要删除的维修人员管理主键
     * @return 结果
     */
    @Override
    public int deleteMaintenanceStaffByStaffIds(Long[] staffIds)
    {
        return maintenanceStaffMapper.deleteMaintenanceStaffByStaffIds(staffIds);
    }

    /**
     * 删除维修人员管理信息
     * 
     * @param staffId 维修人员管理主键
     * @return 结果
     */
    @Override
    public int deleteMaintenanceStaffByStaffId(Long staffId)
    {
        return maintenanceStaffMapper.deleteMaintenanceStaffByStaffId(staffId);
    }
}
