package com.chushang.common.mybatis.annotation;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import static com.chushang.common.mybatis.annotation.Condition.ConditionType.*;

@Target({ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
public @interface Condition {

    String name();

    String tableName() default "";

    /**
     * 用于 批量获取
     * @return
     */
    ConditionType type() default eq;

    enum ConditionType {
        ge,
        le,
        gt,
        lt,
        isNull,
        eq,
        like,
        in,
        between,
        likeLeft,
        dataScope,
        or_eq,
        or_like,
        or_likeLeft
    }
}
