diff --git a/Src/Asp.Net/SqlServerTest/BugTest/Bug2.cs b/Src/Asp.Net/SqlServerTest/BugTest/Bug2.cs index 9fa4eccc4..691e97aa2 100644 --- a/Src/Asp.Net/SqlServerTest/BugTest/Bug2.cs +++ b/Src/Asp.Net/SqlServerTest/BugTest/Bug2.cs @@ -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((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 && 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().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(); + } } diff --git a/Src/Asp.Net/SqlServerTest/BugTest/BugModels/AccountsModel.cs b/Src/Asp.Net/SqlServerTest/BugTest/BugModels/AccountsModel.cs new file mode 100644 index 000000000..1f7af6c1c --- /dev/null +++ b/Src/Asp.Net/SqlServerTest/BugTest/BugModels/AccountsModel.cs @@ -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 + { + /// + /// + /// + public AccountsModel() + { + } + + /// + /// + /// + public System.Int64 ClientID { get; set; } + + /// + /// + /// + public System.Int64 TournamentID { get; set; } + + /// + /// + /// + public System.Decimal Balance { get; set; } + + /// + /// + /// + public System.Decimal ExperiencePoints { get; set; } + + /// + /// + /// + public System.Decimal RewardPoints { get; set; } + + /// + /// + /// + public System.Decimal Payout { get; set; } + + /// + /// + /// + public System.Byte[] TS { get; set; } + + /// + /// + /// + public System.DateTime RegisteredTime { get; set; } + + /// + /// + /// + public System.Int32 GoldBadges { get; set; } + + /// + /// + /// + public System.Int32 SilverBadges { get; set; } + + /// + /// + /// + public System.Int32 CurrentLevelMinPoints { get; set; } + + /// + /// + /// + public System.Int32 NextLevelRequiredPoints { get; set; } + + /// + /// + /// + public System.Int32 UserLevel { get; set; } + + /// + /// + /// + public System.String CorrelationAccountID { get; set; } + + /// + /// + /// + public System.Decimal Energy { get; set; } + } +} \ No newline at end of file diff --git a/Src/Asp.Net/SqlServerTest/BugTest/BugModels/ClientsModel.cs b/Src/Asp.Net/SqlServerTest/BugTest/BugModels/ClientsModel.cs new file mode 100644 index 000000000..89b0cdcc4 --- /dev/null +++ b/Src/Asp.Net/SqlServerTest/BugTest/BugModels/ClientsModel.cs @@ -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; } + } +} diff --git a/Src/Asp.Net/SqlServerTest/BugTest/BugModels/ExposureModel.cs b/Src/Asp.Net/SqlServerTest/BugTest/BugModels/ExposureModel.cs new file mode 100644 index 000000000..c0a42eb61 --- /dev/null +++ b/Src/Asp.Net/SqlServerTest/BugTest/BugModels/ExposureModel.cs @@ -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 + { + /// + /// + /// + public System.Int64 ClientID { get; set; } + + /// + /// + /// + public System.Int64 TournamentID { get; set; } + + /// + /// + /// + public System.Int64 NodeID { get; set; } + + /// + /// + /// + public System.Int64 Period { get; set; } + + /// + /// + /// + public System.Decimal Exposure { get; set; } + + /// + /// + /// + public System.Byte[] TS { get; set; } + + /// + /// + /// + public System.Int64 ExtraMatchID { get; set; } + } +} \ No newline at end of file diff --git a/Src/Asp.Net/SqlServerTest/BugTest/BugModels/JewelsModel.cs b/Src/Asp.Net/SqlServerTest/BugTest/BugModels/JewelsModel.cs new file mode 100644 index 000000000..2e0e4e7e2 --- /dev/null +++ b/Src/Asp.Net/SqlServerTest/BugTest/BugModels/JewelsModel.cs @@ -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; } + + } +} diff --git a/Src/Asp.Net/SqlServerTest/BugTest/BugModels/LevelSettingModel.cs b/Src/Asp.Net/SqlServerTest/BugTest/BugModels/LevelSettingModel.cs new file mode 100644 index 000000000..cec43ef22 --- /dev/null +++ b/Src/Asp.Net/SqlServerTest/BugTest/BugModels/LevelSettingModel.cs @@ -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 + { + /// + /// + /// + public LevelSettingModel() + { + } + + /// + /// + /// + public System.Int32 UserLevel { get; set; } + + /// + /// + /// + public System.Decimal MinExperiencePoints { get; set; } + + /// + /// + /// + public System.Decimal MaxExperiencePoints { get; set; } + + /// + /// + /// + public System.String UnlockAppModules { get; set; } + + /// + /// + /// + public System.Int32 RouletteLevel { get; set; } + + /// + /// + /// + public System.String LevelUpRemindTitle { get; set; } + + /// + /// + /// + public System.String LevelUpRemindSubTitle { get; set; } + + /// + /// + /// + public System.String LevelUpRemindDescription { get; set; } + + /// + /// + /// + public System.Int32 FortuneRouletteLevel { get; set; } + } +} \ No newline at end of file diff --git a/Src/Asp.Net/SqlServerTest/BugTest/BugModels/VipAccountsModel.cs b/Src/Asp.Net/SqlServerTest/BugTest/BugModels/VipAccountsModel.cs new file mode 100644 index 000000000..28dbe738e --- /dev/null +++ b/Src/Asp.Net/SqlServerTest/BugTest/BugModels/VipAccountsModel.cs @@ -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 + { + /// + /// + /// + public VipAccountsModel() + { + } + + /// + /// + /// + public System.Int64 ClientID { get; set; } + + /// + /// + /// + public System.Int32 VipCredit { get; set; } + + /// + /// + /// + public System.Int32 VipLevel { get; set; } + + /// + /// + /// + public System.Decimal AccumulatedRechargeAmount { get; set; } + + /// + /// + /// + public System.Decimal AccumulatedConsumeAmount { get; set; } + } +} \ No newline at end of file diff --git a/Src/Asp.Net/SqlServerTest/BugTest/BugModels/VipBenefitsModel.cs b/Src/Asp.Net/SqlServerTest/BugTest/BugModels/VipBenefitsModel.cs new file mode 100644 index 000000000..c878b79ae --- /dev/null +++ b/Src/Asp.Net/SqlServerTest/BugTest/BugModels/VipBenefitsModel.cs @@ -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 + { + /// + /// + /// + public VipBenefitsModel() + { + } + + /// + /// + /// + public System.Int32 VipLevel { get; set; } + + /// + /// + /// + public System.Int32 MinVipCredit { get; set; } + + /// + /// + /// + public System.Int32 MaxVipCredit { get; set; } + + /// + /// + /// + public System.Decimal MinRechargeAmount { get; set; } + + /// + /// + /// + public System.Decimal MaxRechargeAmount { get; set; } + + /// + /// + /// + public System.Decimal RechargeBenefit { get; set; } + + /// + /// + /// + public System.Decimal RechargeRebate { get; set; } + + /// + /// + /// + public System.Decimal SoloWonBenefit { get; set; } + + /// + /// + /// + public System.Int32 RouletteLevel { get; set; } + + /// + /// + /// + public System.Int32 FortuneRouletteLevel { get; set; } + + /// + /// + /// + public System.Decimal MinConsumeAmount { get; set; } + + /// + /// + /// + public System.Decimal MaxConsumeAmount { get; set; } + + /// + /// + /// + public System.Boolean RewardTournamentEnable { get; set; } + + /// + /// + /// + public System.Decimal FortuneRouletteRate { get; set; } + + /// + /// + /// + public System.Boolean EnableVipService { get; set; } + + /// + /// + /// + public System.Boolean EnableTransfer { get; set; } + } +} \ No newline at end of file diff --git a/Src/Asp.Net/SqlServerTest/BugTest/BugModels/tLogonHistoryModel.cs b/Src/Asp.Net/SqlServerTest/BugTest/BugModels/tLogonHistoryModel.cs new file mode 100644 index 000000000..10cdd667a --- /dev/null +++ b/Src/Asp.Net/SqlServerTest/BugTest/BugModels/tLogonHistoryModel.cs @@ -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;} + } +} diff --git a/Src/Asp.Net/SqlServerTest/SqlServerTest.csproj b/Src/Asp.Net/SqlServerTest/SqlServerTest.csproj index 19d3e286a..f9043fe33 100644 --- a/Src/Asp.Net/SqlServerTest/SqlServerTest.csproj +++ b/Src/Asp.Net/SqlServerTest/SqlServerTest.csproj @@ -50,6 +50,14 @@ + + + + + + + +