using Edu.Model.Entity.Course;
using Edu.Model.ViewModel.Course;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Edu.Repository.Course
{
    /// <summary>
    /// 退款单据审核人员信息仓储层
    /// </summary>
    public class RB_Student_BackRelevanceRepository : BaseRepository<RB_Student_BackRelevance>
    {
        /// <summary>
        /// 获取学生退课审核列表
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        public List<RB_Student_BackRelevance_ViewModel> GetStudentBackRelevanceListRepository(RB_Student_BackRelevance_ViewModel query)
        {
            StringBuilder builder = new StringBuilder();
            builder.AppendFormat(@"
SELECT * 
FROM RB_Student_BackRelevance
WHERE 1=1
");
            if (query != null)
            {
                if (query.ConditionId > 0)
                {
                    builder.AppendFormat(" AND {0}={1} ", nameof(RB_Student_BackRelevance_ViewModel.ConditionId), query.ConditionId);
                }
            }
            builder.AppendFormat(" ORDER BY Sort ASC ");
            return Get<RB_Student_BackRelevance_ViewModel>(builder.ToString()).ToList();
        }
    }
}