package com.gyee.frame.service.ticket;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gyee.frame.model.ticket.Wfassignment;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.List;

/**
 * <p>
 * 服务类
 * </p>
 *
 * @author chenmh
 * @since 2020-07-21
 */
public interface WfassignmentService extends IService<Wfassignment> {

    /**
     * 分页
     *
     * @param labor
     * @param pageNum
     * @return
     */
    IPage<Wfassignment> selectPage(String labor, long pageNum);


    /**
     * 根据WFINSTID获取所有流程历史
     * <p>
     * WFINSTID 对应 WFINSTANCE表的id
     *
     * @param instanceId
     * @param ownerId
     * @return
     */
    List<Wfassignment> listAssignment(double instanceId, double ownerId);


    /**
     * 更新待办任务
     *
     * @param instId
     * @param version
     * @param ownerId
     * @param wfName
     * @param processor  当前处理任务的人
     * @return
     */
    Wfassignment updateAssignment(double instId, double version, double ownerId, String wfName, String processor);

    /**
     * 写入待办 返回 ID
     *
     * @param currNodeId
     * @param instId
     * @param version
     * @param ownerId
     * @param wfName
     * @param labors
     * @param role
     * @return
     */
    boolean insertAssignment(double currNodeId, double instId, double version, double ownerId, String wfName,
                                  String ticketNum, String starter, String tableName, String role, List<String> labors);

    /**
     * 查询所有活动记录
     *
     * @param instId
     * @param version
     * @param ownerId
     * @return
     */
    List<Wfassignment> getActiveItem(double instId, double version, double ownerId, String status);
}
