package com.qmth.sop.business.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.qmth.sop.business.bean.result.TBDelayWarnResult;
import com.qmth.sop.business.bean.result.WorkWarnResult;
import com.qmth.sop.business.entity.TBDelayWarn;
import com.qmth.sop.common.enums.DelayWarnStatusEnum;
import com.qmth.sop.common.enums.DelayWarnTypeEnum;
import com.qmth.sop.common.enums.WarnTypeEnum;

import java.util.Map;

/**
 * 延期预警跟进表 服务类
 *
 * @author: shudonghui
 * @date: 2023-08-08 16:02:21
 * @version: 1.0
 * @email: shudonghui@qmth.com.cn
 * @Company: www.qmth.com.cn
 */
public interface TBDelayWarnService extends IService<TBDelayWarn> {

    /**
     * 查询列表
     *
     * @param iPage
     * @param type
     * @param status
     * @param serviceId
     * @param custom
     * @param fieldObj
     * @param sopNo
     * @param startTime
     * @param endTime
     * @param id
     * @return
     */
    IPage<TBDelayWarnResult> query(IPage<Map> iPage, DelayWarnTypeEnum type, DelayWarnStatusEnum status, Long serviceId, String custom, String fieldObj, String sopNo, Long startTime, Long endTime, Long id);

    /**
     * 新增修改延期预警跟进表
     *
     * @param tBDelayWarn
     */
    Boolean saveTBDelayWarn(TBDelayWarn tBDelayWarn);


    /**
     * 删除延期预警跟进表
     *
     * @param id
     */
    Boolean delete(Long id);

    /**
     * 获取预警待办
     *
     * @param iPage
     * @param userId
     * @param type
     * @param serviceId
     * @param customName
     * @return
     */
    public IPage<WorkWarnResult> getWarnTaskList(IPage<Map> iPage, Long userId, WarnTypeEnum type, Long serviceId, String customName);

    /**
     * 获取预警待办计数
     *
     * @param userId
     * @param type
     * @param serviceId
     * @param customName
     * @return
     */
    public int getWarnTaskListCount(Long userId, WarnTypeEnum type, Long serviceId, String customName);

    TBDelayWarnResult get(long id);
}