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.MachineLabelMapper;
import com.bonus.material.ma.domain.MachineLabel;
import com.bonus.material.ma.service.IMachineLabelService;

/**
 * 机具设备标签Service业务层处理
 * 
 * @author xsheng
 * @date 2024-09-27
 */
@Service
public class MachineLabelServiceImpl implements IMachineLabelService 
{
    @Autowired
    private MachineLabelMapper machineLabelMapper;

    /**
     * 查询机具设备标签
     * 
     * @param labelId 机具设备标签主键
     * @return 机具设备标签
     */
    @Override
    public MachineLabel selectMachineLabelByLabelId(Long labelId)
    {
        return machineLabelMapper.selectMachineLabelByLabelId(labelId);
    }

    /**
     * 查询机具设备标签列表
     * 
     * @param machineLabel 机具设备标签
     * @return 机具设备标签
     */
    @Override
    public List<MachineLabel> selectMachineLabelList(MachineLabel machineLabel)
    {
        return machineLabelMapper.selectMachineLabelList(machineLabel);
    }

    /**
     * 新增机具设备标签
     * 
     * @param machineLabel 机具设备标签
     * @return 结果
     */
    @Override
    public int insertMachineLabel(MachineLabel machineLabel)
    {
        machineLabel.setCreateTime(DateUtils.getNowDate());
        return machineLabelMapper.insertMachineLabel(machineLabel);
    }

    /**
     * 修改机具设备标签
     * 
     * @param machineLabel 机具设备标签
     * @return 结果
     */
    @Override
    public int updateMachineLabel(MachineLabel machineLabel)
    {
        machineLabel.setUpdateTime(DateUtils.getNowDate());
        return machineLabelMapper.updateMachineLabel(machineLabel);
    }

    /**
     * 批量删除机具设备标签
     * 
     * @param labelIds 需要删除的机具设备标签主键
     * @return 结果
     */
    @Override
    public int deleteMachineLabelByLabelIds(Long[] labelIds)
    {
        return machineLabelMapper.deleteMachineLabelByLabelIds(labelIds);
    }

    /**
     * 删除机具设备标签信息
     * 
     * @param labelId 机具设备标签主键
     * @return 结果
     */
    @Override
    public int deleteMachineLabelByLabelId(Long labelId)
    {
        return machineLabelMapper.deleteMachineLabelByLabelId(labelId);
    }
}
