package com.lz.modules.flow.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.lz.common.utils.PageUtils;
import com.lz.modules.equipment.entity.model.BasePage;
import com.lz.modules.flow.entity.FlowRecord;
import com.lz.modules.performance.req.AssessTaskReq;
import com.lz.modules.sys.entity.app.ResultRecord;

import java.util.List;

/**
* <p>
* 流转记录表 服务类
* </p>
*
* @author quyixiao
* @since 2020-08-18
*/
public interface FlowRecordService extends IService<FlowRecord> {



	FlowRecord selectFlowRecordById(Long id);


	Long insertFlowRecord(FlowRecord flowRecord);


	int updateFlowRecordById(FlowRecord flowRecord);


	int updateCoverFlowRecordById(FlowRecord flowRecord);


	int deleteFlowRecordById(Long id);


    FlowRecord selectLastFlowRecordByRecordId(Long recordResultId);

    FlowRecord selectNotApprovalStaffIdFlowRecords(Long recordId);

    List<FlowRecord> selectFlowRecordByRecordId(Long recordId);

	void initFlowRecord(ResultRecord resultRecord , Long roleId , Integer type , String name);

	List<FlowRecord> selectFlowRecordByResultRecordIdFlowId(Long recordResultId);

	List<FlowRecord> selectFlowRecordByFlowId(Long recordId);

	FlowRecord selectLastFlowNoStatusRecordByRecordId(Long resultRecordId);

	List<FlowRecord> selectFlowRecordByResultRecordIdType(Long recordResultId, Integer type);

	List<FlowRecord> selectFlowRecordByResultRecordIdTypeStatus(Long recordResultId, Integer type, int status);

	Long copyFlowRecord(FlowRecord flowRecord);

	PageUtils selectTaskListByApprovalStaffId(AssessTaskReq req, Long approvalStaffId);

    void insertFlowRecords(List<FlowRecord> flowRecords);

	List<FlowRecord> selectFlowRecordByRecordIdStatus(Long resultRecordId,Integer status);

	FlowRecord selectFlowRecordByRecordIdAndFlowId(Long resultRecordId, Long id);

	List<FlowRecord> selectFlowRecordByRecordIdStatusFlowIndex(Long resultRecordId, int status, int flowIndex);


	FlowRecord selectPreFlowRecordByRecordIdMaxIdStatus(Long resultRecordId, Long id, int status);

	List<FlowRecord> selectFlowRecordByRecordIdFlowIndex(Long resultRecordId, Integer flowIndex);
}