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

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.wzj.soopin.member.domain.po.MemberBank;
import com.wzj.soopin.member.domain.po.MemberForbidden;
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 MemberForbiddenBO extends BaseBO<MemberForbidden> {

    @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 memberId;

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