package io.renren.modules.sys.dao;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import io.renren.modules.sys.entity.VisiWorkflowEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import io.renren.modules.sys.entity.algs.AlgTrain_Vo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 工作流
 *
 * @author Zhang
 * @version 3.0.0
 * @since JDK1.8
 */
@Mapper
public interface VisiWorkflowDao extends BaseMapper<VisiWorkflowEntity> {
    @Select("SELECT a.*, b.username FROM visi_workflow a LEFT JOIN sys_user b ON a.user_id = b.user_id ${ew.customSqlSegment}")
    List<VisiWorkflowEntity> getWorkflowInfo(@Param(Constants.WRAPPER) Wrapper wrapper);

    @Select("SELECT a.*, b.username FROM visi_workflow a sys_user b WHERE a.user_id = b.user_id and a.user_id = #{id,jdbcType=BIGINT}")
    List<VisiWorkflowEntity> getWorkflowInfoById(@Param("id") Long id);
}
