package com.prolog.rdc.tms.config.enums;

import lombok.Getter;
import lombok.Setter;

/**
 *
 * 查询逻辑操作符 ENUM
 *
 *
 * @version :1.0.0
 * @className: QueryLogicalOperatorEnum
 * @author: kh
 * @creationTime: 2022/1/20 15:34
 * @description:
 * @modifier:
 * @modifyTime:
 * @reviseRemarks:
 */
public enum QueryLogicalOperatorEnum {

	AND(1, "and"), OR(2, "or");

	@Getter
	@Setter
	Integer code;
	@Getter
	@Setter
	String operator;

	QueryLogicalOperatorEnum(Integer code, String operator) {
		this.code = code;
		this.operator = operator;
	}

	public static QueryLogicalOperatorEnum get(Integer code) {
		for (QueryLogicalOperatorEnum value : values()) {
			if (value.getCode().equals(code)) {
				return value;
			}
		}
		return null;
	}
}
