using Mall.Model.Entity.Reserve;
using Mall.Model.Extend.Reserve;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Mall.Repository.Reserve
{
    public class RB_Reserve_BaseRepository : BaseRepository<RB_Reserve_Base>
    {
        /// <summary>
        /// 获取列表
        /// </summary>
        /// <param name="dmodel">查询条件</param>
        /// <returns></returns>
        public List<RB_Reserve_Base_Extend> GetList(RB_Reserve_Base_Extend dmodel)
        {
            string where = $" 1=1 ";
            if (dmodel.TenantId > 0)
            {
                where += $@" and {nameof(RB_Reserve_Base.TenantId)}={dmodel.TenantId}";
            }
            if (dmodel.MallBaseId > 0)
            {
                where += $@" and {nameof(RB_Reserve_Base.MallBaseId)}={dmodel.MallBaseId}";
            }

            string sql = $@"
select * from RB_Reserve_Base where {where}
";
            return Get<RB_Reserve_Base_Extend>(sql).ToList();
        }
    }
}
