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

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.wzj.soopin.order.domain.entity.OrderOperateHistory;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

@Data
@ApiModel(description="订单操作历史记录 查询 对象")
public class OrderOperateHistoryBo {

    @Schema(description = "订单号 精确匹配")
    private String orderSn;

    @Schema(description = "操作人：用户；系统；后台管理员 精确匹配")
    private String operateMan;

    @Schema(description = "订单状态：0->待付款；1->待发货；2->已发货；3->已完成；4->已关闭；5->无效订单 精确匹配")
    private Integer orderStatus;

    @Schema(description = "备注 精确匹配")
    private String note;

    public Wrapper<OrderOperateHistory> toWrapper() {
        return new LambdaQueryWrapper<OrderOperateHistory>()
            .eq(orderSn != null && !orderSn.isEmpty(), OrderOperateHistory::getOrderSn, orderSn)
            .eq(operateMan != null && !operateMan.isEmpty(), OrderOperateHistory::getOperateMan, operateMan)
            .eq(orderStatus != null, OrderOperateHistory::getOrderStatus, orderStatus)
            .eq(note != null && !note.isEmpty(), OrderOperateHistory::getNote, note);
    }

}
