package com.yupi.project.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yupi.project.model.entity.User;
import org.apache.ibatis.annotations.Param;
import java.math.BigDecimal;

/**
* @description 针对表【user(用户表)】的数据库操作Mapper
* @createDate 2023-11-24 10:00:00
* @Entity com.yupi.project.model.entity.User
*/
public interface UserMapper extends BaseMapper<User> {

    /**
     * 更新用户余额
     * @param userId 用户ID
     * @param amountChange 要变更的金额 (元), 正数表示增加，负数表示减少
     * @return 影响的行数
     */
    int updateUserBalance(@Param("userId") Long userId, @Param("amountChange") BigDecimal amountChange);
} 