/*
 * This file is generated by jOOQ.
 */
package ru.micord.ervu_dashboard.db_beans.ratings.tables;


import java.math.BigDecimal;
import java.sql.Date;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.UUID;

import org.jooq.Condition;
import org.jooq.Field;
import org.jooq.Name;
import org.jooq.PlainSQL;
import org.jooq.QueryPart;
import org.jooq.SQL;
import org.jooq.Schema;
import org.jooq.Select;
import org.jooq.Stringly;
import org.jooq.Table;
import org.jooq.TableField;
import org.jooq.TableOptions;
import org.jooq.UniqueKey;
import org.jooq.impl.DSL;
import org.jooq.impl.SQLDataType;
import org.jooq.impl.TableImpl;

import ru.micord.ervu_dashboard.db_beans.ratings.Keys;
import ru.micord.ervu_dashboard.db_beans.ratings.Ratings;
import ru.micord.ervu_dashboard.db_beans.ratings.tables.records.ConscriptionInfoRecord;


/**
 * Призыв уровень РФ
 */
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class ConscriptionInfo extends TableImpl<ConscriptionInfoRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of <code>ratings.conscription_info</code>
     */
    public static final ConscriptionInfo CONSCRIPTION_INFO = new ConscriptionInfo();

    /**
     * The class holding records for this type
     */
    @Override
    public Class<ConscriptionInfoRecord> getRecordType() {
        return ConscriptionInfoRecord.class;
    }

    /**
     * The column <code>ratings.conscription_info.conscription_info_id</code>.
     */
    public final TableField<ConscriptionInfoRecord, Long> CONSCRIPTION_INFO_ID = createField(DSL.name("conscription_info_id"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("nextval('ratings.\"ratings.conscription_info_id_ratings.conscription_info_seq\"'::regclass)"), SQLDataType.BIGINT)), this, "");

    /**
     * The column <code>ratings.conscription_info.execution</code>. Исполнение
     * плана призыва
     */
    public final TableField<ConscriptionInfoRecord, BigDecimal> EXECUTION = createField(DSL.name("execution"), SQLDataType.NUMERIC, this, "Исполнение плана призыва");

    /**
     * The column <code>ratings.conscription_info.spring_autumn</code>.
     * Осень/весна
     */
    public final TableField<ConscriptionInfoRecord, String> SPRING_AUTUMN = createField(DSL.name("spring_autumn"), SQLDataType.CLOB.nullable(false), this, "Осень/весна");

    /**
     * The column <code>ratings.conscription_info.recording_date</code>. Дата
     * записи
     */
    public final TableField<ConscriptionInfoRecord, Date> RECORDING_DATE = createField(DSL.name("recording_date"), SQLDataType.DATE.nullable(false).defaultValue(DSL.field(DSL.raw("(now())::date"), SQLDataType.DATE)), this, "Дата записи");

    /**
     * The column <code>ratings.conscription_info.execution_percent</code>.
     * Исолнение плана призыва в процентах
     */
    public final TableField<ConscriptionInfoRecord, BigDecimal> EXECUTION_PERCENT = createField(DSL.name("execution_percent"), SQLDataType.NUMERIC, this, "Исолнение плана призыва в процентах");

    /**
     * The column <code>ratings.conscription_info.recruitment_id</code>.
     */
    public final TableField<ConscriptionInfoRecord, UUID> RECRUITMENT_ID = createField(DSL.name("recruitment_id"), SQLDataType.UUID, this, "");

    /**
     * The column <code>ratings.conscription_info.id_region</code>.
     */
    public final TableField<ConscriptionInfoRecord, UUID> ID_REGION = createField(DSL.name("id_region"), SQLDataType.UUID.nullable(false), this, "");

    private ConscriptionInfo(Name alias, Table<ConscriptionInfoRecord> aliased) {
        this(alias, aliased, (Field<?>[]) null, null);
    }

    private ConscriptionInfo(Name alias, Table<ConscriptionInfoRecord> aliased, Field<?>[] parameters, Condition where) {
        super(alias, null, aliased, parameters, DSL.comment("Призыв уровень РФ"), TableOptions.table(), where);
    }

    /**
     * Create an aliased <code>ratings.conscription_info</code> table reference
     */
    public ConscriptionInfo(String alias) {
        this(DSL.name(alias), CONSCRIPTION_INFO);
    }

    /**
     * Create an aliased <code>ratings.conscription_info</code> table reference
     */
    public ConscriptionInfo(Name alias) {
        this(alias, CONSCRIPTION_INFO);
    }

    /**
     * Create a <code>ratings.conscription_info</code> table reference
     */
    public ConscriptionInfo() {
        this(DSL.name("conscription_info"), null);
    }

    @Override
    public Schema getSchema() {
        return aliased() ? null : Ratings.RATINGS;
    }

    @Override
    public UniqueKey<ConscriptionInfoRecord> getPrimaryKey() {
        return Keys.PK_CONSCRIPTION_INFO;
    }

    @Override
    public List<UniqueKey<ConscriptionInfoRecord>> getUniqueKeys() {
        return Arrays.asList(Keys.UNIQUE_REGION_DATE_SEASON);
    }

    @Override
    public ConscriptionInfo as(String alias) {
        return new ConscriptionInfo(DSL.name(alias), this);
    }

    @Override
    public ConscriptionInfo as(Name alias) {
        return new ConscriptionInfo(alias, this);
    }

    @Override
    public ConscriptionInfo as(Table<?> alias) {
        return new ConscriptionInfo(alias.getQualifiedName(), this);
    }

    /**
     * Rename this table
     */
    @Override
    public ConscriptionInfo rename(String name) {
        return new ConscriptionInfo(DSL.name(name), null);
    }

    /**
     * Rename this table
     */
    @Override
    public ConscriptionInfo rename(Name name) {
        return new ConscriptionInfo(name, null);
    }

    /**
     * Rename this table
     */
    @Override
    public ConscriptionInfo rename(Table<?> name) {
        return new ConscriptionInfo(name.getQualifiedName(), null);
    }

    /**
     * Create an inline derived table from this table
     */
    @Override
    public ConscriptionInfo where(Condition condition) {
        return new ConscriptionInfo(getQualifiedName(), aliased() ? this : null, null, condition);
    }

    /**
     * Create an inline derived table from this table
     */
    @Override
    public ConscriptionInfo where(Collection<? extends Condition> conditions) {
        return where(DSL.and(conditions));
    }

    /**
     * Create an inline derived table from this table
     */
    @Override
    public ConscriptionInfo where(Condition... conditions) {
        return where(DSL.and(conditions));
    }

    /**
     * Create an inline derived table from this table
     */
    @Override
    public ConscriptionInfo where(Field<Boolean> condition) {
        return where(DSL.condition(condition));
    }

    /**
     * Create an inline derived table from this table
     */
    @Override
    @PlainSQL
    public ConscriptionInfo where(SQL condition) {
        return where(DSL.condition(condition));
    }

    /**
     * Create an inline derived table from this table
     */
    @Override
    @PlainSQL
    public ConscriptionInfo where(@Stringly.SQL String condition) {
        return where(DSL.condition(condition));
    }

    /**
     * Create an inline derived table from this table
     */
    @Override
    @PlainSQL
    public ConscriptionInfo where(@Stringly.SQL String condition, Object... binds) {
        return where(DSL.condition(condition, binds));
    }

    /**
     * Create an inline derived table from this table
     */
    @Override
    @PlainSQL
    public ConscriptionInfo where(@Stringly.SQL String condition, QueryPart... parts) {
        return where(DSL.condition(condition, parts));
    }

    /**
     * Create an inline derived table from this table
     */
    @Override
    public ConscriptionInfo whereExists(Select<?> select) {
        return where(DSL.exists(select));
    }

    /**
     * Create an inline derived table from this table
     */
    @Override
    public ConscriptionInfo whereNotExists(Select<?> select) {
        return where(DSL.notExists(select));
    }
}
