package com.czg.service.account.mapper;

import com.czg.account.dto.shopuser.ShopUserDTO;
import com.czg.account.dto.shopuser.ShopUserSummaryDTO;
import com.czg.account.dto.shopuser.ShopUserVipCardDTO;
import com.czg.account.dto.user.userinfo.UserInfoAssetsSummaryDTO;
import com.czg.account.entity.ShopUser;
import com.mybatisflex.core.BaseMapper;
import com.mybatisflex.core.paginate.Page;
import org.apache.ibatis.annotations.Param;

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

/**
 * 商户储值会员 映射层。
 *
 * @author Administrator
 * @since 2025-02-08
 */
public interface ShopUserMapper extends BaseMapper<ShopUser> {

    List<ShopUserDTO> selectPageByKeyAndIsVip(@Param("shopId") Long shopId, @Param("isVip") Integer isVip, @Param("key") String key, @Param("amount") BigDecimal amount);

    int incrAccount(@Param("shopId") long shopId, @Param("id") Long id, @Param("time") LocalDateTime time, @Param("money") BigDecimal money);
    int decrAccount(@Param("shopId") long shopId, @Param("id") Long id, @Param("time") LocalDateTime time, @Param("money") BigDecimal money);

    ShopUserSummaryDTO selectUserSummary(@Param("shopId") Long shopId, @Param("isVip") Integer isVip);

    Page<ShopUserVipCardDTO> selectVipCard();
    long selectVipCard_COUNT();

    UserInfoAssetsSummaryDTO selectAssetsSummary(@Param("userId") Long userInfoId);

}
