Commit ae764314 authored by 吴春's avatar 吴春

提交代码

parent 81ae2c0d
using System;
using System.Collections.Generic;
using System.Text;
namespace Mall.Model.Entity.GuideCar
{
public class RB_GuideCar_Site
{
public int ID { get; set; }
/// <summary>
/// 商户id
/// </summary>
public int TenantId { get; set; }
/// <summary>
/// 小程序id
/// </summary>
public int MallBaseId { get; set; }
/// <summary>
/// 站点名称
/// </summary>
public string SiteName { get; set; }
public int Status { get; set; }
public DateTime CreateDate { get; set; }
public DateTime UpdateDate { get; set; }
public int RulesType { get; set; }
}
}
...@@ -17,7 +17,7 @@ namespace Mall.Model.Entity.BaseSetUp ...@@ -17,7 +17,7 @@ namespace Mall.Model.Entity.BaseSetUp
/// <summary> /// <summary>
/// 价格 /// 价格
/// </summary> /// </summary>
public int RulesPriceId { get; set; } public int SiteId { get; set; }
/// <summary> /// <summary>
/// 地区id /// 地区id
...@@ -38,7 +38,7 @@ namespace Mall.Model.Entity.BaseSetUp ...@@ -38,7 +38,7 @@ namespace Mall.Model.Entity.BaseSetUp
public int MallBaseId { get; set; } public int MallBaseId { get; set; }
public RulesTypeEnum RulesType { get; set; } public int RulesType { get; set; }
public int Status { get; set; } public int Status { get; set; }
......
...@@ -15,7 +15,7 @@ namespace Mall.Model.Extend.GuideCar ...@@ -15,7 +15,7 @@ namespace Mall.Model.Extend.GuideCar
/// </summary> /// </summary>
public string RegionName { get; set; } public string RegionName { get; set; }
public string PriceIds { get; set; } public string SiteIds { get; set; }
/// <summary> /// <summary>
......
using Mall.Model.Entity.GuideCar;
using System;
using System.Collections.Generic;
using System.Text;
namespace Mall.Model.Extend.GuideCar
{
/// <summary>
/// 司导站点扩展表
/// </summary>
public class RB_GuideCar_Site_Extend : RB_GuideCar_Site
{
/// <summary>
/// 地区列表
/// </summary>
public List<RB_GuideCar_SiteRegion_Extend> RegionList { get; set; }
/// <summary>
/// 规格的ids
/// </summary>
public string SiteIds { get; set; }
}
}
This diff is collapsed.
...@@ -44,13 +44,13 @@ LEFT JOIN {DestinationTableName} as c on b.ParentID = c.ID WHERE a.{nameof(RB_ ...@@ -44,13 +44,13 @@ LEFT JOIN {DestinationTableName} as c on b.ParentID = c.ID WHERE a.{nameof(RB_
{ {
builder.Append($" AND a.{nameof(RB_GuideCar_SiteRegion_Extend.MallBaseId)}={query.MallBaseId}"); builder.Append($" AND a.{nameof(RB_GuideCar_SiteRegion_Extend.MallBaseId)}={query.MallBaseId}");
} }
if (query.RulesPriceId > 0) if (query.SiteId > 0)
{ {
builder.Append($" AND a.{nameof(RB_GuideCar_SiteRegion_Extend.RulesPriceId)}={query.RulesPriceId}"); builder.Append($" AND a.{nameof(RB_GuideCar_SiteRegion_Extend.SiteId)}={query.SiteId}");
} }
if (!string.IsNullOrWhiteSpace(query.PriceIds)) if (!string.IsNullOrWhiteSpace(query.SiteIds))
{ {
builder.Append($" AND a.{nameof(RB_GuideCar_SiteRegion_Extend.RulesPriceId)} in ({query.PriceIds})"); builder.Append($" AND a.{nameof(RB_GuideCar_SiteRegion_Extend.SiteId)} in ({query.SiteIds})");
} }
} }
return Get<RB_GuideCar_SiteRegion_Extend>(builder.ToString()).ToList(); return Get<RB_GuideCar_SiteRegion_Extend>(builder.ToString()).ToList();
...@@ -80,13 +80,13 @@ LEFT JOIN {DestinationTableName} as c on b.ParentID = c.ID WHERE a.{nameof(RB_ ...@@ -80,13 +80,13 @@ LEFT JOIN {DestinationTableName} as c on b.ParentID = c.ID WHERE a.{nameof(RB_
{ {
builder.Append($" AND a.{nameof(RB_GuideCar_SiteRegion_Extend.MallBaseId)}={query.MallBaseId}"); builder.Append($" AND a.{nameof(RB_GuideCar_SiteRegion_Extend.MallBaseId)}={query.MallBaseId}");
} }
if (query.RulesPriceId > 0) if (query.SiteId > 0)
{ {
builder.Append($" AND a.{nameof(RB_GuideCar_SiteRegion_Extend.RulesPriceId)}={query.RulesPriceId}"); builder.Append($" AND a.{nameof(RB_GuideCar_SiteRegion_Extend.SiteId)}={query.SiteId}");
} }
if (!string.IsNullOrWhiteSpace(query.PriceIds)) if (!string.IsNullOrWhiteSpace(query.SiteIds))
{ {
builder.Append($" AND a.{nameof(RB_GuideCar_SiteRegion_Extend.RulesPriceId)} in ({query.PriceIds})"); builder.Append($" AND a.{nameof(RB_GuideCar_SiteRegion_Extend.SiteId)} in ({query.SiteIds})");
} }
} }
return Get<RB_GuideCar_SiteRegion_Extend>(builder.ToString()).ToList(); return Get<RB_GuideCar_SiteRegion_Extend>(builder.ToString()).ToList();
......
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_SiteRepository:BaseRepository<RB_GuideCar_Site>
{
/// <summary>
/// 表名称
/// </summary>
public string TableName { get { return nameof(RB_GuideCar_Site); } }
/// <summary>
/// 物料规则列表
/// </summary>
/// <param name="pageIndex">页码</param>
/// <param name="pageSize">每页显示条数</param>
/// <param name="rowCount">总条数</param>
/// <param name="query">查询条件</param>
/// <returns></returns>
public List<RB_GuideCar_Site_Extend> GetPageListRepository(int pageIndex, int pageSize, out long rowCount, RB_GuideCar_Site_Extend query)
{
StringBuilder builder = new StringBuilder();
builder.Append($" SELECT * FROM {TableName} WHERE {nameof(RB_GuideCar_Site_Extend.Status)}=0");
if (query != null)
{
// where += $@" and {nameof(RB_Customer_InfoCreate.CustomerId)}={dmodel.CustomerId}";
if (query.TenantId > 0)
{
builder.Append($" AND {nameof(RB_GuideCar_Site_Extend.TenantId)}={query.TenantId}");
}
if (query.TenantId > 0)
{
builder.Append($" AND {nameof(RB_GuideCar_Site_Extend.MallBaseId)}={query.MallBaseId}");
}
if (!string.IsNullOrWhiteSpace(query.SiteName))
{
builder.Append($" AND {nameof(RB_GuideCar_Site_Extend.SiteName)} like '%{query.SiteName}%'");
}
if (query.RulesType > 0)
{
builder.Append($" AND {nameof(RB_GuideCar_Site_Extend.RulesType)}={(int)query.RulesType}");
}
}
return GetPage<RB_GuideCar_Site_Extend>(pageIndex, pageSize, out rowCount, builder.ToString()).ToList();
}
/// <summary>
/// 物流规则列表
/// </summary>
/// <param name="pageIndex">页码</param>
/// <param name="pageSize">每页显示条数</param>
/// <param name="rowCount">总条数</param>
/// <param name="query">查询条件</param>
/// <returns></returns>
public List<RB_GuideCar_Site_Extend> GetLogisticsRulesList(RB_GuideCar_Site_Extend query)
{
StringBuilder builder = new StringBuilder();
builder.Append($" SELECT * FROM {TableName} WHERE {nameof(RB_GuideCar_Site_Extend.Status)}=0 ");
if (query != null)
{
if (query.ID > 0)
{
builder.Append($" AND {nameof(RB_GuideCar_Site_Extend.ID)}={query.ID}");
}
if (query.TenantId > 0)
{
builder.Append($" AND {nameof(RB_GuideCar_Site_Extend.TenantId)}={query.TenantId}");
}
if (query.MallBaseId > 0)
{
builder.Append($" AND {nameof(RB_GuideCar_Site_Extend.MallBaseId)}={query.MallBaseId}");
}
if (!string.IsNullOrWhiteSpace(query.SiteName))
{
builder.Append($" AND {nameof(RB_GuideCar_Site_Extend.SiteName)} like '%{query.SiteName}%'");
}
if (query.RulesType > 0)
{
builder.Append($" AND {nameof(RB_GuideCar_Site_Extend.RulesType)}={(int)query.RulesType}");
}
if (!string.IsNullOrEmpty(query.SiteIds))
{
builder.Append($" AND {nameof(RB_GuideCar_Site_Extend.ID)} in({query.SiteIds})");
}
}
return Get<RB_GuideCar_Site_Extend>(builder.ToString()).ToList();
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment