using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Edu.Model.Entity.Mall;
using Edu.Model.ViewModel.Mall;
namespace Edu.Repository.Mall
{
///
/// 商品关联规格价格仓储层
///
public class RB_Goods_SpecificationPriceRepository : BaseRepository
{
///
/// 列表
///
/// 查询条件
///
public List GetList(RB_Goods_SpecificationPrice_Extend dmodel)
{
string where = $" 1=1 and {nameof(RB_Goods_SpecificationPrice.Status)}=0";
if (dmodel.TenantId > 0)
{
where += $@" and {nameof(RB_Goods_SpecificationPrice.TenantId)}={dmodel.TenantId}";
}
if (dmodel.MallBaseId > 0)
{
where += $@" and {nameof(RB_Goods_SpecificationPrice.MallBaseId)}={dmodel.MallBaseId}";
}
if (dmodel.Id > 0)
{
where += $@" and {nameof(RB_Goods_SpecificationPrice.Id)}={dmodel.Id}";
}
if (dmodel.GoodsId > 0)
{
where += $@" and {nameof(RB_Goods_SpecificationPrice.GoodsId)}={dmodel.GoodsId}";
}
if (!string.IsNullOrEmpty(dmodel.GoodsIds))
{
where += $@" and {nameof(RB_Goods_SpecificationPrice.GoodsId)} in({dmodel.GoodsIds})";
}
string sql = $@"select * from RB_Goods_SpecificationPrice where {where} order by Id desc";
return Get(sql).ToList();
}
}
}