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

namespace Mall.Repository.GuideCar
{
   public class RB_GuideCar_BaseRepository : BaseRepository<RB_GuideCar_Base>
    {

        /// <summary>
        /// 获取列表
        /// </summary>
        /// <param name="dmodel">查询条件</param>
        /// <returns></returns>
        public List<RB_GuideCar_Base_Extend> GetList(RB_GuideCar_Base_Extend dmodel)
        {
            string where = $" 1=1 ";
            if (dmodel.TenantId > 0) 
            {
                where += $@" and {nameof(RB_GuideCar_Base.TenantId)}={dmodel.TenantId}";
            }
            if (dmodel.MallBaseId > 0)
            {
                where += $@" and {nameof(RB_GuideCar_Base.MallBaseId)}={dmodel.MallBaseId}";
            }

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