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})");