using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Mall.Model.Entity.Education;
using Mall.Model.Extend.Education;
using VT.FW.DB.Dapper;

namespace Mall.Repository.Education
{

    /// <summary>
    /// 财务收据配置仓储层
    /// </summary>
    public class RB_Receipt_ConfigRepository : BaseRepository<RB_Receipt_Config>
    {
        /// <summary>
        /// 获取列表
        /// </summary>
        /// <param name="demodel"></param>
        /// <returns></returns>
        public List<RB_Receipt_Config_ViewModel> GetList(RB_Receipt_Config_ViewModel demodel)
        {
            string where = $@" 1=1 ";
            if (demodel.Group_Id > 0)
            {
                where += $@" and r.{nameof(RB_Receipt_Config_ViewModel.Group_Id)} ={demodel.Group_Id}";
            }

            string sql = $@" 
SELECT * From RB_Receipt_Config r
WHERE {where} 
ORDER BY r.Id DESC ";
            return Get<RB_Receipt_Config_ViewModel>(sql).ToList();
        }

    }
}
