package com.qmth.sop.business.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.qmth.sop.business.bean.dto.DataPermissionDto;
import com.qmth.sop.business.bean.result.analyze.sopWarn.CrmSupplierRelation;
import com.qmth.sop.business.bean.result.analyze.sopWarn.SopMonitor;
import com.qmth.sop.business.entity.TBService;
import com.qmth.sop.business.entity.TBSopInfo;
import org.apache.ibatis.annotations.Param;

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

/**
 * <p>
 * </p>
 *
 * @author dhshu
 *
 */
public interface SopAnalyseMapper extends BaseMapper<TBSopInfo> {


    List<TBService> list(@Param("startTime") Long startTime, @Param("endTime") Long endTime, @Param("dpr") DataPermissionDto dpr);

    List<Map<String, Object>> overview(@Param("serviceId") Long serviceId);

    List<Map<String, Object>> trend(@Param("serviceId") Long serviceId);

    List<Map<String, Object>> attendance(@Param("serviceId") Long serviceId);

    /**
     * 根据服务单元id查询sop监控数据集
     *
     * @param serviceId 服务单元id
     * @return 监控数据集
     */
    List<SopMonitor> findSopMonitorListByServiceId(@Param("serviceId") Long serviceId);

    /**
     * 根据服务单元查询 派单和供应商关系
     *
     * @param serviceId 服务单元id
     * @return 关系
     */
    List<CrmSupplierRelation> findCrmSupplierRelationByServiceId(@Param("serviceId") Long serviceId);
}
