package com.cyl.manager.staff.service.impl;

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

import com.cyl.manager.staff.domain.StaffImage;
import com.cyl.manager.staff.mapper.StaffImageMapper;
import com.cyl.manager.staff.service.IStaffImageService;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 人员信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-12-26
 */
@Service
public class StaffImageServiceImpl implements IStaffImageService
{
    @Autowired
    private StaffImageMapper staffImageMapper;

    /**
     * 查询人员信息
     * 
     * @param id 人员信息主键
     * @return 人员信息
     */
    @Override
    public StaffImage selectStaffImageById(Long id)
    {
        return staffImageMapper.selectStaffImageById(id);
    }

    /**
     * 查询人员信息列表
     * 
     * @param staffImage 人员信息
     * @return 人员信息
     */
    @Override
    public List<StaffImage> selectStaffImageList(StaffImage staffImage)
    {
        return staffImageMapper.selectStaffImageList(staffImage);
    }

    /**
     * 新增人员信息
     * 
     * @param staffImage 人员信息
     * @return 结果
     */
    @Override
    public int insertStaffImage(StaffImage staffImage)
    {
        staffImage.setCreateTime(LocalDateTime.now());
        return staffImageMapper.insertStaffImage(staffImage);
    }

    /**
     * 修改人员信息
     * 
     * @param staffImage 人员信息
     * @return 结果
     */
    @Override
    public int updateStaffImage(StaffImage staffImage)
    {
        staffImage.setUpdateTime(LocalDateTime.now());
        return staffImageMapper.updateStaffImage(staffImage);
    }

    /**
     * 批量删除人员信息
     * 
     * @param ids 需要删除的人员信息主键
     * @return 结果
     */
    @Override
    public int deleteStaffImageByIds(Long[] ids)
    {
        return staffImageMapper.deleteStaffImageByIds(ids);
    }

    /**
     * 删除人员信息信息
     * 
     * @param id 人员信息主键
     * @return 结果
     */
    @Override
    public int deleteStaffImageById(Long id)
    {
        return staffImageMapper.deleteStaffImageById(id);
    }
}
