package com.hw.mes.service.impl;

import java.util.List;
import com.hw.common.core.utils.DateUtils;
import com.hw.mes.api.domain.MesBaseBarcodeInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.hw.mes.mapper.MesBaseBarcodeInfoMapper;
import com.hw.mes.service.IMesBaseBarcodeInfoService;

/**
 * 条码信息Service业务层处理
 *
 * @author xs
 * @date 2023-12-20
 */
@Service
public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
{
    @Autowired
    private MesBaseBarcodeInfoMapper mesBaseBarcodeInfoMapper;

    /**
     * 查询条码信息
     *
     * @param barcodeInfo  条码信息UID
     * @return 条码信息
     */
    @Override
    public MesBaseBarcodeInfo selectMesBaseBarcodeInfoByBarcodeInfo(String barcodeInfo)
    {
        return mesBaseBarcodeInfoMapper.selectMesBaseBarcodeInfoByBarcodeInfo(barcodeInfo);
    }


    /**
     * 查询条码信息
     *
     * @param barcodeId 条码信息主键
     * @return 条码信息
     */
    @Override
    public MesBaseBarcodeInfo selectMesBaseBarcodeInfoByBarcodeId(Long barcodeId)
    {
        return mesBaseBarcodeInfoMapper.selectMesBaseBarcodeInfoByBarcodeId(barcodeId);
    }

    /**
     * 查询条码信息列表
     *
     * @param mesBaseBarcodeInfo 条码信息
     * @return 条码信息
     */
    @Override
    public List<MesBaseBarcodeInfo> selectMesBaseBarcodeInfoList(MesBaseBarcodeInfo mesBaseBarcodeInfo)
    {
        return mesBaseBarcodeInfoMapper.selectMesBaseBarcodeInfoList(mesBaseBarcodeInfo);
    }

    /**
     * 新增条码信息
     *
     * @param mesBaseBarcodeInfo 条码信息
     * @return 结果
     */
    @Override
    public int insertMesBaseBarcodeInfo(MesBaseBarcodeInfo mesBaseBarcodeInfo)
    {
        mesBaseBarcodeInfo.setCreateTime(DateUtils.getNowDate());
        return mesBaseBarcodeInfoMapper.insertMesBaseBarcodeInfo(mesBaseBarcodeInfo);
    }

    /**
     * 修改条码信息
     *
     * @param mesBaseBarcodeInfo 条码信息
     * @return 结果
     */
    @Override
    public int updateMesBaseBarcodeInfo(MesBaseBarcodeInfo mesBaseBarcodeInfo)
    {
        mesBaseBarcodeInfo.setUpdateTime(DateUtils.getNowDate());
        return mesBaseBarcodeInfoMapper.updateMesBaseBarcodeInfo(mesBaseBarcodeInfo);
    }

    /**
     * 批量删除条码信息
     *
     * @param barcodeIds 需要删除的条码信息主键
     * @return 结果
     */
    @Override
    public int deleteMesBaseBarcodeInfoByBarcodeIds(Long[] barcodeIds)
    {
        return mesBaseBarcodeInfoMapper.deleteMesBaseBarcodeInfoByBarcodeIds(barcodeIds);
    }

    /**
     * 删除条码信息信息
     *
     * @param barcodeId 条码信息主键
     * @return 结果
     */
    @Override
    public int deleteMesBaseBarcodeInfoByBarcodeId(Long barcodeId)
    {
        return mesBaseBarcodeInfoMapper.deleteMesBaseBarcodeInfoByBarcodeId(barcodeId);
    }
}
