package com.aucma.production.service.impl;

import com.aucma.common.utils.DateUtils;
import com.aucma.production.domain.AndonBoardConfig;
import com.aucma.production.mapper.AndonBoardConfigMapper;
import com.aucma.production.service.IAndonBoardConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 安灯看板配置Service业务层处理
 * 
 * @author Yinq
 * @date 2025-10-28
 */
@Service
public class AndonBoardConfigServiceImpl implements IAndonBoardConfigService 
{
    @Autowired
    private AndonBoardConfigMapper andonBoardConfigMapper;

    /**
     * 查询安灯看板配置
     * 
     * @param boardId 安灯看板配置主键
     * @return 安灯看板配置
     */
    @Override
    public AndonBoardConfig selectAndonBoardConfigByBoardId(Long boardId)
    {
        return andonBoardConfigMapper.selectAndonBoardConfigByBoardId(boardId);
    }

    /**
     * 查询安灯看板配置列表
     * 
     * @param andonBoardConfig 安灯看板配置
     * @return 安灯看板配置
     */
    @Override
    public List<AndonBoardConfig> selectAndonBoardConfigList(AndonBoardConfig andonBoardConfig)
    {
        return andonBoardConfigMapper.selectAndonBoardConfigList(andonBoardConfig);
    }

    /**
     * 新增安灯看板配置
     * 
     * @param andonBoardConfig 安灯看板配置
     * @return 结果
     */
    @Override
    public int insertAndonBoardConfig(AndonBoardConfig andonBoardConfig)
    {
        andonBoardConfig.setCreateTime(DateUtils.getNowDate());
        return andonBoardConfigMapper.insertAndonBoardConfig(andonBoardConfig);
    }

    /**
     * 修改安灯看板配置
     * 
     * @param andonBoardConfig 安灯看板配置
     * @return 结果
     */
    @Override
    public int updateAndonBoardConfig(AndonBoardConfig andonBoardConfig)
    {
        andonBoardConfig.setUpdateTime(DateUtils.getNowDate());
        return andonBoardConfigMapper.updateAndonBoardConfig(andonBoardConfig);
    }

    /**
     * 批量删除安灯看板配置
     * 
     * @param boardIds 需要删除的安灯看板配置主键
     * @return 结果
     */
    @Override
    public int deleteAndonBoardConfigByBoardIds(Long[] boardIds)
    {
        return andonBoardConfigMapper.deleteAndonBoardConfigByBoardIds(boardIds);
    }

    /**
     * 删除安灯看板配置信息
     * 
     * @param boardId 安灯看板配置主键
     * @return 结果
     */
    @Override
    public int deleteAndonBoardConfigByBoardId(Long boardId)
    {
        return andonBoardConfigMapper.deleteAndonBoardConfigByBoardId(boardId);
    }
}
