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_AuditRepository : BaseRepository<Rb_Workflow_Audit>
    {
        /// <summary>
        /// 获取审核条件下所有的审核人
        /// </summary>
        /// <param name="ConditionId"></param>
        /// <returns></returns>
        public List<Rb_Workflow_Audit_Extend> GetDefaultAudit(int ConditionId) {
            return Get<Rb_Workflow_Audit_Extend>($@"select * from Rb_Workflow_Audit where ConditionId={ConditionId}").ToList();
        }

        /// <summary>
        /// 获取模板下下所有的审核人
        /// </summary>
        /// <param name="TemplateId"></param>
        /// <returns></returns>
        public List<Rb_Workflow_Audit_Extend> GetAllAudit(int TemplateId)
        {
            return Get<Rb_Workflow_Audit_Extend>($@"select au.* from rb_workflow_condition c left join Rb_Workflow_Audit au on c.Id=au.ConditionId where c.TemplateId={TemplateId}").ToList();
        }
    }
}
