package com.bonus.material.ma.service.impl;

import java.util.List;
import com.bonus.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.bonus.material.ma.mapper.MachineAppendMapper;
import com.bonus.material.ma.domain.MachineAppend;
import com.bonus.material.ma.service.IMachineAppendService;

/**
 * 机具设备最近领退信息Service业务层处理
 * 
 * @author xsheng
 * @date 2024-09-27
 */
@Service
public class MachineAppendServiceImpl implements IMachineAppendService 
{
    @Autowired
    private MachineAppendMapper machineAppendMapper;

    /**
     * 查询机具设备最近领退信息
     * 
     * @param maId 机具设备最近领退信息主键
     * @return 机具设备最近领退信息
     */
    @Override
    public MachineAppend selectMachineAppendByMaId(Long maId)
    {
        return machineAppendMapper.selectMachineAppendByMaId(maId);
    }

    /**
     * 查询机具设备最近领退信息列表
     * 
     * @param machineAppend 机具设备最近领退信息
     * @return 机具设备最近领退信息
     */
    @Override
    public List<MachineAppend> selectMachineAppendList(MachineAppend machineAppend)
    {
        return machineAppendMapper.selectMachineAppendList(machineAppend);
    }

    /**
     * 新增机具设备最近领退信息
     * 
     * @param machineAppend 机具设备最近领退信息
     * @return 结果
     */
    @Override
    public int insertMachineAppend(MachineAppend machineAppend)
    {
        machineAppend.setCreateTime(DateUtils.getNowDate());
        return machineAppendMapper.insertMachineAppend(machineAppend);
    }

    /**
     * 修改机具设备最近领退信息
     * 
     * @param machineAppend 机具设备最近领退信息
     * @return 结果
     */
    @Override
    public int updateMachineAppend(MachineAppend machineAppend)
    {
        machineAppend.setUpdateTime(DateUtils.getNowDate());
        return machineAppendMapper.updateMachineAppend(machineAppend);
    }

    /**
     * 批量删除机具设备最近领退信息
     * 
     * @param maIds 需要删除的机具设备最近领退信息主键
     * @return 结果
     */
    @Override
    public int deleteMachineAppendByMaIds(Long[] maIds)
    {
        return machineAppendMapper.deleteMachineAppendByMaIds(maIds);
    }

    /**
     * 删除机具设备最近领退信息信息
     * 
     * @param maId 机具设备最近领退信息主键
     * @return 结果
     */
    @Override
    public int deleteMachineAppendByMaId(Long maId)
    {
        return machineAppendMapper.deleteMachineAppendByMaId(maId);
    }
}
