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_TravelRepository : BaseRepository<Rb_Workflow_Travel>
    {
        /// <summary>
        /// 获取出差下的所有行程
        /// </summary>
        /// <param name="EveId"></param>
        /// <returns></returns>
        public List<Rb_Workflow_Travel_Extend> GetTravelListForEvection(int EveId) {
            string where = $@" where 1=1 and {nameof(Rb_Workflow_Travel_Extend.EvectionId)}={EveId}";
            return Get<Rb_Workflow_Travel_Extend>($@" select * from Rb_Workflow_Travel {where} order by Sort asc").ToList();
        }

        /// <summary>
        /// 获取出差下的所有行程
        /// </summary>
        /// <param name="EveId"></param>
        /// <returns></returns>
        public List<Rb_Workflow_Travel> GetTravelList(int EveId)
        {
            string where = $@" where 1=1 and {nameof(Rb_Workflow_Travel_Extend.EvectionId)}={EveId}";
            return Get($@" select * from Rb_Workflow_Travel {where} order by Sort asc").ToList();
        }
    }
}
