mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-10-15 18:55:07 +08:00
Update Demo
This commit is contained in:
@@ -4,6 +4,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using TCM.Manager.Models;
|
||||
|
||||
namespace OrmTest.BugTest
|
||||
{
|
||||
@@ -47,6 +48,35 @@ namespace OrmTest.BugTest
|
||||
//WhereIF(RoleId > 0, t3 => t3.RoleId == RoleId).Any())
|
||||
.Select(t1 => new User { Id = SqlFunc.GetSelfAndAutoFill(t1.Id) }).ToSql();
|
||||
|
||||
var model = DB.Queryable<ClientsModel, VipAccountsModel, AccountsModel, tLogonHistoryModel, VipBenefitsModel, LevelSettingModel, JewelsModel>((a, b, c, d, e, f, g) => new object[]{
|
||||
JoinType.Left,a.ClientID==b.ClientID,
|
||||
JoinType.Left,a.ClientID==c.ClientID&&c.TournamentID==0,
|
||||
JoinType.Left,a.ClientID==d.ClientID,
|
||||
JoinType.Left,(e.MinVipCredit<=b.VipCredit&&e.MaxVipCredit>=b.VipCredit) && (e.MinConsumeAmount<=b.AccumulatedConsumeAmount&&e.MaxConsumeAmount>=b.AccumulatedConsumeAmount),
|
||||
JoinType.Left,(c.ExperiencePoints>=f.MinExperiencePoints && c.ExperiencePoints<f.MaxExperiencePoints) || (c.ExperiencePoints > f.MaxExperiencePoints && f.UserLevel== 30),
|
||||
JoinType.Left,g.ClientID==a.ClientID
|
||||
})
|
||||
.WhereIF(true, (a, b, c, d, e, f, g) => a.ClientID == 1)
|
||||
.WhereIF(!string.IsNullOrEmpty("a"), (a, b, c, d, e, f, g) => a.NickName == "a")
|
||||
.Select((a, b, c, d, e, f, g) => new
|
||||
{
|
||||
GoldAmount = SqlFunc.Subqueryable<ExposureModel>().Where(s => s.TournamentID == 0 && s.ClientID == a.ClientID).Sum(s => SqlFunc.IsNull(SqlFunc.AggregateSum(s.Exposure), 0)) ,
|
||||
ClientID = a.ClientID,
|
||||
NickName = a.NickName,
|
||||
UserChannel = a.UserChannel,
|
||||
CountryCode = d.CountryCode,
|
||||
Platform = a.Platform,
|
||||
Email = a.Email,
|
||||
PhoneNumber = a.PhoneNumber,
|
||||
RegisteredTime = a.RegisteredTime,
|
||||
DiamondAmount = SqlFunc.IsNull(g.JewelCount, 0),
|
||||
AccumulatedRechargeAmount = SqlFunc.IsNull(b.AccumulatedRechargeAmount, 0),
|
||||
VipLevel = SqlFunc.IsNull(e.VipLevel, 0),
|
||||
UserLevel = SqlFunc.IsNull(f.UserLevel, 0)
|
||||
})
|
||||
.With(SqlWith.NoLock)
|
||||
.ToSql();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
95
Src/Asp.Net/SqlServerTest/BugTest/BugModels/AccountsModel.cs
Normal file
95
Src/Asp.Net/SqlServerTest/BugTest/BugModels/AccountsModel.cs
Normal file
@@ -0,0 +1,95 @@
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace TCM.Manager.Models
|
||||
{
|
||||
[SugarTable("Accounts")]
|
||||
public class AccountsModel
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public AccountsModel()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public System.Int64 ClientID { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public System.Int64 TournamentID { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public System.Decimal Balance { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public System.Decimal ExperiencePoints { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public System.Decimal RewardPoints { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public System.Decimal Payout { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public System.Byte[] TS { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public System.DateTime RegisteredTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public System.Int32 GoldBadges { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public System.Int32 SilverBadges { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public System.Int32 CurrentLevelMinPoints { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public System.Int32 NextLevelRequiredPoints { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public System.Int32 UserLevel { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public System.String CorrelationAccountID { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public System.Decimal Energy { get; set; }
|
||||
}
|
||||
}
|
67
Src/Asp.Net/SqlServerTest/BugTest/BugModels/ClientsModel.cs
Normal file
67
Src/Asp.Net/SqlServerTest/BugTest/BugModels/ClientsModel.cs
Normal file
@@ -0,0 +1,67 @@
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace TCM.Manager.Models
|
||||
{
|
||||
[SugarTable("Clients")]
|
||||
public class ClientsModel
|
||||
{
|
||||
public long ClientID { get; set; }
|
||||
|
||||
public long ParentClientID { get; set; }
|
||||
|
||||
public string RefClientID { get; set; }
|
||||
|
||||
public string ClientName { get; set; }
|
||||
|
||||
public string Password { get; set; }
|
||||
|
||||
public string PhoneNumber { get; set; }
|
||||
|
||||
public bool PhoneNumberConfirmed { get; set; }
|
||||
|
||||
public string Email { get; set; }
|
||||
|
||||
public bool EmailConfirmed { get; set; }
|
||||
|
||||
public string AvatarID { get; set; }
|
||||
|
||||
public string AvatarCustomization { get; set; }
|
||||
|
||||
public DateTime RegisteredTime { get; set; }
|
||||
|
||||
public string NickName { get; set; }
|
||||
|
||||
public int UserType { get; set; }
|
||||
|
||||
public string UserSource { get; set; }
|
||||
|
||||
public string UserDeviceUniqueIdentifier { get; set; }
|
||||
|
||||
public string UserDeviceModel { get; set; }
|
||||
|
||||
public int TimeZoneID { get; set; }
|
||||
|
||||
public string UserChannel { get; set; }
|
||||
|
||||
public string IDFA { get; set; }
|
||||
|
||||
public string CorrelationPlayerID { get; set; }
|
||||
|
||||
public string DeviceToken { get; set; }
|
||||
|
||||
public int Language { get; set; }
|
||||
|
||||
public int Platform { get; set; }
|
||||
|
||||
public string AdsID { get; set; }
|
||||
|
||||
public string SocialEmail { get; set; }
|
||||
|
||||
public string ClientIdentity { get; set; }
|
||||
}
|
||||
}
|
49
Src/Asp.Net/SqlServerTest/BugTest/BugModels/ExposureModel.cs
Normal file
49
Src/Asp.Net/SqlServerTest/BugTest/BugModels/ExposureModel.cs
Normal file
@@ -0,0 +1,49 @@
|
||||
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace TCM.Manager.Models
|
||||
{
|
||||
[SugarTable("Exposure")]
|
||||
public class ExposureModel
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public System.Int64 ClientID { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public System.Int64 TournamentID { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public System.Int64 NodeID { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public System.Int64 Period { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public System.Decimal Exposure { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public System.Byte[] TS { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public System.Int64 ExtraMatchID { get; set; }
|
||||
}
|
||||
}
|
20
Src/Asp.Net/SqlServerTest/BugTest/BugModels/JewelsModel.cs
Normal file
20
Src/Asp.Net/SqlServerTest/BugTest/BugModels/JewelsModel.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace TCM.Manager.Models
|
||||
{
|
||||
[SugarTable("Jewels")]
|
||||
public class JewelsModel
|
||||
{
|
||||
public long ClientID { get; set; }
|
||||
|
||||
public decimal JewelCount { get; set; }
|
||||
|
||||
public int PropType { get; set; }
|
||||
|
||||
}
|
||||
}
|
@@ -0,0 +1,65 @@
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace TCM.Manager.Models
|
||||
{
|
||||
[SugarTable("LevelSetting")]
|
||||
public class LevelSettingModel
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public LevelSettingModel()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public System.Int32 UserLevel { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public System.Decimal MinExperiencePoints { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public System.Decimal MaxExperiencePoints { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public System.String UnlockAppModules { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public System.Int32 RouletteLevel { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public System.String LevelUpRemindTitle { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public System.String LevelUpRemindSubTitle { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public System.String LevelUpRemindDescription { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public System.Int32 FortuneRouletteLevel { get; set; }
|
||||
}
|
||||
}
|
@@ -0,0 +1,45 @@
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace TCM.Manager.Models
|
||||
{
|
||||
[SugarTable("VipAccounts")]
|
||||
public class VipAccountsModel
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public VipAccountsModel()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public System.Int64 ClientID { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public System.Int32 VipCredit { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public System.Int32 VipLevel { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public System.Decimal AccumulatedRechargeAmount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public System.Decimal AccumulatedConsumeAmount { get; set; }
|
||||
}
|
||||
}
|
100
Src/Asp.Net/SqlServerTest/BugTest/BugModels/VipBenefitsModel.cs
Normal file
100
Src/Asp.Net/SqlServerTest/BugTest/BugModels/VipBenefitsModel.cs
Normal file
@@ -0,0 +1,100 @@
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace TCM.Manager.Models
|
||||
{
|
||||
[SugarTable("VipBenefits")]
|
||||
public class VipBenefitsModel
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public VipBenefitsModel()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public System.Int32 VipLevel { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public System.Int32 MinVipCredit { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public System.Int32 MaxVipCredit { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public System.Decimal MinRechargeAmount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public System.Decimal MaxRechargeAmount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public System.Decimal RechargeBenefit { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public System.Decimal RechargeRebate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public System.Decimal SoloWonBenefit { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public System.Int32 RouletteLevel { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public System.Int32 FortuneRouletteLevel { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public System.Decimal MinConsumeAmount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public System.Decimal MaxConsumeAmount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public System.Boolean RewardTournamentEnable { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public System.Decimal FortuneRouletteRate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public System.Boolean EnableVipService { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public System.Boolean EnableTransfer { get; set; }
|
||||
}
|
||||
}
|
@@ -0,0 +1,47 @@
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace TCM.Manager.Models
|
||||
{
|
||||
[SugarTable("tLogonHistory")]
|
||||
public class tLogonHistoryModel
|
||||
{
|
||||
public long ClientID { get; set;}
|
||||
|
||||
public DateTime CreateTime { get; set; }
|
||||
|
||||
public int Type { get; set;}
|
||||
|
||||
public string IPAddress { get; set; }
|
||||
|
||||
public string Location { get; set; }
|
||||
|
||||
public string TimeZone { get; set; }
|
||||
|
||||
public string CountryName { get; set; }
|
||||
|
||||
public string CountryCode { get; set; }
|
||||
|
||||
public string RegionName { get; set;}
|
||||
|
||||
public string RegionCode { get; set; }
|
||||
|
||||
public string CityName { get; set; }
|
||||
|
||||
public string CityCode { get; set; }
|
||||
|
||||
public string Version { get; set;}
|
||||
|
||||
public string OriginalCountryCode { get; set; }
|
||||
|
||||
public int DeviceVirtualizeModel { get; set; }
|
||||
|
||||
public int DeviceCPUArchitecture { get; set; }
|
||||
|
||||
public int DeviceVirtualizeIndexNumber { get; set;}
|
||||
}
|
||||
}
|
@@ -50,6 +50,14 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="BugTest\Bug2.cs" />
|
||||
<Compile Include="BugTest\BugModels\AccountsModel.cs" />
|
||||
<Compile Include="BugTest\BugModels\ClientsModel.cs" />
|
||||
<Compile Include="BugTest\BugModels\ExposureModel.cs" />
|
||||
<Compile Include="BugTest\BugModels\JewelsModel.cs" />
|
||||
<Compile Include="BugTest\BugModels\LevelSettingModel.cs" />
|
||||
<Compile Include="BugTest\BugModels\tLogonHistoryModel.cs" />
|
||||
<Compile Include="BugTest\BugModels\VipAccountsModel.cs" />
|
||||
<Compile Include="BugTest\BugModels\VipBenefitsModel.cs" />
|
||||
<Compile Include="Models\Brand.cs" />
|
||||
<Compile Include="BugTest\Bug1.cs" />
|
||||
<Compile Include="Models\VendorAndBrand.cs" />
|
||||
|
Reference in New Issue
Block a user