package com.foreverwin.mesnac.equip.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.foreverwin.mesnac.equip.model.ResourceInspectPlan;
import com.baomidou.mybatisplus.extension.service.IService;
import com.foreverwin.mesnac.equip.model.ResourceInspectTask;
import com.foreverwin.modular.core.util.FrontPage;

import java.util.List;

/**
 * <p>
 * 设备检验计划表 服务类
 * </p>
 *
 * @author pavel.Liu
 * @since 2021-06-10
 */
public interface ResourceInspectPlanService extends IService<ResourceInspectPlan> {

    /**
     *  分页查询
     * @param frontPage
     * @return
     */
    IPage<ResourceInspectPlan> selectPage(FrontPage<ResourceInspectPlan> frontPage, ResourceInspectPlan resourceInspectPlan);

    List<ResourceInspectPlan> selectList(ResourceInspectPlan resourceInspectPlan);

    Boolean saveResourcePlanData(ResourceInspectPlan resourceInspectPlan);

    ResourceInspectPlan getInspectPlanByHandle(ResourceInspectPlan resourceInspectPlan);

    /**
     * 根据计划HANDEL删除计划：
     *  1、主表删除
     *  2、从表，设备清单、用户组清单
     * @param resourceInspectPlan
     */
    void deleteInspectionPlanByHandle(ResourceInspectPlan resourceInspectPlan);

    void autoCreateTaskByResourceInspectPlan(ResourceInspectPlan resourceInspectPlan);

    /**
     * 取消或完成时，创建新的任务
     * @param resourceInspectTask
     */
    void autoCreateTaskByResourceInspectTask(ResourceInspectTask resourceInspectTask);

}