package com.xinda.itsm.service.impl;

import java.util.List;
import com.xinda.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.xinda.itsm.mapper.InspectionPlanMapper;
import com.xinda.itsm.domain.InspectionPlan;
import com.xinda.itsm.service.IInspectionPlanService;

/**
 * 巡检计划Service业务层处理
 * 
 * @author kerwincui
 * @date 2025-04-23
 */
@Service
public class InspectionPlanServiceImpl implements IInspectionPlanService 
{
    @Autowired
    private InspectionPlanMapper inspectionPlanMapper;

    /**
     * 查询巡检计划
     * 
     * @param id 巡检计划主键
     * @return 巡检计划
     */
    @Override
    public InspectionPlan selectInspectionPlanById(Long id)
    {
        return inspectionPlanMapper.selectInspectionPlanById(id);
    }

    /**
     * 查询巡检计划列表
     * 
     * @param inspectionPlan 巡检计划
     * @return 巡检计划
     */
    @Override
    public List<InspectionPlan> selectInspectionPlanList(InspectionPlan inspectionPlan)
    {
        return inspectionPlanMapper.selectInspectionPlanList(inspectionPlan);
    }

    /**
     * 新增巡检计划
     * 
     * @param inspectionPlan 巡检计划
     * @return 结果
     */
    @Override
    public int insertInspectionPlan(InspectionPlan inspectionPlan)
    {
        inspectionPlan.setCreateTime(DateUtils.getNowDate());
        return inspectionPlanMapper.insertInspectionPlan(inspectionPlan);
    }

    /**
     * 修改巡检计划
     * 
     * @param inspectionPlan 巡检计划
     * @return 结果
     */
    @Override
    public int updateInspectionPlan(InspectionPlan inspectionPlan)
    {
        inspectionPlan.setUpdateTime(DateUtils.getNowDate());
        return inspectionPlanMapper.updateInspectionPlan(inspectionPlan);
    }

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

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