/*
 * This file is generated by jOOQ.
 */
package ru.micord.ervu_dashboard.db_beans.recruitment_campaign.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.Identity;
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.recruitment_campaign.Keys;
import ru.micord.ervu_dashboard.db_beans.recruitment_campaign.RecruitmentCampaign;
import ru.micord.ervu_dashboard.db_beans.recruitment_campaign.tables.records.PostponementInfoRecord;


/**
 * статистика по отсрочке и призывам
 */
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class PostponementInfo extends TableImpl<PostponementInfoRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of
     * <code>recruitment_campaign.postponement_info</code>
     */
    public static final PostponementInfo POSTPONEMENT_INFO = new PostponementInfo();

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

    /**
     * The column
     * <code>recruitment_campaign.postponement_info.postponement_info_id</code>.
     */
    public final TableField<PostponementInfoRecord, Long> POSTPONEMENT_INFO_ID = createField(DSL.name("postponement_info_id"), SQLDataType.BIGINT.nullable(false).identity(true), this, "");

    /**
     * The column
     * <code>recruitment_campaign.postponement_info.suitable_recruit</code>.
     * Подходят под призыв
     */
    public final TableField<PostponementInfoRecord, BigDecimal> SUITABLE_RECRUIT = createField(DSL.name("suitable_recruit"), SQLDataType.NUMERIC, this, "Подходят под призыв");

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

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

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

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

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

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

    /**
     * The column
     * <code>recruitment_campaign.postponement_info.spring_autumn</code>.
     */
    public final TableField<PostponementInfoRecord, String> SPRING_AUTUMN = createField(DSL.name("spring_autumn"), SQLDataType.VARCHAR.nullable(false), this, "");

    /**
     * The column <code>recruitment_campaign.postponement_info.schema</code>.
     * 'Department' - обычный ВК, 'Organization' - главный ВК региона, 'Region'
     * - главный ВК военного округа,
     *         'Ministry' - уровень РФ, 'REG_LVL' - сумма всех ВК региона,
     * 'MD_LVL' - сумма всех ВК ВО, 'Country' - все ВК РФ
     */
    public final TableField<PostponementInfoRecord, 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' - все ВК РФ");

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

    private PostponementInfo(Name alias, Table<PostponementInfoRecord> aliased, Field<?>[] parameters, Condition where) {
        super(alias, null, aliased, parameters, DSL.comment("статистика по отсрочке и призывам"), TableOptions.table(), where);
    }

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

    /**
     * Create an aliased <code>recruitment_campaign.postponement_info</code>
     * table reference
     */
    public PostponementInfo(Name alias) {
        this(alias, POSTPONEMENT_INFO);
    }

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

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

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

    @Override
    public UniqueKey<PostponementInfoRecord> getPrimaryKey() {
        return Keys.PK_POSTPONEMENT_INFO;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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