package com.hw.mes.service.impl;

import java.util.List;
import com.hw.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.hw.mes.mapper.MesBaseFactoryInfoMapper;
import com.hw.mes.domain.MesBaseFactoryInfo;
import com.hw.mes.service.IMesBaseFactoryInfoService;

/**
 * 工厂信息Service业务层处理
 * 
 * @author Yinq
 * @date 2024-01-23
 */
@Service
public class MesBaseFactoryInfoServiceImpl implements IMesBaseFactoryInfoService 
{
    @Autowired
    private MesBaseFactoryInfoMapper mesBaseFactoryInfoMapper;

    /**
     * 查询工厂信息
     * 
     * @param factoryId 工厂信息主键
     * @return 工厂信息
     */
    @Override
    public MesBaseFactoryInfo selectMesBaseFactoryInfoByFactoryId(Long factoryId)
    {
        return mesBaseFactoryInfoMapper.selectMesBaseFactoryInfoByFactoryId(factoryId);
    }

    /**
     * 查询工厂信息列表
     * 
     * @param mesBaseFactoryInfo 工厂信息
     * @return 工厂信息
     */
    @Override
    public List<MesBaseFactoryInfo> selectMesBaseFactoryInfoList(MesBaseFactoryInfo mesBaseFactoryInfo)
    {
        return mesBaseFactoryInfoMapper.selectMesBaseFactoryInfoList(mesBaseFactoryInfo);
    }

    /**
     * 新增工厂信息
     * 
     * @param mesBaseFactoryInfo 工厂信息
     * @return 结果
     */
    @Override
    public int insertMesBaseFactoryInfo(MesBaseFactoryInfo mesBaseFactoryInfo)
    {
        mesBaseFactoryInfo.setCreateTime(DateUtils.getNowDate());
        return mesBaseFactoryInfoMapper.insertMesBaseFactoryInfo(mesBaseFactoryInfo);
    }

    /**
     * 修改工厂信息
     * 
     * @param mesBaseFactoryInfo 工厂信息
     * @return 结果
     */
    @Override
    public int updateMesBaseFactoryInfo(MesBaseFactoryInfo mesBaseFactoryInfo)
    {
        mesBaseFactoryInfo.setUpdateTime(DateUtils.getNowDate());
        return mesBaseFactoryInfoMapper.updateMesBaseFactoryInfo(mesBaseFactoryInfo);
    }

    /**
     * 批量删除工厂信息
     * 
     * @param factoryIds 需要删除的工厂信息主键
     * @return 结果
     */
    @Override
    public int deleteMesBaseFactoryInfoByFactoryIds(Long[] factoryIds)
    {
        return mesBaseFactoryInfoMapper.deleteMesBaseFactoryInfoByFactoryIds(factoryIds);
    }

    /**
     * 删除工厂信息信息
     * 
     * @param factoryId 工厂信息主键
     * @return 结果
     */
    @Override
    public int deleteMesBaseFactoryInfoByFactoryId(Long factoryId)
    {
        return mesBaseFactoryInfoMapper.deleteMesBaseFactoryInfoByFactoryId(factoryId);
    }
}
