using Mall.Model.Entity.BaseSetUp;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Mall.Repository.BaseSetUp
{
    public class RB_LogisticsRepository : RepositoryBase<RB_Logistics>
    {

        /// <summary>
        /// 表名称
        /// </summary>
        public string TableName { get { return nameof(RB_Logistics); } }
        /// <summary>
        /// 根据商户id获取物流信息
        /// </summary>
        /// <param name="query">查询条件</param>
        /// <returns></returns>
        public List<RB_Logistics> GetListRepository(RB_Logistics query)
        {
            StringBuilder builder = new StringBuilder();
            builder.Append($" SELECT * FROM {TableName} WHERE 1=1 ");
            if (query != null)
            {
                if (query.TenantId > 0)
                {
                    builder.Append($" AND TenantId={query.TenantId}");
                }
            }
            return Get<RB_Logistics>(builder.ToString()).ToList();
        }
    }
}
