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

namespace Edu.Repository.WeChat
{
    /// <summary>
    /// 企业配置仓储层
    /// </summary>
    public class RB_WeChat_ConfigRepository : BaseRepository<RB_WeChat_Config>
    {
        /// <summary>
        /// 获取列表
        /// </summary>
        /// <param name="demodel"></param>
        /// <returns></returns>
        public List<RB_WeChat_Config_ViewModel> GetList(RB_WeChat_Config_ViewModel demodel)
        {
            string where = $@" 1=1 ";
            if (demodel.Group_Id > 0)
            {
                where += $@" and r.{nameof(RB_WeChat_Config_ViewModel.Group_Id)} ={demodel.Group_Id}";
            }

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

    }
}
