新增数据库相关语句脚本
This commit is contained in:
45
codes/games/sql/game/scripts/update_player_roomcard.sql
Normal file
45
codes/games/sql/game/scripts/update_player_roomcard.sql
Normal file
@@ -0,0 +1,45 @@
|
||||
-- ============================================================
|
||||
-- 脚本名称: update_player_roomcard.sql
|
||||
-- 功 能: 更新指定玩家的房卡数量
|
||||
-- 数据库 : game_db(RDS: rm-bp1749tfxu2rpq670lo)
|
||||
-- 用 法:
|
||||
-- 1. 修改下方【参数设置】中的变量值
|
||||
-- 2. 先执行【查询确认】,核对目标玩家信息无误
|
||||
-- 3. 确认无误后再执行【执行更新】
|
||||
-- ============================================================
|
||||
|
||||
|
||||
-- ============================================================
|
||||
-- 【参数设置】 ← 修改这里
|
||||
-- ============================================================
|
||||
SET @p_agentid = 'veRa0qrBf0df2K1G4de2tgfmVxB2jxpv'; -- 代理商ID
|
||||
SET @p_playerid = 0; -- 玩家ID(play_playerid)
|
||||
SET @p_roomcard = 0; -- 要设置的房卡数量
|
||||
|
||||
|
||||
-- ============================================================
|
||||
-- 【第一步:查询确认】执行后确认玩家信息正确再继续
|
||||
-- ============================================================
|
||||
SELECT
|
||||
play_agentid AS '代理商ID',
|
||||
play_playerid AS '玩家ID',
|
||||
play_nickname AS '玩家昵称',
|
||||
play_roomcard AS '当前房卡数',
|
||||
@p_roomcard AS '更新后房卡数'
|
||||
FROM
|
||||
player
|
||||
WHERE
|
||||
play_agentid = @p_agentid
|
||||
AND play_playerid = @p_playerid;
|
||||
|
||||
|
||||
-- ============================================================
|
||||
-- 【第二步:执行更新】确认玩家信息无误后执行此段
|
||||
-- ============================================================
|
||||
UPDATE player
|
||||
SET play_roomcard = @p_roomcard
|
||||
WHERE play_agentid = @p_agentid
|
||||
AND play_playerid = @p_playerid;
|
||||
|
||||
-- 输出影响行数(1 = 更新成功,0 = 未找到对应玩家)
|
||||
SELECT ROW_COUNT() AS '影响行数(1=成功,0=未找到玩家)';
|
||||
Reference in New Issue
Block a user