Commit 57642925 authored by 吴春's avatar 吴春

提交物流规则

parent 51c9b061
using Mall.Common.Plugin;
using System;
using System.Collections.Generic;
using System.Text;
namespace Mall.Common.Enum.MallBase
{
public enum RulesTypeEnum
{
/// <summary>
/// 物流规则
/// </summary>
[EnumField("物流规则")]
Rule = 1,
/// <summary>
/// 包邮规则
/// </summary>
[EnumField("包邮规则")]
Pinkage = 2,
/// <summary>
/// 起送规则
/// </summary>
[EnumField("起送规则")]
OpenMinPrice = 3
}
}
using Mall.Common.AOP; using Mall.Common.AOP;
using Mall.Common.Enum.MallBase;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Text; using System.Text;
...@@ -10,7 +11,7 @@ namespace Mall.Model.Entity.BaseSetUp ...@@ -10,7 +11,7 @@ namespace Mall.Model.Entity.BaseSetUp
/// </summary> /// </summary>
[Serializable] [Serializable]
[DB(ConnectionName = "DefaultConnection")] [DB(ConnectionName = "DefaultConnection")]
public class RB_LogisticsRules public class RB_Logistics_Rules
{ {
public int ID { get; set; } public int ID { get; set; }
...@@ -44,6 +45,24 @@ namespace Mall.Model.Entity.BaseSetUp ...@@ -44,6 +45,24 @@ namespace Mall.Model.Entity.BaseSetUp
public DateTime CreateDate { get; set; } public DateTime CreateDate { get; set; }
public DateTime UpdateDate { get; set; } public DateTime UpdateDate { get; set; }
public DateTime DeletedDate { get; set; } public RulesTypeEnum RulesType { get; set; }
/// <summary>
/// 是否开启起送规则
/// </summary>
public int IsOpenMinPrice { get; set; }
/// <summary>
/// 起送价格
/// </summary>
public int IsOpenAllRegionPrice { get; set; }
/// <summary>
/// 全地区起送金额
/// </summary>
public int AllRegionPrice { get; set; }
} }
} }
using Mall.Common.AOP; using Mall.Common.AOP;
using Mall.Common.Enum.MallBase;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Text; using System.Text;
...@@ -10,7 +11,7 @@ namespace Mall.Model.Entity.BaseSetUp ...@@ -10,7 +11,7 @@ namespace Mall.Model.Entity.BaseSetUp
/// </summary> /// </summary>
[Serializable] [Serializable]
[DB(ConnectionName = "DefaultConnection")] [DB(ConnectionName = "DefaultConnection")]
public class RB_LogisticsRulesPrice public class RB_Logistics_RulesPrice
{ {
public int ID { get; set; } public int ID { get; set; }
...@@ -58,6 +59,5 @@ namespace Mall.Model.Entity.BaseSetUp ...@@ -58,6 +59,5 @@ namespace Mall.Model.Entity.BaseSetUp
public DateTime CreateDate { get; set; } public DateTime CreateDate { get; set; }
public DateTime UpdateDate { get; set; } public DateTime UpdateDate { get; set; }
public DateTime DeletedDate { get; set; }
} }
} }
using Mall.Common.AOP; using Mall.Common.AOP;
using Mall.Common.Enum.MallBase;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Text; using System.Text;
...@@ -10,7 +11,7 @@ namespace Mall.Model.Entity.BaseSetUp ...@@ -10,7 +11,7 @@ namespace Mall.Model.Entity.BaseSetUp
/// </summary> /// </summary>
[Serializable] [Serializable]
[DB(ConnectionName = "DefaultConnection")] [DB(ConnectionName = "DefaultConnection")]
public class RB_LogisticsRulesRegion public class RB_Logistics_RulesRegion
{ {
/// <summary> /// <summary>
...@@ -37,11 +38,11 @@ namespace Mall.Model.Entity.BaseSetUp ...@@ -37,11 +38,11 @@ namespace Mall.Model.Entity.BaseSetUp
public int MallBaseId { get; set; } public int MallBaseId { get; set; }
public RulesTypeEnum RulesType { get; set; }
public int Status { get; set; } public int Status { get; set; }
public DateTime CreateDate { get; set; } public DateTime CreateDate { get; set; }
public DateTime UpdateDate { get; set; } public DateTime UpdateDate { get; set; }
public DateTime DeletedDate { get; set; }
} }
} }
...@@ -16,10 +16,9 @@ namespace Mall.Model.Entity.BaseSetUp ...@@ -16,10 +16,9 @@ namespace Mall.Model.Entity.BaseSetUp
/// 编号 /// 编号
/// </summary> /// </summary>
public int ID { get; set; } public int ID { get; set; }
/// <summary>
/// 商城名称 public int MallBaseId { get; set; }
/// </summary>
public string MallName { get; set; }
/// <summary> /// <summary>
/// 联系号码 /// 联系号码
/// </summary> /// </summary>
...@@ -227,6 +226,101 @@ namespace Mall.Model.Entity.BaseSetUp ...@@ -227,6 +226,101 @@ namespace Mall.Model.Entity.BaseSetUp
/// </summary> /// </summary>
public int SuspendBtn { get; set; } public int SuspendBtn { get; set; }
/// <summary>
/// 1-展开收起,2-固定展开
/// </summary>
public int SuspendStyle { get; set; }
/// <summary>
/// 展开图标
/// </summary>
public string UnfoldIco { get; set; }
/// <summary>
/// 收起图标
/// </summary>
public string PackUpIco { get; set; }
/// <summary>
/// 在线客服开关,0-否,1-是
/// </summary>
public int OnlineService { get; set; }
/// <summary>
/// 在线客服图标
/// </summary>
public string OnlineServiceIco { get; set; }
/// <summary>
/// 返回首页导航开关,0-否,1-是
/// </summary>
public int BackTopNavigation { get; set; }
/// <summary>
/// 返回首页导航图标
/// </summary>
public string BackTopNavigationIco { get; set; }
/// <summary>
/// 一键拨号开关
/// </summary>
public int OneCall { get; set; }
/// <summary>
/// 一键拨号开关图标
/// </summary>
public string OneCallIco { get; set; }
/// <summary>
/// 客服外链开关
/// </summary>
public int ServiceOutLink { get; set; }
/// <summary>
/// 客服外链图标
/// </summary>
public string ServiceOutLinkIco { get; set; }
/// <summary>
/// 快捷导航开关
/// </summary>
public int ShortcutNavigation { get; set; }
/// <summary>
/// 快捷导航图标
/// </summary>
public string ShortcutNavigationIco { get; set; }
/// <summary>
/// 跳转小程序开关
/// </summary>
public int TurnMini { get; set; }
/// <summary>
/// 跳转小程序图标
/// </summary>
public string TurnMiniIco { get; set; }
/// <summary>
/// 自定义按钮
/// </summary>
public int Custom { get; set; }
/// <summary>
/// 跳转链接
/// </summary>
public string TurnLink { get; set; }
/// <summary>
/// 图标
/// </summary>
public int TurnIco { get; set; }
/// <summary> /// <summary>
/// 启用回到顶部悬浮按钮 /// 启用回到顶部悬浮按钮
/// </summary> /// </summary>
...@@ -261,14 +355,5 @@ namespace Mall.Model.Entity.BaseSetUp ...@@ -261,14 +355,5 @@ namespace Mall.Model.Entity.BaseSetUp
/// </summary> /// </summary>
public int TenantId { get; set; } public int TenantId { get; set; }
/// <summary>
/// 有效期
/// </summary>
public DateTime? Indate { get; set; }
/// <summary>
/// 1-正常,2-禁用
/// </summary>
public int MallBaseState { get; set; }
} }
} }
...@@ -8,12 +8,12 @@ namespace Mall.Model.Extend.BaseSetUp ...@@ -8,12 +8,12 @@ namespace Mall.Model.Extend.BaseSetUp
{ {
/// <summary> /// <summary>
/// 运费规则 /// 包邮规则
/// </summary> /// </summary>
[Serializable] [Serializable]
[DB(ConnectionName = "DefaultConnection")] [DB(ConnectionName = "DefaultConnection")]
public class RB_LogisticsRules_Extend : RB_LogisticsRules public class RB_Logistics_Pinkage_Extend : RB_Logistics_Pinkage
{ {
public List<RB_LogisticsRulesPrice_Extend> Detail { get; set; } public List<RB_Logistics_RulesRegion_Extend> List { get; set; }
} }
} }
...@@ -11,8 +11,8 @@ namespace Mall.Model.Extend.BaseSetUp ...@@ -11,8 +11,8 @@ namespace Mall.Model.Extend.BaseSetUp
/// </summary> /// </summary>
[Serializable] [Serializable]
[DB(ConnectionName = "DefaultConnection")] [DB(ConnectionName = "DefaultConnection")]
public class RB_LogisticsRulesPrice_Extend : RB_LogisticsRulesPrice public class RB_Logistics_RulesPrice_Extend : RB_Logistics_RulesPrice
{ {
public List<RB_LogisticsRulesRegion_Extend> List { get; set; } public List<RB_Logistics_RulesRegion_Extend> List { get; set; }
} }
} }
...@@ -11,7 +11,7 @@ namespace Mall.Model.Extend.BaseSetUp ...@@ -11,7 +11,7 @@ namespace Mall.Model.Extend.BaseSetUp
/// </summary> /// </summary>
[Serializable] [Serializable]
[DB(ConnectionName = "DefaultConnection")] [DB(ConnectionName = "DefaultConnection")]
public class RB_LogisticsRulesRegion_Extend : RB_LogisticsRulesRegion public class RB_Logistics_RulesRegion_Extend : RB_Logistics_RulesRegion
{ {
/// <summary> /// <summary>
/// 地区名字 /// 地区名字
......
using Mall.Common.AOP;
using Mall.Model.Entity.BaseSetUp;
using System;
using System.Collections.Generic;
using System.Text;
namespace Mall.Model.Extend.BaseSetUp
{
/// <summary>
/// 运费规则
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_Logistics_Rules_Extend : RB_Logistics_Rules
{
public List<RB_Logistics_RulesPrice_Extend> Detail { get; set; }
public List<RB_Logistics_RulesRegion_Extend> List { get; set; }
}
}
...@@ -13,6 +13,9 @@ namespace Mall.Model.Extend.BaseSetUp ...@@ -13,6 +13,9 @@ namespace Mall.Model.Extend.BaseSetUp
[DB(ConnectionName = "DefaultConnection")] [DB(ConnectionName = "DefaultConnection")]
public class RB_MallBase_Extend : RB_MallBase public class RB_MallBase_Extend : RB_MallBase
{ {
/// <summary>
/// 商城名称
/// </summary>
public string MallName { get; set; }
} }
} }
...@@ -4,6 +4,10 @@ ...@@ -4,6 +4,10 @@
<TargetFramework>netcoreapp3.0</TargetFramework> <TargetFramework>netcoreapp3.0</TargetFramework>
</PropertyGroup> </PropertyGroup>
<ItemGroup>
<Compile Remove="Extend\BaseSetUp\RB_Logistics_Pinkage_Extend.cs" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<Folder Include="CacheEntity\" /> <Folder Include="CacheEntity\" />
</ItemGroup> </ItemGroup>
......
This diff is collapsed.
using Mall.Model.Entity.BaseSetUp;
using Mall.Model.Extend.BaseSetUp;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Mall.Repository.BaseSetUp
{
public class RB_Logistics_PinkageRepository : RepositoryBase<RB_Logistics_Pinkage>
{
/// <summary>
/// 表名称
/// </summary>
public string TableName { get { return nameof(RB_Logistics_Pinkage); } }
/// <summary>
/// 物料规则列表
/// </summary>
/// <param name="pageIndex">页码</param>
/// <param name="pageSize">每页显示条数</param>
/// <param name="rowCount">总条数</param>
/// <param name="query">查询条件</param>
/// <returns></returns>
public List<RB_Logistics_Pinkage_Extend> GetPageListRepository(int pageIndex, int pageSize, out long rowCount, RB_Logistics_Pinkage_Extend query)
{
StringBuilder builder = new StringBuilder();
builder.Append($" SELECT * FROM {TableName} WHERE {nameof(RB_Logistics_Pinkage_Extend.Status)}=0");
if (query != null)
{
if (query.TenantId > 0)
{
builder.Append($" AND {nameof(RB_Logistics_Pinkage_Extend.TenantId)}={query.TenantId}");
}
if (query.TenantId > 0)
{
builder.Append($" AND {nameof(RB_Logistics_Pinkage_Extend.MallBaseId)}={query.MallBaseId}");
}
if (!string.IsNullOrWhiteSpace(query.Name))
{
builder.Append($" AND {nameof(RB_Logistics_Pinkage_Extend.Name)} like '%{query.Name}%'");
}
}
return GetPage<RB_Logistics_Pinkage_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_Logistics_Pinkage_Extend> GetLogisticsRulesList(RB_Logistics_Pinkage_Extend query)
{
StringBuilder builder = new StringBuilder();
builder.Append($" SELECT * FROM {TableName} WHERE {nameof(RB_Logistics_Pinkage_Extend.Status)}=0 ");
if (query != null)
{
if (query.ID > 0)
{
builder.Append($" AND {nameof(RB_Logistics_Pinkage_Extend.ID)}={query.ID}");
}
if (query.TenantId > 0)
{
builder.Append($" AND {nameof(RB_Logistics_Pinkage_Extend.TenantId)}={query.TenantId}");
}
if (query.TenantId > 0)
{
builder.Append($" AND {nameof(RB_Logistics_Pinkage_Extend.MallBaseId)}={query.MallBaseId}");
}
if (!string.IsNullOrWhiteSpace(query.Name))
{
builder.Append($" AND {nameof(RB_Logistics_Pinkage_Extend.Name)} like '%{query.Name}%'");
}
}
return Get<RB_Logistics_Pinkage_Extend>(builder.ToString()).ToList();
}
}
}
...@@ -7,38 +7,39 @@ using System.Text; ...@@ -7,38 +7,39 @@ using System.Text;
namespace Mall.Repository.BaseSetUp namespace Mall.Repository.BaseSetUp
{ {
public class RB_LogisticsRulesPriceRepository:RepositoryBase<RB_LogisticsRulesPrice> public class RB_Logistics_RulesPriceRepository:RepositoryBase<RB_Logistics_RulesPrice>
{ {
/// <summary> /// <summary>
/// 表名称 /// 表名称
/// </summary> /// </summary>
public string TableName { get { return nameof(RB_LogisticsRulesPrice); } } public string TableName { get { return nameof(RB_Logistics_RulesPrice); } }
/// <summary> /// <summary>
/// 获取小程序列表 /// 获取小程序列表
/// </summary> /// </summary>
/// <param name="query">查询条件</param> /// <param name="query">查询条件</param>
/// <returns></returns> /// <returns></returns>
public List<RB_LogisticsRulesPrice_Extend> GetListRepository(RB_LogisticsRulesPrice_Extend query) public List<RB_Logistics_RulesPrice_Extend> GetListRepository(RB_Logistics_RulesPrice_Extend query)
{ {
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
builder.Append($" SELECT * FROM {TableName} WHERE 1=1 "); builder.Append($" SELECT * FROM {TableName} WHERE {nameof(RB_Logistics_RulesPrice_Extend.Status)}=0");
if (query != null) if (query != null)
{ {
if (query.TenantId > 0) if (query.TenantId > 0)
{ {
builder.Append($" AND {nameof(RB_LogisticsRulesPrice_Extend.TenantId)}={query.TenantId}"); builder.Append($" AND {nameof(RB_Logistics_RulesPrice_Extend.TenantId)}={query.TenantId}");
} }
if (query.TenantId > 0) if (query.TenantId > 0)
{ {
builder.Append($" AND {nameof(RB_LogisticsRulesPrice_Extend.MallBaseId)}={query.MallBaseId}"); builder.Append($" AND {nameof(RB_Logistics_RulesPrice_Extend.MallBaseId)}={query.MallBaseId}");
} }
if (query.RulesId > 0) if (query.RulesId > 0)
{ {
builder.Append($" AND {nameof(RB_LogisticsRulesPrice_Extend.RulesId)}={query.RulesId}"); builder.Append($" AND {nameof(RB_Logistics_RulesPrice_Extend.RulesId)}={query.RulesId}");
} }
} }
return Get<RB_LogisticsRulesPrice_Extend>(builder.ToString()).ToList(); return Get<RB_Logistics_RulesPrice_Extend>(builder.ToString()).ToList();
} }
} }
} }
...@@ -7,12 +7,12 @@ using System.Text; ...@@ -7,12 +7,12 @@ using System.Text;
namespace Mall.Repository.BaseSetUp namespace Mall.Repository.BaseSetUp
{ {
public class RB_LogisticsRulesRegionRepository : RepositoryBase<RB_LogisticsRulesRegion> public class RB_Logistics_RulesRegionRepository : RepositoryBase<RB_Logistics_RulesRegion>
{ {
// <summary> // <summary>
/// 表名称 /// 表名称
/// </summary> /// </summary>
public string TableName { get { return nameof(RB_LogisticsRulesRegion); } } public string TableName { get { return nameof(RB_Logistics_RulesRegion); } }
// <summary> // <summary>
/// 表名称 /// 表名称
...@@ -20,34 +20,41 @@ namespace Mall.Repository.BaseSetUp ...@@ -20,34 +20,41 @@ namespace Mall.Repository.BaseSetUp
public string DestinationTableName { get { return nameof(RB_Destination); } } public string DestinationTableName { get { return nameof(RB_Destination); } }
/// <summary> /// <summary>
/// 获取小程序列表 /// 获取物流地区列表
/// </summary> /// </summary>
/// <param name="query">查询条件</param> /// <param name="query">查询条件</param>
/// <returns></returns> /// <returns></returns>
public List<RB_LogisticsRulesRegion_Extend> GetListRepository(RB_LogisticsRulesRegion_Extend query) public List<RB_Logistics_RulesRegion_Extend> GetListRepository(RB_Logistics_RulesRegion_Extend query)
{ {
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
builder.Append($" SELECT a.*,b.`Name` as RegionName FROM {TableName} as a LEFT JOIN {DestinationTableName} as b on a.RegionId=b.ID WHERE 1=1 "); builder.Append($" SELECT a.*,b.`Name` as RegionName FROM {TableName} as a LEFT JOIN {DestinationTableName} as b on a.RegionId=b.ID WHERE a.{nameof(RB_Logistics_RulesRegion_Extend.Status)}=0");
if (query != null) if (query != null)
{ {
if (query.TenantId > 0) if (query.TenantId > 0)
{ {
builder.Append($" AND a.{nameof(RB_LogisticsRulesRegion_Extend.TenantId)}={query.TenantId}"); builder.Append($" AND a.{nameof(RB_Logistics_RulesRegion_Extend.TenantId)}={query.TenantId}");
}
if (query.RulesType > 0)
{
builder.Append($" AND a.{nameof(RB_Logistics_RulesRegion_Extend.RulesType)}={(int)query.RulesType}");
} }
if (query.TenantId > 0) if (query.TenantId > 0)
{ {
builder.Append($" AND a.{nameof(RB_LogisticsRulesRegion_Extend.MallBaseId)}={query.MallBaseId}"); builder.Append($" AND a.{nameof(RB_Logistics_RulesRegion_Extend.MallBaseId)}={query.MallBaseId}");
} }
if (query.RulesPriceId > 0) if (query.RulesPriceId > 0)
{ {
builder.Append($" AND a.{nameof(RB_LogisticsRulesRegion_Extend.RulesPriceId)}={query.RulesPriceId}"); builder.Append($" AND a.{nameof(RB_Logistics_RulesRegion_Extend.RulesPriceId)}={query.RulesPriceId}");
} }
if (!string.IsNullOrWhiteSpace(query.PriceIds)) if (!string.IsNullOrWhiteSpace(query.PriceIds))
{ {
builder.Append($" AND a.{nameof(RB_LogisticsRulesRegion_Extend.RulesPriceId)} in ({query.PriceIds})"); builder.Append($" AND a.{nameof(RB_Logistics_RulesRegion_Extend.RulesPriceId)} in ({query.PriceIds})");
} }
} }
return Get<RB_LogisticsRulesRegion_Extend>(builder.ToString()).ToList(); return Get<RB_Logistics_RulesRegion_Extend>(builder.ToString()).ToList();
} }
} }
} }
...@@ -7,12 +7,12 @@ using System.Text; ...@@ -7,12 +7,12 @@ using System.Text;
namespace Mall.Repository.BaseSetUp namespace Mall.Repository.BaseSetUp
{ {
public class RB_LogisticsRulesRepository : RepositoryBase<RB_LogisticsRules> public class RB_Logistics_RulesRepository : RepositoryBase<RB_Logistics_Rules>
{ {
/// <summary> /// <summary>
/// 表名称 /// 表名称
/// </summary> /// </summary>
public string TableName { get { return nameof(RB_LogisticsRules); } } public string TableName { get { return nameof(RB_Logistics_Rules); } }
/// <summary> /// <summary>
/// 物料规则列表 /// 物料规则列表
/// </summary> /// </summary>
...@@ -21,27 +21,31 @@ namespace Mall.Repository.BaseSetUp ...@@ -21,27 +21,31 @@ namespace Mall.Repository.BaseSetUp
/// <param name="rowCount">总条数</param> /// <param name="rowCount">总条数</param>
/// <param name="query">查询条件</param> /// <param name="query">查询条件</param>
/// <returns></returns> /// <returns></returns>
public List<RB_LogisticsRules_Extend> GetPageListRepository(int pageIndex, int pageSize, out long rowCount, RB_LogisticsRules_Extend query) public List<RB_Logistics_Rules_Extend> GetPageListRepository(int pageIndex, int pageSize, out long rowCount, RB_Logistics_Rules_Extend query)
{ {
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
builder.Append($" SELECT * FROM {TableName} WHERE 1=1 "); builder.Append($" SELECT * FROM {TableName} WHERE {nameof(RB_Logistics_Rules_Extend.Status)}=0");
if (query != null) if (query != null)
{ {
// where += $@" and {nameof(RB_Customer_InfoCreate.CustomerId)}={dmodel.CustomerId}"; // where += $@" and {nameof(RB_Customer_InfoCreate.CustomerId)}={dmodel.CustomerId}";
if (query.TenantId > 0) if (query.TenantId > 0)
{ {
builder.Append($" AND {nameof(RB_LogisticsRules_Extend.TenantId)}={query.TenantId}"); builder.Append($" AND {nameof(RB_Logistics_Rules_Extend.TenantId)}={query.TenantId}");
} }
if (query.TenantId > 0) if (query.TenantId > 0)
{ {
builder.Append($" AND {nameof(RB_LogisticsRules_Extend.MallBaseId)}={query.MallBaseId}"); builder.Append($" AND {nameof(RB_Logistics_Rules_Extend.MallBaseId)}={query.MallBaseId}");
} }
if (!string.IsNullOrWhiteSpace(query.RulesName)) if (!string.IsNullOrWhiteSpace(query.RulesName))
{ {
builder.Append($" AND {nameof(RB_LogisticsRules_Extend.RulesName)} like '%{query.RulesName}%'"); builder.Append($" AND {nameof(RB_Logistics_Rules_Extend.RulesName)} like '%{query.RulesName}%'");
}
if (query.RulesType > 0)
{
builder.Append($" AND a.{nameof(RB_Logistics_Rules_Extend.RulesType)}={(int)query.RulesType}");
} }
} }
return GetPage<RB_LogisticsRules_Extend>(pageIndex, pageSize, out rowCount, builder.ToString()).ToList(); return GetPage<RB_Logistics_Rules_Extend>(pageIndex, pageSize, out rowCount, builder.ToString()).ToList();
} }
...@@ -53,30 +57,34 @@ namespace Mall.Repository.BaseSetUp ...@@ -53,30 +57,34 @@ namespace Mall.Repository.BaseSetUp
/// <param name="rowCount">总条数</param> /// <param name="rowCount">总条数</param>
/// <param name="query">查询条件</param> /// <param name="query">查询条件</param>
/// <returns></returns> /// <returns></returns>
public List<RB_LogisticsRules_Extend> GetLogisticsRulesList( RB_LogisticsRules_Extend query) public List<RB_Logistics_Rules_Extend> GetLogisticsRulesList( RB_Logistics_Rules_Extend query)
{ {
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
builder.Append($" SELECT * FROM {TableName} WHERE 1=1 "); builder.Append($" SELECT * FROM {TableName} WHERE {nameof(RB_Logistics_Rules_Extend.Status)}=0 ");
if (query != null) if (query != null)
{ {
if (query.ID > 0) if (query.ID > 0)
{ {
builder.Append($" AND {nameof(RB_LogisticsRules_Extend.ID)}={query.ID}"); builder.Append($" AND {nameof(RB_Logistics_Rules_Extend.ID)}={query.ID}");
} }
if (query.TenantId > 0) if (query.TenantId > 0)
{ {
builder.Append($" AND {nameof(RB_LogisticsRules_Extend.TenantId)}={query.TenantId}"); builder.Append($" AND {nameof(RB_Logistics_Rules_Extend.TenantId)}={query.TenantId}");
} }
if (query.TenantId > 0) if (query.TenantId > 0)
{ {
builder.Append($" AND {nameof(RB_LogisticsRules_Extend.MallBaseId)}={query.MallBaseId}"); builder.Append($" AND {nameof(RB_Logistics_Rules_Extend.MallBaseId)}={query.MallBaseId}");
} }
if (!string.IsNullOrWhiteSpace(query.RulesName)) if (!string.IsNullOrWhiteSpace(query.RulesName))
{ {
builder.Append($" AND {nameof(RB_LogisticsRules_Extend.RulesName)} like '%{query.RulesName}%'"); builder.Append($" AND {nameof(RB_Logistics_Rules_Extend.RulesName)} like '%{query.RulesName}%'");
}
if (query.RulesType > 0)
{
builder.Append($" AND a.{nameof(RB_Logistics_Rules_Extend.RulesType)}={(int)query.RulesType}");
} }
} }
return Get<RB_LogisticsRules_Extend>(builder.ToString()).ToList(); return Get<RB_Logistics_Rules_Extend>(builder.ToString()).ToList();
} }
} }
} }
using Mall.Model.Entity.BaseSetUp; using Mall.Model.Entity.BaseSetUp;
using Mall.Model.Entity.User;
using Mall.Model.Extend.BaseSetUp; using Mall.Model.Extend.BaseSetUp;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
...@@ -13,6 +14,11 @@ namespace Mall.Repository.BaseSetUp ...@@ -13,6 +14,11 @@ namespace Mall.Repository.BaseSetUp
/// 表名称 /// 表名称
/// </summary> /// </summary>
public string TableName { get { return nameof(RB_MallBase); } } public string TableName { get { return nameof(RB_MallBase); } }
/// <summary>
/// 表名称
/// </summary>
public string MinTableName { get { return nameof(RB_MiniProgram); } }
/// <summary> /// <summary>
/// 获取小程序列表 /// 获取小程序列表
/// </summary> /// </summary>
...@@ -27,10 +33,14 @@ namespace Mall.Repository.BaseSetUp ...@@ -27,10 +33,14 @@ namespace Mall.Repository.BaseSetUp
builder.Append($" SELECT * FROM {TableName} WHERE 1=1 "); builder.Append($" SELECT * FROM {TableName} WHERE 1=1 ");
if (query != null) if (query != null)
{ {
// where += $@" and {nameof(RB_Customer_InfoCreate.CustomerId)}={dmodel.CustomerId}"; // where += $@" and ={dmodel.CustomerId}";
if (query.TenantId > 0) if (query.TenantId > 0)
{ {
builder.Append($" AND TenantId={query.TenantId}"); builder.Append($" AND {nameof(RB_MallBase_Extend.TenantId)}={query.TenantId}");
}
if (query.MallBaseId > 0)
{
builder.Append($" AND {nameof(RB_MallBase_Extend.MallBaseId)}={query.MallBaseId}");
} }
} }
return GetPage<RB_MallBase_Extend>(pageIndex, pageSize, out rowCount, builder.ToString()).ToList(); return GetPage<RB_MallBase_Extend>(pageIndex, pageSize, out rowCount, builder.ToString()).ToList();
...@@ -44,12 +54,16 @@ namespace Mall.Repository.BaseSetUp ...@@ -44,12 +54,16 @@ namespace Mall.Repository.BaseSetUp
public List<RB_MallBase_Extend> GetListRepository(RB_MallBase_Extend query) public List<RB_MallBase_Extend> GetListRepository(RB_MallBase_Extend query)
{ {
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
builder.Append($" SELECT * FROM {TableName} WHERE 1=1 "); builder.Append($" SELECT a.*,b.MallName FROM {TableName} as a LEFT join {MinTableName} as b on a.MallBaseId=b.MallBaseId WHERE 1=1 ");
if (query != null) if (query != null)
{ {
if (query.TenantId > 0) if (query.TenantId > 0)
{ {
builder.Append($" AND TenantId={query.TenantId}"); builder.Append($" AND {nameof(RB_MallBase_Extend.TenantId)}={query.TenantId}");
}
if (query.MallBaseId > 0)
{
builder.Append($" AND {nameof(RB_MallBase_Extend.MallBaseId)}={query.MallBaseId}");
} }
} }
return Get<RB_MallBase_Extend>( builder.ToString()).ToList(); return Get<RB_MallBase_Extend>( builder.ToString()).ToList();
......
...@@ -4,6 +4,10 @@ ...@@ -4,6 +4,10 @@
<TargetFramework>netcoreapp3.0</TargetFramework> <TargetFramework>netcoreapp3.0</TargetFramework>
</PropertyGroup> </PropertyGroup>
<ItemGroup>
<Compile Remove="BaseSetUp\RB_Logistics_PinkageRepository.cs" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.AspNetCore" Version="2.2.0" /> <PackageReference Include="Microsoft.AspNetCore" Version="2.2.0" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="3.0.1" /> <PackageReference Include="Microsoft.Extensions.Configuration" Version="3.0.1" />
......
...@@ -31,7 +31,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Mall.Repository", "Mall.Rep ...@@ -31,7 +31,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Mall.Repository", "Mall.Rep
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Mall.Module.User", "Mall.Module.User\Mall.Module.User.csproj", "{E56423C0-5AC2-48D8-88BE-5435EF6ADB3F}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Mall.Module.User", "Mall.Module.User\Mall.Module.User.csproj", "{E56423C0-5AC2-48D8-88BE-5435EF6ADB3F}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mall.Module.BaseSetUp", "Mall.Module.BaseSetUp\Mall.Module.BaseSetUp.csproj", "{9C400D7F-2BE2-40E7-B179-498097AA00AB}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Mall.Module.BaseSetUp", "Mall.Module.BaseSetUp\Mall.Module.BaseSetUp.csproj", "{9C400D7F-2BE2-40E7-B179-498097AA00AB}"
EndProject EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
......
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