package com.dayou.mapper;

import com.dayou.entity.WorkFlowNodeInstance;
import com.dayou.dao.CustomBaseMapper;
import com.dayou.enums.MainBusinessEnum;
import com.dayou.enums.workflow.WorkflowNodeEnum;
import com.dayou.vo.NightingaleEchartsVO;
import com.dayou.vo.WorkNodeInstanceVO;
import org.apache.ibatis.annotations.Param;

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

/**
 * <p>
 * 工作流节点实例 Mapper 接口
 * </p>
 *
 * @author wucl
 * @since 2023-10-17
 */
public interface WorkFlowNodeInstanceMapper extends CustomBaseMapper<WorkFlowNodeInstance> {

    WorkFlowNodeInstance getById(@Param("instanceNodeId") Long instanceNodeId);

    List<WorkNodeInstanceVO> getInstanceNodeFlow(@Param("mainBusiness") String mainBusiness,@Param("businessId")Long businessId,@Param("businessSubId")String businessSubId,@Param("businessMinId") String businessMinId);

    WorkNodeInstanceVO instanceCurrent(@Param("mainBusiness") String mainBusiness,@Param("businessId")Long businessId,@Param("businessSubId")String businessSubId,@Param("businessMinId") String businessMinId);

    WorkFlowNodeInstance getInstanceNodeInfoById(@Param("instanceNodeId") Long instanceNodeId);

    void batchCommitNode(@Param("currentNodeIds") List<Long> currentNodeIds);

    List<NightingaleEchartsVO> instanceNodeCountByCode(@Param("businessType") String businessType);

    List<String> checkIfReverse(@Param("productionType")String productionType, @Param("productionNo")String productionNo);

    Map<String, Object> getInOutInstanceNode(@Param("productionNo") String productionNo);

    Date getNodeFinishedTime(@Param("flowId")Long flowId, @Param("nodeId")Long nodeId, @Param("businessId")Long businessId, @Param("businessSubId")String businessSubId, @Param("businessMinId")String businessMinId,@Param("businessType") String businessType);

    Date getMajorProductionFinishedTime(@Param("businessId") Long businessId, @Param("nodeId") Long nodeId);
}
