package com.cyksj.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.cyksj.model.entity.GiftCardUserRecord;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.math.BigDecimal;

/*
 *项目名: netflix
 *文件名: GiftCardUserRecordMapper
 *创建者: JavaZou
 *创建时间:2023/8/28 12:01
 */
public interface GiftCardUserRecordMapper extends BaseMapper<GiftCardUserRecord> {
	@Update("update gift_card_user_record set remain_cash = remain_cash + #{addCash},is_used = 0 where id = #{gcId} and remain_cash = #{remainCash}")
	Integer updateGiftCardRemainCash(@Param("gcId") Long gcId, @Param("addCash") BigDecimal addCash, @Param("remainCash") BigDecimal remainCash);
}
