package org.dromara.system.domain.bo;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.dromara.common.core.domain.model.BaseAudit;
import org.dromara.system.domain.CommissionSection;
import org.dromara.system.domain.SysTenantAccount;
import io.swagger.v3.oas.annotations.media.Schema;

@Data
@Schema(description = "租户账户业务对象")
public class SysTenantAccountBo extends BaseAudit {
    @Schema(description = "主键ID")
    private Long id;
    @Schema(description = "租户ID")
    private Long tenantId;
    @Schema(description = "积分余额")
    private BigDecimal integralBalance;

    @Schema(description = "钱包余额")
    private BigDecimal wallet;
    @Schema(description = "营收")
    private BigDecimal revenue;

    private Long updateBy;
    @Schema(description = "账户类型 1商家 2代理 3平台")
    private Integer type;
    private String storeName;

    public LambdaQueryWrapper<SysTenantAccount> toWrapper() {
        LambdaQueryWrapper<SysTenantAccount> wrapper = new LambdaQueryWrapper<>();
        if (id != null) {
            wrapper.eq(SysTenantAccount::getId, id);
        }
        if (type != null) {
            wrapper.eq(SysTenantAccount::getType, type);
        }
        if (tenantId != null) {
            wrapper.eq(SysTenantAccount::getTenantId, tenantId);
        }

        if (wallet != null) {
            wrapper.eq(SysTenantAccount::getWallet, wallet);
        }
        if (revenue != null) {
            wrapper.eq(SysTenantAccount::getRevenue, revenue);
        }


        return wrapper;
    }
}
