using Edu.Common.Enum;
using Edu.Model.Entity.Course;
using Edu.Model.ViewModel.Course;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using VT.FW.DB.Dapper;

namespace Edu.Repository.Course
{
    /// <summary>
    /// 教育合同仓储层
    /// </summary>
    public class RB_Education_ContractAdjustRepository : BaseRepository<RB_Education_ContractAdjust>
    {

        /// <summary>
        /// 获取列表
        /// </summary>
        /// <param name="demodel"></param>
        /// <param name="orderIds"></param>
        /// <returns></returns>
        public List<RB_Education_ContractAdjust_ViewModel> GetList(RB_Education_ContractAdjust_ViewModel demodel)
        {            
            string where = $@" 1=1";
            if (demodel.Group_Id > 0)
            {
                where += $@" AND {nameof(RB_Education_ContractAdjust_ViewModel.Group_Id)} ={demodel.Group_Id}";
            }
            if (demodel.ContractId > 0)
            {
                where += $@" AND {nameof(RB_Education_ContractAdjust_ViewModel.ContractId)} ={demodel.ContractId}";
            }

            string sql = $@" SELECT * FROM RB_Education_ContractAdjust WHERE {where} ORDER BY Id DESC";
            return Get<RB_Education_ContractAdjust_ViewModel>(sql).ToList();
        }
    }
}
