package com.hw.mes.service.impl;

import java.util.List;
import com.hw.common.core.utils.DateUtils;
import com.hw.common.security.utils.SecurityUtils;
import com.hw.mes.api.domain.MesBaseStationInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.hw.mes.mapper.MesBaseStationInfoMapper;
import com.hw.mes.service.IMesBaseStationInfoService;

/**
 * 工位信息Service业务层处理
 *
 * @author Yinq
 * @date 2024-01-26
 */
@Service
public class MesBaseStationInfoServiceImpl implements IMesBaseStationInfoService
{
    @Autowired
    private MesBaseStationInfoMapper mesBaseStationInfoMapper;

    /**
     * 查询工位信息
     *
     * @param stationId 工位信息主键
     * @return 工位信息
     */
    @Override
    public MesBaseStationInfo selectMesBaseStationInfoByStationId(Long stationId)
    {
        return mesBaseStationInfoMapper.selectMesBaseStationInfoByStationId(stationId);
    }

    /**
     * 查询工位信息列表
     *
     * @param mesBaseStationInfo 工位信息
     * @return 工位信息
     */
    @Override
    public List<MesBaseStationInfo> selectMesBaseStationInfoList(MesBaseStationInfo mesBaseStationInfo)
    {
        return mesBaseStationInfoMapper.selectMesBaseStationInfoList(mesBaseStationInfo);
    }

    /**
     * 新增工位信息
     *
     * @param mesBaseStationInfo 工位信息
     * @return 结果
     */
    @Override
    public int insertMesBaseStationInfo(MesBaseStationInfo mesBaseStationInfo)
    {
        mesBaseStationInfo.setCreateTime(DateUtils.getNowDate());
        mesBaseStationInfo.setCreateBy(SecurityUtils.getUsername());
        return mesBaseStationInfoMapper.insertMesBaseStationInfo(mesBaseStationInfo);
    }

    /**
     * 修改工位信息
     *
     * @param mesBaseStationInfo 工位信息
     * @return 结果
     */
    @Override
    public int updateMesBaseStationInfo(MesBaseStationInfo mesBaseStationInfo)
    {
        mesBaseStationInfo.setUpdateTime(DateUtils.getNowDate());
        mesBaseStationInfo.setUpdateBy(SecurityUtils.getUsername());
        return mesBaseStationInfoMapper.updateMesBaseStationInfo(mesBaseStationInfo);
    }

    /**
     * 批量删除工位信息
     *
     * @param stationIds 需要删除的工位信息主键
     * @return 结果
     */
    @Override
    public int deleteMesBaseStationInfoByStationIds(Long[] stationIds)
    {
        return mesBaseStationInfoMapper.deleteMesBaseStationInfoByStationIds(stationIds);
    }

    /**
     * 删除工位信息信息
     *
     * @param stationId 工位信息主键
     * @return 结果
     */
    @Override
    public int deleteMesBaseStationInfoByStationId(Long stationId)
    {
        return mesBaseStationInfoMapper.deleteMesBaseStationInfoByStationId(stationId);
    }
}
