package com.hw.dms.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.dms.mapper.DmsPlanRepairDetailMapper;
import com.hw.dms.domain.DmsPlanRepairDetail;
import com.hw.dms.service.IDmsPlanRepairDetailService;

/**
 * 检修计划明细Service业务层处理
 *
 * @author Open Platform
 * @date 2024-01-15
 */
@Service
public class DmsPlanRepairDetailServiceImpl implements IDmsPlanRepairDetailService
{
    @Autowired
    private DmsPlanRepairDetailMapper dmsPlanRepairDetailMapper;

    /**
     * 查询检修计划明细
     *
     * @param planRepairDetailId 检修计划明细主键
     * @return 检修计划明细
     */
    @Override
    public DmsPlanRepairDetail selectDmsPlanRepairDetailByPlanRepairDetailId(Long planRepairDetailId)
    {
        return dmsPlanRepairDetailMapper.selectDmsPlanRepairDetailByPlanRepairDetailId(planRepairDetailId);
    }

    /**
     * 查询检修计划明细列表
     *
     * @param dmsPlanRepairDetail 检修计划明细
     * @return 检修计划明细
     */
    @Override
    public List<DmsPlanRepairDetail> selectDmsPlanRepairDetailList(DmsPlanRepairDetail dmsPlanRepairDetail)
    {
        return dmsPlanRepairDetailMapper.selectDmsPlanRepairDetailList(dmsPlanRepairDetail);
    }

    /**
     * 新增检修计划明细
     *
     * @param dmsPlanRepairDetail 检修计划明细
     * @return 结果
     */
    @Override
    public int insertDmsPlanRepairDetail(DmsPlanRepairDetail dmsPlanRepairDetail)
    {
        dmsPlanRepairDetail.setCreateTime(DateUtils.getNowDate());
        return dmsPlanRepairDetailMapper.insertDmsPlanRepairDetail(dmsPlanRepairDetail);
    }

    /**
     * 修改检修计划明细
     *
     * @param dmsPlanRepairDetail 检修计划明细
     * @return 结果
     */
    @Override
    public int updateDmsPlanRepairDetail(DmsPlanRepairDetail dmsPlanRepairDetail)
    {
        dmsPlanRepairDetail.setUpdateTime(DateUtils.getNowDate());
        return dmsPlanRepairDetailMapper.updateDmsPlanRepairDetail(dmsPlanRepairDetail);
    }

    /**
     * 批量删除检修计划明细
     *
     * @param planRepairDetailIds 需要删除的检修计划明细主键
     * @return 结果
     */
    @Override
    public int deleteDmsPlanRepairDetailByPlanRepairDetailIds(Long[] planRepairDetailIds)
    {
        return dmsPlanRepairDetailMapper.deleteDmsPlanRepairDetailByPlanRepairDetailIds(planRepairDetailIds);
    }

    /**
     * 删除检修计划明细信息
     *
     * @param planRepairDetailId 检修计划明细主键
     * @return 结果
     */
    @Override
    public int deleteDmsPlanRepairDetailByPlanRepairDetailId(Long planRepairDetailId)
    {
        return dmsPlanRepairDetailMapper.deleteDmsPlanRepairDetailByPlanRepairDetailId(planRepairDetailId);
    }

    @Override
    public List<DmsPlanRepairDetail> selectPlanRepairDetailByPlanRepairId(Long planRepairId) {
        return dmsPlanRepairDetailMapper.selectPlanRepairDetailByPlanRepairId(planRepairId);
    }
}
