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


import java.math.BigDecimal;
import java.sql.Date;
import java.util.Collection;
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.total_registered.Keys;
import ru.micord.ervu_dashboard.db_beans.total_registered.TotalRegistered;
import ru.micord.ervu_dashboard.db_beans.total_registered.tables.records.BusynessRecord;


/**
 * Занятость состоящих/не состоящих, мужчин/женщин/всех на учете уровень РФ
 */
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class Busyness extends TableImpl<BusynessRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of <code>total_registered.busyness</code>
     */
    public static final Busyness BUSYNESS = new Busyness();

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

    /**
     * The column <code>total_registered.busyness.study</code>. Учатся
     */
    public final TableField<BusynessRecord, BigDecimal> STUDY = createField(DSL.name("study"), SQLDataType.NUMERIC, this, "Учатся");

    /**
     * The column <code>total_registered.busyness.work</code>. Работают
     */
    public final TableField<BusynessRecord, BigDecimal> WORK = createField(DSL.name("work"), SQLDataType.NUMERIC, this, "Работают");

    /**
     * The column <code>total_registered.busyness.not_work</code>. Безработные
     */
    public final TableField<BusynessRecord, BigDecimal> NOT_WORK = createField(DSL.name("not_work"), SQLDataType.NUMERIC, this, "Безработные");

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

    /**
     * The column <code>total_registered.busyness.study_percent</code>. Учатся в
     * процентах
     */
    public final TableField<BusynessRecord, BigDecimal> STUDY_PERCENT = createField(DSL.name("study_percent"), SQLDataType.NUMERIC, this, "Учатся в процентах");

    /**
     * The column <code>total_registered.busyness.work_percent</code>. Работают
     * в процентах
     */
    public final TableField<BusynessRecord, BigDecimal> WORK_PERCENT = createField(DSL.name("work_percent"), SQLDataType.NUMERIC, this, "Работают в процентах");

    /**
     * The column <code>total_registered.busyness.not_work_percent</code>.
     * Безработные в процентах
     */
    public final TableField<BusynessRecord, BigDecimal> NOT_WORK_PERCENT = createField(DSL.name("not_work_percent"), SQLDataType.NUMERIC, this, "Безработные в процентах");

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

    /**
     * The column <code>total_registered.busyness.registered</code>.
     */
    public final TableField<BusynessRecord, String> REGISTERED = createField(DSL.name("registered"), SQLDataType.VARCHAR.nullable(false), this, "");

    /**
     * The column <code>total_registered.busyness.all_M_W</code>.
     */
    public final TableField<BusynessRecord, String> ALL_M_W = createField(DSL.name("all_M_W"), SQLDataType.VARCHAR.nullable(false), this, "");

    /**
     * The column <code>total_registered.busyness.busyness</code>.
     */
    public final TableField<BusynessRecord, BigDecimal> BUSYNESS_ = createField(DSL.name("busyness"), SQLDataType.NUMERIC, this, "");

    /**
     * The column <code>total_registered.busyness.schema</code>. 'Department' -
     * обычный ВК, 'Organization' - главный ВК региона, 'Region' - главный ВК
     * военного округа,
     *         'Ministry' - уровень РФ, 'REG_LVL' - сумма всех ВК региона,
     * 'MD_LVL' - сумма всех ВК ВО, 'Country' - все ВК РФ
     */
    public final TableField<BusynessRecord, String> SCHEMA = createField(DSL.name("schema"), SQLDataType.VARCHAR(64).nullable(false).defaultValue(DSL.field(DSL.raw("'empty'::character varying"), SQLDataType.VARCHAR)), this, "'Department' - обычный ВК, 'Organization' - главный ВК региона, 'Region' - главный ВК военного округа,\n        'Ministry' - уровень РФ, 'REG_LVL' - сумма всех ВК региона, 'MD_LVL' - сумма всех ВК ВО, 'Country' - все ВК РФ");

    /**
     * The column <code>total_registered.busyness.convicts</code>.
     */
    public final TableField<BusynessRecord, String> CONVICTS = createField(DSL.name("convicts"), SQLDataType.VARCHAR.nullable(false), this, "");

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

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

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

    /**
     * Create an aliased <code>total_registered.busyness</code> table reference
     */
    public Busyness(Name alias) {
        this(alias, BUSYNESS);
    }

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

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

    @Override
    public UniqueKey<BusynessRecord> getPrimaryKey() {
        return Keys.BUSYNESS_PKEY;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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