package com.goomood.phm.service.impl;

import java.util.List;
import com.goomood.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.goomood.phm.mapper.FaultDescriptionMapper;
import com.goomood.phm.domain.FaultDescription;
import com.goomood.phm.service.IFaultDescriptionService;

/**
 * 故障缺陷Service业务层处理
 * 
 * @author goomood
 * @date 2024-11-17
 */
@Service
public class FaultDescriptionServiceImpl implements IFaultDescriptionService 
{
    @Autowired
    private FaultDescriptionMapper faultDescriptionMapper;

    /**
     * 查询故障缺陷
     * 
     * @param id 故障缺陷主键
     * @return 故障缺陷
     */
    @Override
    public FaultDescription selectFaultDescriptionById(Long id)
    {
        return faultDescriptionMapper.selectFaultDescriptionById(id);
    }

    /**
     * 查询故障缺陷列表
     * 
     * @param faultDescription 故障缺陷
     * @return 故障缺陷
     */
    @Override
    public List<FaultDescription> selectFaultDescriptionList(FaultDescription faultDescription)
    {
        return faultDescriptionMapper.selectFaultDescriptionList(faultDescription);
    }

    /**
     * 新增故障缺陷
     * 
     * @param faultDescription 故障缺陷
     * @return 结果
     */
    @Override
    public int insertFaultDescription(FaultDescription faultDescription)
    {
        faultDescription.setCreateTime(DateUtils.getNowDate());
        return faultDescriptionMapper.insertFaultDescription(faultDescription);
    }

    /**
     * 修改故障缺陷
     * 
     * @param faultDescription 故障缺陷
     * @return 结果
     */
    @Override
    public int updateFaultDescription(FaultDescription faultDescription)
    {
        faultDescription.setUpdateTime(DateUtils.getNowDate());
        return faultDescriptionMapper.updateFaultDescription(faultDescription);
    }

    /**
     * 批量删除故障缺陷
     * 
     * @param ids 需要删除的故障缺陷主键
     * @return 结果
     */
    @Override
    public int deleteFaultDescriptionByIds(Long[] ids)
    {
        return faultDescriptionMapper.deleteFaultDescriptionByIds(ids);
    }

    /**
     * 删除故障缺陷信息
     * 
     * @param id 故障缺陷主键
     * @return 结果
     */
    @Override
    public int deleteFaultDescriptionById(Long id)
    {
        return faultDescriptionMapper.deleteFaultDescriptionById(id);
    }
}
