package com.ruoyi.ems.service.impl;

import com.ruoyi.ems.domain.OpInspectionTask;
import com.ruoyi.ems.mapper.OpInspectionPlanMapper;
import com.ruoyi.ems.service.IOpInspectionPlanService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 巡检任务Service业务层处理
 *
 * @author ruoyi
 * @date 2024-08-29
 */
@Service
public class OpInspectionPlanServiceImpl implements IOpInspectionPlanService {
    @Autowired
    private OpInspectionPlanMapper inspectionPlanMapper;

    /**
     * 查询巡检任务
     *
     * @param id 巡检任务主键
     * @return 巡检任务
     */
    @Override
    public OpInspectionTask selectOpInspectionPlanById(Long id) {
        return inspectionPlanMapper.selectOpInspectionPlanById(id);
    }

    /**
     * 查询巡检任务列表
     *
     * @param opInspectionPlan 巡检任务
     * @return 巡检任务
     */
    @Override
    public List<OpInspectionTask> selectOpInspectionPlanList(OpInspectionTask opInspectionPlan) {
        return inspectionPlanMapper.selectOpInspectionPlanList(opInspectionPlan);
    }

    /**
     * 新增巡检任务
     *
     * @param opInspectionPlan 巡检任务
     * @return 结果
     */
    @Override
    public int insertOpInspectionPlan(OpInspectionTask opInspectionPlan) {
        return inspectionPlanMapper.insertOpInspectionPlan(opInspectionPlan);
    }

    /**
     * 修改巡检任务
     *
     * @param opInspectionPlan 巡检任务
     * @return 结果
     */
    @Override
    public int updateOpInspectionPlan(OpInspectionTask opInspectionPlan) {
        return inspectionPlanMapper.updateOpInspectionPlan(opInspectionPlan);
    }

    /**
     * 批量删除巡检任务
     *
     * @param ids 需要删除的巡检任务主键
     * @return 结果
     */
    @Override
    public int deleteOpInspectionPlanByIds(Long[] ids) {
        return inspectionPlanMapper.deleteOpInspectionPlanByIds(ids);
    }

    /**
     * 删除巡检任务信息
     *
     * @param id 巡检任务主键
     * @return 结果
     */
    @Override
    public int deleteOpInspectionPlanById(Long id) {
        return inspectionPlanMapper.deleteOpInspectionPlanById(id);
    }
}
