/*
 * 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.WaitingRegistrationRecord;
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 WaitingRegistration extends TableImpl<WaitingRegistrationRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of
     * <code>main_dashboard.waiting_registration</code>
     */
    public static final WaitingRegistration WAITING_REGISTRATION = new WaitingRegistration();

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

    /**
     * The column
     * <code>main_dashboard.waiting_registration.id_waiting_registration</code>.
     */
    public final TableField<WaitingRegistrationRecord, Long> ID_WAITING_REGISTRATION = createField(DSL.name("id_waiting_registration"), SQLDataType.BIGINT.nullable(false).identity(true), this, "");

    /**
     * The column
     * <code>main_dashboard.waiting_registration.waiting_registration</code>.
     * Всего подлежат постановке на учет
     */
    public final TableField<WaitingRegistrationRecord, BigDecimal> WAITING_REGISTRATION_ = createField(DSL.name("waiting_registration"), SQLDataType.NUMERIC, this, "Всего подлежат постановке на учет");

    /**
     * The column
     * <code>main_dashboard.waiting_registration.waiting_registration_M</code>.
     * Подлежат постановке мужчины
     */
    public final TableField<WaitingRegistrationRecord, BigDecimal> WAITING_REGISTRATION_M = createField(DSL.name("waiting_registration_M"), SQLDataType.NUMERIC, this, "Подлежат постановке мужчины");

    /**
     * The column
     * <code>main_dashboard.waiting_registration.waiting_registration_W</code>.
     * Подлежат постановке женщины
     */
    public final TableField<WaitingRegistrationRecord, BigDecimal> WAITING_REGISTRATION_W = createField(DSL.name("waiting_registration_W"), SQLDataType.NUMERIC, this, "Подлежат постановке женщины");

    /**
     * The column
     * <code>main_dashboard.waiting_registration.mobilization_criterion</code>.
     * Количество подлежащих под критерии мобилизации
     */
    public final TableField<WaitingRegistrationRecord, BigDecimal> MOBILIZATION_CRITERION = createField(DSL.name("mobilization_criterion"), SQLDataType.NUMERIC, this, "Количество подлежащих под критерии мобилизации");

    /**
     * The column
     * <code>main_dashboard.waiting_registration.volunteer_criterion</code>.
     * Количество подлежащих под критерии добровольной службы
     */
    public final TableField<WaitingRegistrationRecord, BigDecimal> VOLUNTEER_CRITERION = createField(DSL.name("volunteer_criterion"), SQLDataType.NUMERIC, this, "Количество подлежащих под критерии добровольной службы");

    /**
     * The column
     * <code>main_dashboard.waiting_registration.contract_criterion</code>.
     * Количество подлежащих под критерии контрактной службы
     */
    public final TableField<WaitingRegistrationRecord, BigDecimal> CONTRACT_CRITERION = createField(DSL.name("contract_criterion"), SQLDataType.NUMERIC, this, "Количество подлежащих под критерии контрактной службы");

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

    /**
     * The column
     * <code>main_dashboard.waiting_registration.waiting_registration_percent</code>.
     * Всего подлежат постановке процент
     */
    public final TableField<WaitingRegistrationRecord, BigDecimal> WAITING_REGISTRATION_PERCENT = createField(DSL.name("waiting_registration_percent"), SQLDataType.NUMERIC, this, "Всего подлежат постановке процент");

    /**
     * The column
     * <code>main_dashboard.waiting_registration.mobilization_criterion_percent</code>.
     * Процент подлежащих под критерии мобилизации
     */
    public final TableField<WaitingRegistrationRecord, BigDecimal> MOBILIZATION_CRITERION_PERCENT = createField(DSL.name("mobilization_criterion_percent"), SQLDataType.NUMERIC, this, "Процент подлежащих под критерии мобилизации");

    /**
     * The column
     * <code>main_dashboard.waiting_registration.volunteer_criterion_percent</code>.
     * Процент подлежащих под критерии добровольной службы
     */
    public final TableField<WaitingRegistrationRecord, BigDecimal> VOLUNTEER_CRITERION_PERCENT = createField(DSL.name("volunteer_criterion_percent"), SQLDataType.NUMERIC, this, "Процент подлежащих под критерии добровольной службы");

    /**
     * The column
     * <code>main_dashboard.waiting_registration.contract_criterion_percent</code>.
     * Процент подлежащих под критерии контрактной службы
     */
    public final TableField<WaitingRegistrationRecord, BigDecimal> CONTRACT_CRITERION_PERCENT = createField(DSL.name("contract_criterion_percent"), SQLDataType.NUMERIC, this, "Процент подлежащих под критерии контрактной службы");

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

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

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

    private WaitingRegistration(Name alias, Table<WaitingRegistrationRecord> aliased, Field<?>[] parameters, Condition where) {
        super(alias, null, aliased, parameters, DSL.comment("Подлежат постановке на учет уровень РФ"), TableOptions.table(), where);
    }

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

    /**
     * Create an aliased <code>main_dashboard.waiting_registration</code> table
     * reference
     */
    public WaitingRegistration(Name alias) {
        this(alias, WAITING_REGISTRATION);
    }

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

    public <O extends Record> WaitingRegistration(Table<O> path, ForeignKey<O, WaitingRegistrationRecord> childPath, InverseForeignKey<O, WaitingRegistrationRecord> parentPath) {
        super(path, childPath, parentPath, WAITING_REGISTRATION);
    }

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

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

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

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

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

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

    @Override
    public UniqueKey<WaitingRegistrationRecord> getPrimaryKey() {
        return Keys.PK_WAITING_REGISTRATION;
    }

    @Override
    public List<ForeignKey<WaitingRegistrationRecord, ?>> getReferences() {
        return Arrays.asList(Keys.WAITING_REGISTRATION__MD_WAITING_REGISTRATION_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.WAITING_REGISTRATION__MD_WAITING_REGISTRATION_FK1, null);

        return _pubRecruitment;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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