package com.qmth.sop.business.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.qmth.sop.business.bean.dto.DataPermissionDto;
import com.qmth.sop.business.bean.result.TBDelayWarnResult;
import com.qmth.sop.business.bean.result.WorkWarnResult;
import com.qmth.sop.business.entity.TBDelayWarn;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 延期预警跟进表 Mapper 接口.
 *
 * @author: shudonghui
 * @date: 2023-08-08 16:02:21
 * @version: 1.0
 * @email: shudonghui@qmth.com.cn
 * @Company: www.qmth.com.cn
 */
public interface TBDelayWarnMapper extends BaseMapper<TBDelayWarn> {

    /**
     * 查询列表
     *
     * @param iPage
     * @param type
     * @param status
     * @param serviceId
     * @param custom
     * @param fieldObjList
     * @param sopNo
     * @param startTime
     * @param endTime
     * @param id
     * @param dpr
     * @return
     */
    IPage<TBDelayWarnResult> query(IPage<Map> iPage, @Param("type") String type, @Param("status") String status, @Param("serviceId") Long serviceId, @Param("custom") String custom, @Param("fieldObjList") List<String> fieldObjList, @Param("sopNo") String sopNo, @Param("startTime") Long startTime, @Param("endTime") Long endTime, @Param("id") Long id, @Param("dpr") DataPermissionDto dpr);

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

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