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


import ervu_dashboard.ervu_dashboard.db_beans.public_.tables.PubRecruitment.PubRecruitmentPath;
import ervu_dashboard.ervu_dashboard.db_beans.total_registered.Keys;
import ervu_dashboard.ervu_dashboard.db_beans.total_registered.TotalRegistered;
import ervu_dashboard.ervu_dashboard.db_beans.total_registered.tables.records.SubpoenasRecord;

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 Subpoenas extends TableImpl<SubpoenasRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of <code>total_registered.subpoenas</code>
     */
    public static final Subpoenas SUBPOENAS = new Subpoenas();

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

    /**
     * The column <code>total_registered.subpoenas.id_subpoena</code>.
     */
    public final TableField<SubpoenasRecord, Long> ID_SUBPOENA = createField(DSL.name("id_subpoena"), SQLDataType.BIGINT.nullable(false).identity(true), this, "");

    /**
     * The column <code>total_registered.subpoenas.subpoena</code>. Направлено
     * повесток
     */
    public final TableField<SubpoenasRecord, BigDecimal> SUBPOENA = createField(DSL.name("subpoena"), SQLDataType.NUMERIC, this, "Направлено повесток");

    /**
     * The column <code>total_registered.subpoenas.average_appeared</code>.
     * Средний срок явки
     */
    public final TableField<SubpoenasRecord, BigDecimal> AVERAGE_APPEARED = createField(DSL.name("average_appeared"), SQLDataType.NUMERIC, this, "Средний срок явки");

    /**
     * The column <code>total_registered.subpoenas.appeared</code>. Явились
     */
    public final TableField<SubpoenasRecord, BigDecimal> APPEARED = createField(DSL.name("appeared"), SQLDataType.NUMERIC, this, "Явились");

    /**
     * The column <code>total_registered.subpoenas.not_appeared</code>. Не
     * явились
     */
    public final TableField<SubpoenasRecord, BigDecimal> NOT_APPEARED = createField(DSL.name("not_appeared"), SQLDataType.NUMERIC, this, "Не явились");

    /**
     * The column <code>total_registered.subpoenas.not_ap_good_reason</code>. Не
     * явились по уважительной причине
     */
    public final TableField<SubpoenasRecord, BigDecimal> NOT_AP_GOOD_REASON = createField(DSL.name("not_ap_good_reason"), SQLDataType.NUMERIC, this, "Не явились по уважительной причине");

    /**
     * The column <code>total_registered.subpoenas.ap_not_required</code>. Явка
     * не требуется
     */
    public final TableField<SubpoenasRecord, BigDecimal> AP_NOT_REQUIRED = createField(DSL.name("ap_not_required"), SQLDataType.NUMERIC, this, "Явка не требуется");

    /**
     * The column <code>total_registered.subpoenas.electron</code>. Электронно
     */
    public final TableField<SubpoenasRecord, BigDecimal> ELECTRON = createField(DSL.name("electron"), SQLDataType.NUMERIC, this, "Электронно");

    /**
     * The column <code>total_registered.subpoenas.paper</code>. Нарочно
     */
    public final TableField<SubpoenasRecord, BigDecimal> PAPER = createField(DSL.name("paper"), SQLDataType.NUMERIC, this, "Нарочно");

    /**
     * The column <code>total_registered.subpoenas.restrictions_applied</code>.
     * Применено ограничений
     */
    public final TableField<SubpoenasRecord, BigDecimal> RESTRICTIONS_APPLIED = createField(DSL.name("restrictions_applied"), SQLDataType.NUMERIC, this, "Применено ограничений");

    /**
     * The column <code>total_registered.subpoenas.introduced_measures</code>.
     * Введено реализатором мер
     */
    public final TableField<SubpoenasRecord, BigDecimal> INTRODUCED_MEASURES = createField(DSL.name("introduced_measures"), SQLDataType.NUMERIC, this, "Введено реализатором мер");

    /**
     * The column <code>total_registered.subpoenas.mil_reg</code>. Состоит/не
     * состоит на учете
     */
    public final TableField<SubpoenasRecord, Boolean> MIL_REG = createField(DSL.name("mil_reg"), SQLDataType.BOOLEAN, this, "Состоит/не состоит на учете");

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

    /**
     * The column <code>total_registered.subpoenas.appeared_percent</code>.
     * Явились в процентах
     */
    public final TableField<SubpoenasRecord, BigDecimal> APPEARED_PERCENT = createField(DSL.name("appeared_percent"), SQLDataType.NUMERIC, this, "Явились в процентах");

    /**
     * The column <code>total_registered.subpoenas.not_appeared_percent</code>.
     * Не явились в процентах
     */
    public final TableField<SubpoenasRecord, BigDecimal> NOT_APPEARED_PERCENT = createField(DSL.name("not_appeared_percent"), SQLDataType.NUMERIC, this, "Не явились в процентах");

    /**
     * The column
     * <code>total_registered.subpoenas.not_ap_good_reason_percent</code>. Не
     * явились по уважительной причине в процентах
     */
    public final TableField<SubpoenasRecord, BigDecimal> NOT_AP_GOOD_REASON_PERCENT = createField(DSL.name("not_ap_good_reason_percent"), SQLDataType.NUMERIC, this, "Не явились по уважительной причине в процентах");

    /**
     * The column
     * <code>total_registered.subpoenas.ap_not_required_percent</code>. Явка не
     * требуется в процентах
     */
    public final TableField<SubpoenasRecord, BigDecimal> AP_NOT_REQUIRED_PERCENT = createField(DSL.name("ap_not_required_percent"), SQLDataType.NUMERIC, this, "Явка не требуется в процентах");

    /**
     * The column <code>total_registered.subpoenas.electron_percent</code>.
     * Электронно в процентах
     */
    public final TableField<SubpoenasRecord, BigDecimal> ELECTRON_PERCENT = createField(DSL.name("electron_percent"), SQLDataType.NUMERIC, this, "Электронно в процентах");

    /**
     * The column <code>total_registered.subpoenas.paper_percent</code>. Нарочно
     * в процентах
     */
    public final TableField<SubpoenasRecord, BigDecimal> PAPER_PERCENT = createField(DSL.name("paper_percent"), SQLDataType.NUMERIC, this, "Нарочно в процентах");

    /**
     * The column
     * <code>total_registered.subpoenas.restrictions_applied_percent</code>.
     * Применено ограничений в процентах
     */
    public final TableField<SubpoenasRecord, BigDecimal> RESTRICTIONS_APPLIED_PERCENT = createField(DSL.name("restrictions_applied_percent"), SQLDataType.NUMERIC, this, "Применено ограничений в процентах");

    /**
     * The column
     * <code>total_registered.subpoenas.introduced_measures_percent</code>.
     * Введено реализатором мер в процентах
     */
    public final TableField<SubpoenasRecord, BigDecimal> INTRODUCED_MEASURES_PERCENT = createField(DSL.name("introduced_measures_percent"), SQLDataType.NUMERIC, this, "Введено реализатором мер в процентах");

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

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

    /**
     * The column <code>total_registered.subpoenas.testmil_reg</code>.
     */
    public final TableField<SubpoenasRecord, BigDecimal> TESTMIL_REG = createField(DSL.name("testmil_reg"), SQLDataType.NUMERIC, this, "");

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

    private Subpoenas(Name alias, Table<SubpoenasRecord> aliased, Field<?>[] parameters, Condition where) {
        super(alias, null, aliased, parameters, DSL.comment("Повестки состоящих/не состоящих на учете уровень РФ"), TableOptions.table(), where);
    }

    /**
     * Create an aliased <code>total_registered.subpoenas</code> table reference
     */
    public Subpoenas(String alias) {
        this(DSL.name(alias), SUBPOENAS);
    }

    /**
     * Create an aliased <code>total_registered.subpoenas</code> table reference
     */
    public Subpoenas(Name alias) {
        this(alias, SUBPOENAS);
    }

    /**
     * Create a <code>total_registered.subpoenas</code> table reference
     */
    public Subpoenas() {
        this(DSL.name("subpoenas"), null);
    }

    public <O extends Record> Subpoenas(Table<O> path, ForeignKey<O, SubpoenasRecord> childPath, InverseForeignKey<O, SubpoenasRecord> parentPath) {
        super(path, childPath, parentPath, SUBPOENAS);
    }

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

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

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

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

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

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

    @Override
    public UniqueKey<SubpoenasRecord> getPrimaryKey() {
        return Keys.PK_SUBPOENA;
    }

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

        return _pubRecruitment;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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