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

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

/**
 * 会员银行卡信息
 *
 */
@Schema(description="银行卡")
@Data
public class MemberBankBO extends BaseBO<MemberBank> {

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

    @Schema(description ="银行名称")
    private String name;

    @Schema(description ="银行卡号")
    private String code;

    @Schema(description ="开户行")
    private String address;

    @Schema(description ="会员ID")
    private Long memberId;


    @Override
    public LambdaQueryWrapper<MemberBank> toWrapper() {
        return super.toWrapper().eq(id!=null, MemberBank::getId, id)
            .like(name!=null, MemberBank::getName, name)
            .eq(memberId!=null, MemberBank::getMemberId, memberId)
            .like(code!=null, MemberBank::getCode, code)
            .like(address!=null, MemberBank::getAddress, address);
    }
}
