package com.wzj.soopin.member.domain.bo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.wzj.soopin.member.domain.po.MemberAccount;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.dromara.common.core.domain.BaseBO;
import org.dromara.common.excel.annotation.Excel;

import java.math.BigDecimal;

/**
 * 会员账户表 查询 对象
 *
 * @author zcc
 */
@Schema(description="会员账户表 查询 对象")
@Data
public class MemberAccountBO extends BaseBO {



    @Schema(description ="ID")
    private Long id;

    /**
     * 账户类型  1 用户 2 商家 3 代理 4 平台
     */
    private Integer type;

    @Schema(description ="MEMBER_ID")
    private Long memberId;

    @Schema(description ="积分余额")
    private BigDecimal integral;

    @Schema(description ="钱包")
    private BigDecimal wallet;

    @Schema(description ="营收")
    private BigDecimal revenue;
    private String nickname;
    private String phone;


    public LambdaQueryWrapper<MemberAccount> toWrapper() {
        LambdaQueryWrapper<MemberAccount> wrapper = new LambdaQueryWrapper<>();
        if (id != null) {
            wrapper.eq(MemberAccount::getId, id);
        }
        if (type != null) {
            wrapper.eq(MemberAccount::getType, type);
        }
        if (memberId != null) {
            wrapper.eq(MemberAccount::getMemberId, memberId);
        }
        if (integral != null) {
            wrapper.eq(MemberAccount::getIntegral, integral);
        }
        if (wallet != null) {
            wrapper.eq(MemberAccount::getWallet, wallet);
        }
        if (revenue != null) {
            wrapper.eq(MemberAccount::getRevenue, revenue);
        }


        return wrapper;
    }

}
