using Edu.Model.Entity.Goods;
using Edu.Model.ViewModel.Goods;
using System.Collections.Generic;
using System.Linq;
namespace Edu.Repository.Goods
{
///
/// 教育商品仓储
///
public class RB_EduGoodsRepository : BaseRepository
{
///
/// 获取列表
///
///
///
public List GetList(RB_Goods_ViewModel demodel)
{
string where = $@" 1=1 and Status =0";
if (demodel.Group_Id > 0)
{
where += $@" and {nameof(RB_Goods_ViewModel.Group_Id)} ={demodel.Group_Id}";
}
if (demodel.MallBaseId > 0)
{
where += $@" and {nameof(RB_Goods_ViewModel.MallBaseId)} ={demodel.MallBaseId}";
}
if (demodel.GoodsType > 0)
{
where += $@" and {nameof(RB_Goods_ViewModel.GoodsType)} ={demodel.GoodsType}";
}
if (demodel.MallGoodsId > 0)
{
where += $@" and {nameof(RB_Goods_ViewModel.MallGoodsId)} ={demodel.MallGoodsId}";
}
if (!string.IsNullOrEmpty(demodel.GoodsIds))
{
where += $@" and {nameof(RB_Goods_ViewModel.Id)} in({demodel.GoodsIds})";
}
string sql = $@" select * from RB_Goods where {where} order by Id desc";
return Get(sql).ToList();
}
}
}