using Edu.Common.Enum.User;
using Edu.Model.Entity.User;
using Edu.Model.ViewModel.User;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Edu.Repository.User
{
    /// <summary>
    /// 流程节点指点成员拷贝信息表
    /// </summary>
    public partial class Rb_Workflow_AuditUserRelevanceRepository : BaseRepository<Rb_Workflow_AuditUserRelevance>
    {
        /// <summary>
        /// 根据拷贝审核节点id获取指定审核成员
        /// </summary>
        /// <param name="auditRelevanceId"></param>
        /// <returns></returns>
        public List<Rb_Workflow_AuditUserRelevance_Extend> GetAuditUserRelevanceByAuditRelevanceId(int auditRelevanceId)
        {
            return Get<Rb_Workflow_AuditUserRelevance_Extend>($"SELECT * from rb_workflow_audituserrelevance u where u.AuditRelevanceId ={auditRelevanceId}").ToList();
        }

        /// <summary>
        /// 获取指定审核成员
        /// </summary>
        /// <param name="Id"></param>
        /// <returns></returns>
        public List<Rb_Workflow_AuditUserRelevance_Extend> GetListForRelevanceId(int Id)
        {
            return Get<Rb_Workflow_AuditUserRelevance_Extend>($@"select au.*,e.EmName,e.EmAccount,e.EmLoginMobile from rb_workflow_audituserrelevance au left join rb_employee e on au.EmployeeId=e.EmployeeId where au.AuditRelevanceId={Id}").ToList();
        }
    }
}
