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

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

import java.time.LocalDateTime;

/**
 * 店铺封禁记录
 */
@Schema(description = "店铺封禁记录")
@Data
public class TenantForbiddenBO extends BaseBO<TenantForbidden> {

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

    @Schema(description = "次数")
    private Integer times;

    @Schema(description = "原因")
    private Integer reason;

    @Schema(description = "时长")
    private Integer duration;

    @Schema(description = "单位")
    private Integer unit;

    @Schema(description = "开始时间")
    private LocalDateTime startTime;


    @Schema(description = "结束时间")
    private LocalDateTime endTime;

    @Schema(description = "店铺id")
    private Long tenantId;

    @Schema(description = "店铺名称")
    private String tenantName;

    @Override
    public LambdaQueryWrapper<TenantForbidden> toWrapper() {
        return super.toWrapper().eq(id != null, TenantForbidden::getId, id)
            .eq(tenantId != null, TenantForbidden::getTenantId, tenantId)
            .eq(times != null, TenantForbidden::getTimes, times)
            .eq(reason != null, TenantForbidden::getReason, reason)
            .eq(duration != null, TenantForbidden::getDuration, duration)
            .eq(unit != null, TenantForbidden::getUnit, unit);
    }
}
