/*
 * 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.RegMilCatRecord;

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 RegMilCat extends TableImpl<RegMilCatRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of <code>total_registered.reg_mil_cat</code>
     */
    public static final RegMilCat REG_MIL_CAT = new RegMilCat();

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

    /**
     * The column <code>total_registered.reg_mil_cat.id_reg_mil_cat</code>.
     */
    public final TableField<RegMilCatRecord, Long> ID_REG_MIL_CAT = createField(DSL.name("id_reg_mil_cat"), SQLDataType.BIGINT.nullable(false).identity(true), this, "");

    /**
     * The column <code>total_registered.reg_mil_cat.first_reg_17</code>.
     * Первоначальная постановка на воинский учет граждан от 17 лет
     */
    public final TableField<RegMilCatRecord, BigDecimal> FIRST_REG_17 = createField(DSL.name("first_reg_17"), SQLDataType.NUMERIC, this, "Первоначальная постановка на воинский учет граждан от 17 лет");

    /**
     * The column <code>total_registered.reg_mil_cat.first_reg_18</code>.
     * Первоначальная постановка на воинский учет граждан от 18 лет
     */
    public final TableField<RegMilCatRecord, BigDecimal> FIRST_REG_18 = createField(DSL.name("first_reg_18"), SQLDataType.NUMERIC, this, "Первоначальная постановка на воинский учет граждан от 18 лет");

    /**
     * The column
     * <code>total_registered.reg_mil_cat.returned_dep_liberty</code>.
     * Возвратившиеся из мест лишения свободы
     */
    public final TableField<RegMilCatRecord, BigDecimal> RETURNED_DEP_LIBERTY = createField(DSL.name("returned_dep_liberty"), SQLDataType.NUMERIC, this, "Возвратившиеся из мест лишения свободы");

    /**
     * The column <code>total_registered.reg_mil_cat.mil_spec_W</code>. Женщины,
     * получившие ВУС
     */
    public final TableField<RegMilCatRecord, BigDecimal> MIL_SPEC_W = createField(DSL.name("mil_spec_W"), SQLDataType.NUMERIC, this, "Женщины, получившие ВУС");

    /**
     * The column <code>total_registered.reg_mil_cat.punished</code>. Отбывающие
     * наказание в местах лишения свободы
     */
    public final TableField<RegMilCatRecord, BigDecimal> PUNISHED = createField(DSL.name("punished"), SQLDataType.NUMERIC, this, "Отбывающие наказание в местах лишения свободы");

    /**
     * The column
     * <code>total_registered.reg_mil_cat.received_citizenship</code>.
     * Получившие гражданство
     */
    public final TableField<RegMilCatRecord, BigDecimal> RECEIVED_CITIZENSHIP = createField(DSL.name("received_citizenship"), SQLDataType.NUMERIC, this, "Получившие гражданство");

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

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

    /**
     * The column
     * <code>total_registered.reg_mil_cat.first_reg_17_percent</code>.
     * Первоначальная постановка на воинский учет граждан от 17 лет в процентах
     */
    public final TableField<RegMilCatRecord, BigDecimal> FIRST_REG_17_PERCENT = createField(DSL.name("first_reg_17_percent"), SQLDataType.NUMERIC, this, "Первоначальная постановка на воинский учет граждан от 17 лет в процентах");

    /**
     * The column
     * <code>total_registered.reg_mil_cat.first_reg_18_percent</code>.
     * Первоначальная постановка на воинский учет граждан от 18 лет в процентах
     */
    public final TableField<RegMilCatRecord, BigDecimal> FIRST_REG_18_PERCENT = createField(DSL.name("first_reg_18_percent"), SQLDataType.NUMERIC, this, "Первоначальная постановка на воинский учет граждан от 18 лет в процентах");

    /**
     * The column
     * <code>total_registered.reg_mil_cat.returned_dep_liberty_percent</code>.
     * Возвратившиеся из мест лишения свободы в процентах
     */
    public final TableField<RegMilCatRecord, BigDecimal> RETURNED_DEP_LIBERTY_PERCENT = createField(DSL.name("returned_dep_liberty_percent"), SQLDataType.NUMERIC, this, "Возвратившиеся из мест лишения свободы в процентах");

    /**
     * The column <code>total_registered.reg_mil_cat.mil_spec_W_percent</code>.
     * Женщины, получившие ВУС в процентах
     */
    public final TableField<RegMilCatRecord, BigDecimal> MIL_SPEC_W_PERCENT = createField(DSL.name("mil_spec_W_percent"), SQLDataType.NUMERIC, this, "Женщины, получившие ВУС в процентах");

    /**
     * The column <code>total_registered.reg_mil_cat.punished_percent</code>.
     * Отбывающие наказание в местах лишения свободы в процентах
     */
    public final TableField<RegMilCatRecord, BigDecimal> PUNISHED_PERCENT = createField(DSL.name("punished_percent"), SQLDataType.NUMERIC, this, "Отбывающие наказание в местах лишения свободы в процентах");

    /**
     * The column
     * <code>total_registered.reg_mil_cat.received_citizenship_percent</code>.
     * Получившие гражданство в процентах
     */
    public final TableField<RegMilCatRecord, BigDecimal> RECEIVED_CITIZENSHIP_PERCENT = createField(DSL.name("received_citizenship_percent"), SQLDataType.NUMERIC, this, "Получившие гражданство в процентах");

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

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

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

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

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

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

    /**
     * Create an aliased <code>total_registered.reg_mil_cat</code> table
     * reference
     */
    public RegMilCat(Name alias) {
        this(alias, REG_MIL_CAT);
    }

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

    public <O extends Record> RegMilCat(Table<O> path, ForeignKey<O, RegMilCatRecord> childPath, InverseForeignKey<O, RegMilCatRecord> parentPath) {
        super(path, childPath, parentPath, REG_MIL_CAT);
    }

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

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

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

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

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

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

    @Override
    public UniqueKey<RegMilCatRecord> getPrimaryKey() {
        return Keys.PK_REG_MIL_CAT;
    }

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

        return _pubRecruitment;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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