package cd.casic.framework.mongo.core.entity;


import cd.casic.framework.mongo.core.constant.ECompare;
import cd.casic.framework.mongo.core.constant.EConditionType;
import cd.casic.framework.mongo.core.wrapper.ConditionWrapper;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Map;

@Data
@NoArgsConstructor
public class Condition {
    /**
     * 嵌套比较类型
     * */
    private EConditionType conditionType = EConditionType.AND;
    /**
     * 比较类型
     * */
    private ECompare type;

    /**
     * 集合对应的列
     * */
    private String column;

    /**
     * 比较值
     * */
    private Map<String,Object> args;

    private ConditionWrapper conditionWrapper;

    public Condition(ECompare type, String column, Map<String,Object> args){
        this.type = type;
        this.column = column;
        this.args = args;
    }

    public Condition(ECompare type, String column){
        this.type = type;
        this.column = column;
    }
}
