package com.bonus.canteen.core.account.v3.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.bonus.canteen.core.account.v3.model.AccWalletInfo;
import com.bonus.canteen.core.account.v3.web.vo.AccWalletInfoVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

@Mapper
public interface AccWalletInfoMapper extends BaseMapper<AccWalletInfo> {
   List<AccWalletInfoVO> queryAccWalletInfoVOListByCustId(@Param("custId") Long custId);

   void updateAccWalletInfoForUse(@Param("custId") Long custId, @Param("walletId") Integer walletId, @Param("amount") BigDecimal amount, @Param("updateId") long updateId);

   void updateAccWalletInfoForRecharge(@Param("custId") Long custId, @Param("walletId") Integer walletId, @Param("amount") BigDecimal amount, @Param("lastSubsidyAmount") BigDecimal lastSubsidyAmount, @Param("lastSubsidyTime") LocalDateTime lastSubsidyTime, @Param("updateId") long updateId);

   void updateAccWalletInfoForFrozen(@Param("custId") Long custId, @Param("walletId") Integer walletId, @Param("amount") BigDecimal amount, @Param("updateId") long updateId);

   void updateAccWalletInfoForUnFrozen(@Param("custId") Long custId, @Param("walletId") Integer walletId, @Param("amount") BigDecimal amount, @Param("updateId") long updateId);

}
