using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Mall.Model.Entity.Education;

namespace Mall.Repository.Education
{

    /// <summary>
    /// 财务配置
    /// </summary>
    public class RB_Finance_ConfigRepository : BaseRepository<RB_Finance_Config>
    {
        /// <summary>
        /// 获取列表
        /// </summary>
        /// <param name="demodel"></param>
        /// <returns></returns>
        public List<RB_Finance_Config> GetList(RB_Finance_Config demodel)
        {
            string where = $@" 1=1 and Status =0";

            if (demodel.Group_Id > 0)
            {
                where += $@" and {nameof(RB_Finance_Config.Group_Id)} ={demodel.Group_Id}";
            }
            if (demodel.Type > 0)
            {
                where += $@" and {nameof(RB_Finance_Config.Type)} ={(int)demodel.Type}";
            }

            string sql = $@" select * from RB_Finance_Config where {where} order by Id desc";
            return Get<RB_Finance_Config>(sql).ToList();
        }
    }
}
