erp-platform/api/src/Kurs.Platform.Domain.Shared/Enums/LookUpQueryValues.cs
2025-10-20 23:40:32 +03:00

235 lines
No EOL
8.7 KiB
C#

using Kurs.Platform.Enums;
using static Kurs.Platform.PlatformConsts;
namespace Kurs.Platform;
public static class LookUpQueryValues
{
public static string LanguageKeyValues =
$"SELECT " +
$"\"{FullNameTable(TableNameEnum.LanguageKey)}\".\"Key\", " +
$"CONCAT(" +
$"\"{FullNameTable(TableNameEnum.LanguageKey)}\".\"Key\", " +
$"' (', " +
$"\"{FullNameTable(TableNameEnum.LanguageText)}\".\"Value\", " +
$"')'" +
$") AS \"Name\" " +
$"FROM \"{FullNameTable(TableNameEnum.LanguageKey)}\" " +
$"LEFT OUTER JOIN \"{FullNameTable(TableNameEnum.LanguageText)}\" " +
$"ON \"{FullNameTable(TableNameEnum.LanguageKey)}\".\"Key\" = \"{FullNameTable(TableNameEnum.LanguageText)}\".\"Key\" " +
$"AND \"{FullNameTable(TableNameEnum.LanguageKey)}\".\"ResourceName\" = \"{FullNameTable(TableNameEnum.LanguageText)}\".\"ResourceName\" " +
$"WHERE " +
$"\"{FullNameTable(TableNameEnum.LanguageKey)}\".\"IsDeleted\" = 'false' " +
$"AND \"{FullNameTable(TableNameEnum.LanguageText)}\".\"IsDeleted\" = 'false' " +
$"AND \"{FullNameTable(TableNameEnum.LanguageText)}\".\"CultureName\" = 'tr' " +
$"ORDER BY \"{FullNameTable(TableNameEnum.LanguageKey)}\".\"Key\";";
public static string CultureValues =
$"SELECT " +
$"\"CultureName\" AS \"Key\", " +
$"\"DisplayName\" AS \"Name\", " +
$"\"CreationTime\" " +
$"FROM \"{FullNameTable(TableNameEnum.Language)}\" " +
$"WHERE \"IsDeleted\" = 'false' " +
$"AND \"IsDeleted\" = 'false';";
public static string CountryGroupValues =
$"SELECT " +
$"\"Name\" AS \"Key\", " +
$"\"Name\" AS \"Name\" " +
$"FROM \"{FullNameTable(TableNameEnum.CountryGroup)}\" " +
$"WHERE \"IsDeleted\" = 'false' " +
$"GROUP BY \"Name\" " +
$"ORDER BY \"Name\";";
public static string DataSourceValues =
$"SELECT " +
$"\"Code\" AS \"Key\", " +
$"\"Name\" AS \"Name\" " +
$"FROM \"{FullNameTable(TableNameEnum.DataSource)}\" " +
$"WHERE \"IsDeleted\" = 'false' " +
$"ORDER BY \"Name\";";
public static string BlogCategoryValues =
$"SELECT " +
$"\"Code\" AS \"Key\", " +
$"\"Name\" AS \"Name\" " +
$"FROM \"{FullNameTable(TableNameEnum.BlogCategory)}\" " +
$"WHERE \"IsDeleted\" = 'false' " +
$"ORDER BY \"Name\";";
public static string CountryValues =
$"SELECT " +
$"\"Code\" AS \"Key\", " +
$"\"Name\" AS \"Name\" " +
$"FROM \"{FullNameTable(TableNameEnum.Country)}\" " +
$"WHERE \"IsDeleted\" = 'false' " +
$"ORDER BY \"Name\";";
public static string CityValues =
$"SELECT " +
$"\"Code\" AS \"Key\", " +
$"\"Name\" AS \"Name\" " +
$"FROM \"{FullNameTable(TableNameEnum.City)}\" " +
$"WHERE " +
$"(\"Country\" = @param0 OR @param0 IS NULL) " +
$"AND \"IsDeleted\" = 'false' " +
$"ORDER BY \"Name\";";
public static string DistrictValues =
$"SELECT " +
$"\"Name\" AS \"Key\", " +
$"\"Name\" AS \"Name\" " +
$"FROM \"{FullNameTable(TableNameEnum.District)}\" " +
$"WHERE " +
$"(\"Country\" = @param0 OR @param0 IS NULL) " +
$"AND (\"City\" = @param1 OR @param1 IS NULL) " +
$"AND \"IsDeleted\" = 'false' " +
$"GROUP BY \"Name\" " +
$"ORDER BY \"Name\";";
public static string StreetValues =
$"SELECT " +
$"\"Street\" AS \"Key\", " +
$"\"Street\" AS \"Name\" " +
$"FROM \"{FullNameTable(TableNameEnum.District)}\" " +
$"WHERE " +
$"(\"Country\" = @param0 OR @param0 IS NULL) " +
$"AND (\"City\" = @param1 OR @param1 IS NULL) " +
$"AND (\"Name\" = @param2 OR @param2 IS NULL) " +
$"AND \"IsDeleted\" = 'false' " +
$"GROUP BY \"Street\" " +
$"ORDER BY \"Street\";";
public static string TenantValues =
$"SELECT * FROM (" +
$"SELECT NULL AS \"Key\", 'Host' AS \"Name\" " +
$"UNION ALL " +
$"SELECT " +
$"\"AbpTenants\".\"Id\" AS \"Key\", " +
$"\"AbpTenants\".\"Name\" AS \"Name\" " +
$"FROM \"AbpTenants\"" +
$") AS \"List\" " +
$"ORDER BY \"Name\"";
public static string RoleValues =
$"SELECT " +
$"\"Id\" AS \"Key\", " +
$"\"Name\" AS \"Name\" " +
$"FROM \"AbpRoles\"" +
$"ORDER BY \"Name\"";
public static string UserValues =
$"SELECT " +
$"\"Id\" AS \"Key\", " +
$"\"UserName\" AS \"Name\" " +
$"FROM \"AbpUsers\"" +
$"ORDER BY \"Name\"";
public static string BranchValues =
$"SELECT \"Id\" AS \"Key\", " +
$"\"Name\" AS \"Name\" " +
$"FROM \"KURS\".\"dbo\".\"{FullNameTable(TableNameEnum.Branch)}\" " +
$"WHERE " +
$"\"TenantId\" = @TENANTID " +
$"AND \"IsDeleted\" = 'false' " +
$"AND \"Id\" IN ( " +
$"SELECT \"BranchId\" " +
$"FROM \"{FullNameTable(TableNameEnum.BranchUsers)}\" " +
$"WHERE \"UserId\" = @USERID " +
$") " +
$"ORDER BY \"Name\";";
public static string RegistrationTypeValues =
$"SELECT " +
$"\"Id\" AS \"Key\", " +
$"\"Name\" AS \"Name\" " +
$"FROM \"{FullNameTable(TableNameEnum.RegistrationType)}\" " +
$"WHERE " +
$"(\"BranchId\" = @param0 OR @param0 IS NULL) " +
$"AND \"IsDeleted\" = 'false' " +
$"ORDER BY \"Name\";";
public static string SkillTypeValues =
$"SELECT " +
$"\"Id\" AS \"Key\", " +
$"\"Name\" AS \"Name\" " +
$"FROM \"{FullNameTable(TableNameEnum.SkillType)}\" " +
$"WHERE \"IsDeleted\" = 'false' " +
$"ORDER BY \"Name\";";
public static string ClassTypeValues =
$"SELECT " +
$"\"Id\" AS \"Key\", " +
$"\"Name\" AS \"Name\" " +
$"FROM \"{FullNameTable(TableNameEnum.ClassType)}\" " +
$"WHERE " +
$"(\"BranchId\" = @param0 OR @param0 IS NULL) " +
$"AND \"IsDeleted\" = 'false' " +
$"ORDER BY \"Name\";";
public static string PaymentMethodValues =
$"SELECT " +
$"\"Id\" AS \"Key\", " +
$"\"Name\" AS \"Name\" " +
$"FROM \"{FullNameTable(TableNameEnum.PaymentMethod)}\" " +
$"WHERE \"IsDeleted\" = 'false' " +
$"ORDER BY \"Name\";";
public static string InstallmentValues =
$"SELECT " +
$"\"Installment\" AS \"Key\", " +
$"\"Name\" AS \"Name\" " +
$"FROM \"{FullNameTable(TableNameEnum.InstallmentOption)}\" " +
$"WHERE \"IsDeleted\" = 'false' " +
$"ORDER BY \"Installment\";";
public static string QuestionPoolValues =
$"SELECT " +
$"\"Id\" AS \"Key\", " +
$"\"Name\" AS \"Name\" " +
$"FROM \"{FullNameTable(TableNameEnum.QuestionPool)}\" " +
$"WHERE \"IsDeleted\" = 'false' ";
public static string QuestionTagValues =
$"SELECT " +
$"\"Id\" AS \"Key\", " +
$"\"Name\" AS \"Name\" " +
$"FROM \"{FullNameTable(TableNameEnum.QuestionTag)}\" " +
$"WHERE \"IsDeleted\" = 'false' ";
public static string EventCategoryValues =
$"SELECT " +
$"\"Id\" AS \"Key\", " +
$"\"Name\" AS \"Name\" " +
$"FROM \"{FullNameTable(TableNameEnum.EventCategory)}\" " +
$"WHERE \"IsDeleted\" = 'false' ";
public static string EventTypeValues =
$"SELECT " +
$"\"Id\" AS \"Key\", " +
$"\"Name\" AS \"Name\" " +
$"FROM \"{FullNameTable(TableNameEnum.EventType)}\" " +
$"WHERE \"IsDeleted\" = 'false' ";
public static string UomCategoryValues =
$"SELECT " +
$"\"Id\" AS \"Key\", " +
$"\"Name\" AS \"Name\" " +
$"FROM \"{FullNameTable(TableNameEnum.UomCategory)}\" " +
$"WHERE \"IsDeleted\" = 'false' ";
public static string BankValues =
$"SELECT " +
$"\"Id\" AS \"Key\", " +
$"\"Name\" AS \"Name\" " +
$"FROM \"{FullNameTable(TableNameEnum.Bank)}\" " +
$"WHERE \"IsDeleted\" = 'false' ";
public static string CurrencyValues =
$"SELECT " +
$"\"Id\" AS \"Key\", " +
$"\"Name\" AS \"Name\" " +
$"FROM \"{FullNameTable(TableNameEnum.Currency)}\" " +
$"WHERE \"IsDeleted\" = 'false' ";
}