/*
 * This file is generated by jOOQ.
 */
package ervu_dashboard.ervu_dashboard.db_beans.main_dashboard.tables;


import ervu_dashboard.ervu_dashboard.db_beans.main_dashboard.Keys;
import ervu_dashboard.ervu_dashboard.db_beans.main_dashboard.MainDashboard;
import ervu_dashboard.ervu_dashboard.db_beans.main_dashboard.tables.records.RecruitmentCampaignRecord;
import ervu_dashboard.ervu_dashboard.db_beans.public_.tables.PubRecruitment.PubRecruitmentPath;

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.ForeignKey;
import org.jooq.Identity;
import org.jooq.InverseForeignKey;
import org.jooq.Name;
import org.jooq.Path;
import org.jooq.PlainSQL;
import org.jooq.QueryPart;
import org.jooq.Record;
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;


/**
 * Призывная кампания уровень РФ
 */
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class RecruitmentCampaign extends TableImpl<RecruitmentCampaignRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of
     * <code>main_dashboard.recruitment_campaign</code>
     */
    public static final RecruitmentCampaign RECRUITMENT_CAMPAIGN = new RecruitmentCampaign();

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

    /**
     * The column
     * <code>main_dashboard.recruitment_campaign.id_recruitment_campaign</code>.
     */
    public final TableField<RecruitmentCampaignRecord, Long> ID_RECRUITMENT_CAMPAIGN = createField(DSL.name("id_recruitment_campaign"), SQLDataType.BIGINT.nullable(false).identity(true), this, "");

    /**
     * The column <code>main_dashboard.recruitment_campaign.new_recruits</code>.
     * Подпадающие под призыв
     */
    public final TableField<RecruitmentCampaignRecord, BigDecimal> NEW_RECRUITS = createField(DSL.name("new_recruits"), SQLDataType.NUMERIC, this, "Подпадающие под призыв");

    /**
     * The column
     * <code>main_dashboard.recruitment_campaign.subpoenas_sent</code>.
     * Направлено повесток
     */
    public final TableField<RecruitmentCampaignRecord, BigDecimal> SUBPOENAS_SENT = createField(DSL.name("subpoenas_sent"), SQLDataType.NUMERIC, this, "Направлено повесток");

    /**
     * The column
     * <code>main_dashboard.recruitment_campaign.appeared_on_subpoenas</code>.
     * Явились по повесткам
     */
    public final TableField<RecruitmentCampaignRecord, BigDecimal> APPEARED_ON_SUBPOENAS = createField(DSL.name("appeared_on_subpoenas"), SQLDataType.NUMERIC, this, "Явились по повесткам");

    /**
     * The column
     * <code>main_dashboard.recruitment_campaign.not_appeared_on_subpoenas</code>.
     * Не явились по повесткам
     */
    public final TableField<RecruitmentCampaignRecord, BigDecimal> NOT_APPEARED_ON_SUBPOENAS = createField(DSL.name("not_appeared_on_subpoenas"), SQLDataType.NUMERIC, this, "Не явились по повесткам");

    /**
     * The column
     * <code>main_dashboard.recruitment_campaign.postponement_have_right</code>.
     * Имеют право на отсрочку
     */
    public final TableField<RecruitmentCampaignRecord, BigDecimal> POSTPONEMENT_HAVE_RIGHT = createField(DSL.name("postponement_have_right"), SQLDataType.NUMERIC, this, "Имеют право на отсрочку");

    /**
     * The column
     * <code>main_dashboard.recruitment_campaign.postponement_granted</code>.
     * Предоставлена отсрочка
     */
    public final TableField<RecruitmentCampaignRecord, BigDecimal> POSTPONEMENT_GRANTED = createField(DSL.name("postponement_granted"), SQLDataType.NUMERIC, this, "Предоставлена отсрочка");

    /**
     * The column
     * <code>main_dashboard.recruitment_campaign.recording_date</code>. Дата
     * записи
     */
    public final TableField<RecruitmentCampaignRecord, Date> RECORDING_DATE = createField(DSL.name("recording_date"), SQLDataType.DATE.defaultValue(DSL.field(DSL.raw("now()"), SQLDataType.DATE)), this, "Дата записи");

    /**
     * The column
     * <code>main_dashboard.recruitment_campaign.spring_autumn</code>.
     * Весна/Осень
     */
    public final TableField<RecruitmentCampaignRecord, String> SPRING_AUTUMN = createField(DSL.name("spring_autumn"), SQLDataType.CLOB, this, "Весна/Осень");

    /**
     * The column
     * <code>main_dashboard.recruitment_campaign.appeared_on_subpoenas_percent</code>.
     * Явились по повесткам процент
     */
    public final TableField<RecruitmentCampaignRecord, BigDecimal> APPEARED_ON_SUBPOENAS_PERCENT = createField(DSL.name("appeared_on_subpoenas_percent"), SQLDataType.NUMERIC, this, "Явились по повесткам процент");

    /**
     * The column
     * <code>main_dashboard.recruitment_campaign.not_appeared_on_subpoenas_percent</code>.
     * Не явились по повесткам процент
     */
    public final TableField<RecruitmentCampaignRecord, BigDecimal> NOT_APPEARED_ON_SUBPOENAS_PERCENT = createField(DSL.name("not_appeared_on_subpoenas_percent"), SQLDataType.NUMERIC, this, "Не явились по повесткам процент");

    /**
     * The column
     * <code>main_dashboard.recruitment_campaign.postponement_have_right_percent</code>.
     * Имеют право на отсрочку процент
     */
    public final TableField<RecruitmentCampaignRecord, BigDecimal> POSTPONEMENT_HAVE_RIGHT_PERCENT = createField(DSL.name("postponement_have_right_percent"), SQLDataType.NUMERIC, this, "Имеют право на отсрочку процент");

    /**
     * The column
     * <code>main_dashboard.recruitment_campaign.postponement_granted_percent</code>.
     * Предоставлена отсрочка процент
     */
    public final TableField<RecruitmentCampaignRecord, BigDecimal> POSTPONEMENT_GRANTED_PERCENT = createField(DSL.name("postponement_granted_percent"), SQLDataType.NUMERIC, this, "Предоставлена отсрочка процент");

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

    /**
     * The column
     * <code>main_dashboard.recruitment_campaign.testrecruitment_id</code>.
     */
    public final TableField<RecruitmentCampaignRecord, String> TESTRECRUITMENT_ID = createField(DSL.name("testrecruitment_id"), SQLDataType.CHAR(36), this, "");

    /**
     * The column
     * <code>main_dashboard.recruitment_campaign.testspring_autumn</code>.
     */
    public final TableField<RecruitmentCampaignRecord, String> TESTSPRING_AUTUMN = createField(DSL.name("testspring_autumn"), SQLDataType.CHAR(36), this, "");

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

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

    /**
     * Create an aliased <code>main_dashboard.recruitment_campaign</code> table
     * reference
     */
    public RecruitmentCampaign(String alias) {
        this(DSL.name(alias), RECRUITMENT_CAMPAIGN);
    }

    /**
     * Create an aliased <code>main_dashboard.recruitment_campaign</code> table
     * reference
     */
    public RecruitmentCampaign(Name alias) {
        this(alias, RECRUITMENT_CAMPAIGN);
    }

    /**
     * Create a <code>main_dashboard.recruitment_campaign</code> table reference
     */
    public RecruitmentCampaign() {
        this(DSL.name("recruitment_campaign"), null);
    }

    public <O extends Record> RecruitmentCampaign(Table<O> path, ForeignKey<O, RecruitmentCampaignRecord> childPath, InverseForeignKey<O, RecruitmentCampaignRecord> parentPath) {
        super(path, childPath, parentPath, RECRUITMENT_CAMPAIGN);
    }

    /**
     * A subtype implementing {@link Path} for simplified path-based joins.
     */
    public static class RecruitmentCampaignPath extends RecruitmentCampaign implements Path<RecruitmentCampaignRecord> {
        public <O extends Record> RecruitmentCampaignPath(Table<O> path, ForeignKey<O, RecruitmentCampaignRecord> childPath, InverseForeignKey<O, RecruitmentCampaignRecord> parentPath) {
            super(path, childPath, parentPath);
        }
        private RecruitmentCampaignPath(Name alias, Table<RecruitmentCampaignRecord> aliased) {
            super(alias, aliased);
        }

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

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

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

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

    @Override
    public Identity<RecruitmentCampaignRecord, Long> getIdentity() {
        return (Identity<RecruitmentCampaignRecord, Long>) super.getIdentity();
    }

    @Override
    public UniqueKey<RecruitmentCampaignRecord> getPrimaryKey() {
        return Keys.PK_RECRUITMENT_CAMPAIGN;
    }

    @Override
    public List<ForeignKey<RecruitmentCampaignRecord, ?>> getReferences() {
        return Arrays.asList(Keys.RECRUITMENT_CAMPAIGN__RECRUITMENT_CAMPAIGN_FK1);
    }

    private transient PubRecruitmentPath _pubRecruitment;

    /**
     * Get the implicit join path to the <code>public.pub_recruitment</code>
     * table.
     */
    public PubRecruitmentPath pubRecruitment() {
        if (_pubRecruitment == null)
            _pubRecruitment = new PubRecruitmentPath(this, Keys.RECRUITMENT_CAMPAIGN__RECRUITMENT_CAMPAIGN_FK1, null);

        return _pubRecruitment;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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