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
{
///
/// 投稿配置仓储层
///
public class RB_Contribute_ConfigRepository : BaseRepository
{
///
/// 获取列表
///
///
///
public List GetList(RB_Contribute_Config_ViewModel demodel)
{
string where = $@" 1=1 ";
if (demodel.Group_Id > 0)
{
where += $@" and r.{nameof(RB_Contribute_Config_ViewModel.Group_Id)} ={demodel.Group_Id}";
}
if (demodel.Type > 0)
{
where += $@" and r.{nameof(RB_Contribute_Config_ViewModel.Type)} ={(int)demodel.Type}";
}
if (demodel.Enable > 0)
{
where += $@" and r.{nameof(RB_Contribute_Config_ViewModel.Enable)} ={(int)demodel.Enable}";
}
string sql = $@"
SELECT * From RB_Contribute_Config r
WHERE {where}
ORDER BY r.Id DESC ";
return Get(sql).ToList();
}
}
}