mirror of
https://github.com/project-redbud/FunGame-Core.git
synced 2025-04-22 12:09:34 +08:00

* 补充数据库表 * 更新sqlite * 添加商店相关的数据库常量类 * add Update_UpdateRoomMaster * 修改常量类 * 添加 NOTICE 文件 * 添加市场、报价、库存的数据库常量类 * 优化表结构和查询常量类 * 添加 UserCenter 和 Inventory 相关枚举;数据表和 Query 常量类修改 * 添加报价的核心操作 * 涉及库存的物品获取应该使用 Guid 而不是 ItemId --------- Co-authored-by: yeziuku <yezi@wrss.org>
70 lines
3.3 KiB
C#
70 lines
3.3 KiB
C#
using Milimoe.FunGame.Core.Api.Transmittal;
|
|
|
|
namespace Milimoe.FunGame.Core.Library.SQLScript.Entity
|
|
{
|
|
public class OfferItemsQuery : Constant
|
|
{
|
|
public const string TableName = "OfferItems";
|
|
public const string TableName_Backup = "OfferItemsBackup";
|
|
public const string Column_Id = "Id";
|
|
public const string Column_OfferId = "OfferId";
|
|
public const string Column_UserId = "UserId";
|
|
public const string Column_ItemGuid = "ItemGuid";
|
|
|
|
public const string Select_OfferItems = $"{Command_Select} {Command_All} {Command_From} {TableName}";
|
|
public const string Select_OfferItemsBackup = $"{Command_Select} {Command_All} {Command_From} {TableName_Backup}";
|
|
|
|
public static string Select_OfferItemsByOfferIdAndUserId(SQLHelper SQLHelper, long OfferId, long UserId)
|
|
{
|
|
SQLHelper.Parameters["@OfferId"] = OfferId;
|
|
SQLHelper.Parameters["@UserId"] = UserId;
|
|
return $"{Select_OfferItems} {Command_Where} {Column_OfferId} = @OfferId {Command_And} {Column_UserId} = @UserId";
|
|
}
|
|
|
|
public static string Select_OfferItemsBackupByOfferIdAndUserId(SQLHelper SQLHelper, long OfferId, long UserId)
|
|
{
|
|
SQLHelper.Parameters["@OfferId"] = OfferId;
|
|
SQLHelper.Parameters["@UserId"] = UserId;
|
|
return $"{Select_OfferItemsBackup} {Command_Where} {Column_OfferId} = @OfferId {Command_And} {Column_UserId} = @UserId";
|
|
}
|
|
|
|
public static string Insert_OfferItem(SQLHelper SQLHelper, long OfferId, long UserId, Guid ItemGuid)
|
|
{
|
|
SQLHelper.Parameters["@OfferId"] = OfferId;
|
|
SQLHelper.Parameters["@UserId"] = UserId;
|
|
SQLHelper.Parameters["@ItemGuid"] = ItemGuid.ToString();
|
|
|
|
return $"{Command_Insert} {Command_Into} {TableName} ({Column_OfferId}, {Column_UserId}, {Column_ItemGuid}) " +
|
|
$"{Command_Values} (@OfferId, @UserId, @ItemGuid)";
|
|
}
|
|
|
|
public static string Insert_OfferItemBackup(SQLHelper SQLHelper, long OfferId, long UserId, Guid ItemGuid)
|
|
{
|
|
SQLHelper.Parameters["@OfferId"] = OfferId;
|
|
SQLHelper.Parameters["@UserId"] = UserId;
|
|
SQLHelper.Parameters["@ItemGuid"] = ItemGuid.ToString();
|
|
|
|
return $"{Command_Insert} {Command_Into} {TableName_Backup} ({Column_OfferId}, {Column_UserId}, {Column_ItemGuid}) " +
|
|
$"{Command_Values} (@OfferId, @UserId, @ItemGuid)";
|
|
}
|
|
|
|
public static string Delete_OfferItem(SQLHelper SQLHelper, long Id)
|
|
{
|
|
SQLHelper.Parameters["@Id"] = Id;
|
|
return $"{Command_Delete} {Command_From} {TableName} {Command_Where} {Column_Id} = @Id";
|
|
}
|
|
|
|
public static string Delete_OfferItemsByOfferId(SQLHelper SQLHelper, long OfferId)
|
|
{
|
|
SQLHelper.Parameters["@OfferId"] = OfferId;
|
|
return $"{Command_Delete} {Command_From} {TableName} {Command_Where} {Column_OfferId} = @OfferId";
|
|
}
|
|
|
|
public static string Delete_OfferItemsBackupByOfferId(SQLHelper SQLHelper, long OfferId)
|
|
{
|
|
SQLHelper.Parameters["@OfferId"] = OfferId;
|
|
return $"{Command_Delete} {Command_From} {TableName_Backup} {Command_Where} {Column_OfferId} = @OfferId";
|
|
}
|
|
}
|
|
}
|