/*
 * This file is generated by jOOQ.
 */
package ru.micord.ervu_dashboard.db_beans.appeals.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.appeals.Appeals;
import ru.micord.ervu_dashboard.db_beans.appeals.Keys;
import ru.micord.ervu_dashboard.db_beans.appeals.tables.records.TopicAppealRecord;


/**
 * Тема обжалования уровень РФ
 */
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class TopicAppeal extends TableImpl<TopicAppealRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of <code>appeals.topic_appeal</code>
     */
    public static final TopicAppeal TOPIC_APPEAL = new TopicAppeal();

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

    /**
     * The column <code>appeals.topic_appeal.id_topic_appeal</code>.
     */
    public final TableField<TopicAppealRecord, Long> ID_TOPIC_APPEAL = createField(DSL.name("id_topic_appeal"), SQLDataType.BIGINT.nullable(false).identity(true), this, "");

    /**
     * The column <code>appeals.topic_appeal.registration</code>. Тема
     * обжалования постановка на учет
     */
    public final TableField<TopicAppealRecord, BigDecimal> REGISTRATION = createField(DSL.name("registration"), SQLDataType.NUMERIC, this, "Тема обжалования постановка на учет");

    /**
     * The column <code>appeals.topic_appeal.temporary_measures</code>. Тема
     * обжалования временные меры
     */
    public final TableField<TopicAppealRecord, BigDecimal> TEMPORARY_MEASURES = createField(DSL.name("temporary_measures"), SQLDataType.NUMERIC, this, "Тема обжалования временные меры");

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

    /**
     * The column <code>appeals.topic_appeal.registration_percent</code>. Тема
     * обжалования постановка на учет в процентах
     */
    public final TableField<TopicAppealRecord, BigDecimal> REGISTRATION_PERCENT = createField(DSL.name("registration_percent"), SQLDataType.NUMERIC, this, "Тема обжалования постановка на учет в процентах");

    /**
     * The column <code>appeals.topic_appeal.sabpoena_percent</code>. Тема
     * обжалования повестки в процентах
     */
    public final TableField<TopicAppealRecord, BigDecimal> SABPOENA_PERCENT = createField(DSL.name("sabpoena_percent"), SQLDataType.NUMERIC, this, "Тема обжалования повестки в процентах");

    /**
     * The column <code>appeals.topic_appeal.appear_percent</code>. Тема
     * обжалования явка в процентах
     */
    public final TableField<TopicAppealRecord, BigDecimal> APPEAR_PERCENT = createField(DSL.name("appear_percent"), SQLDataType.NUMERIC, this, "Тема обжалования явка в процентах");

    /**
     * The column <code>appeals.topic_appeal.temporary_measures_percent</code>.
     * Тема обжалования временные меры в процентах
     */
    public final TableField<TopicAppealRecord, BigDecimal> TEMPORARY_MEASURES_PERCENT = createField(DSL.name("temporary_measures_percent"), SQLDataType.NUMERIC, this, "Тема обжалования временные меры в процентах");

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

    /**
     * The column <code>appeals.topic_appeal.schema</code>. 'Department' -
     * обычный ВК, 'Organization' - главный ВК региона, 'Region' - главный ВК
     * военного округа,
     *         'Ministry' - уровень РФ, 'REG_LVL' - сумма всех ВК региона,
     * 'MD_LVL' - сумма всех ВК ВО, 'Country' - все ВК РФ
     */
    public final TableField<TopicAppealRecord, 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>appeals.topic_appeal.recruitment_campaign</code>.
     * Решения призывной комиссии
     */
    public final TableField<TopicAppealRecord, BigDecimal> RECRUITMENT_CAMPAIGN = createField(DSL.name("recruitment_campaign"), SQLDataType.NUMERIC, this, "Решения призывной комиссии");

    /**
     * The column
     * <code>appeals.topic_appeal.recruitment_campaign_percent</code>.
     */
    public final TableField<TopicAppealRecord, BigDecimal> RECRUITMENT_CAMPAIGN_PERCENT = createField(DSL.name("recruitment_campaign_percent"), SQLDataType.NUMERIC, this, "");

    /**
     * The column <code>appeals.topic_appeal.making_changes</code>. Внесение
     * изменений
     */
    public final TableField<TopicAppealRecord, BigDecimal> MAKING_CHANGES = createField(DSL.name("making_changes"), SQLDataType.NUMERIC, this, "Внесение изменений");

    /**
     * The column <code>appeals.topic_appeal.making_changes_percent</code>.
     */
    public final TableField<TopicAppealRecord, BigDecimal> MAKING_CHANGES_PERCENT = createField(DSL.name("making_changes_percent"), SQLDataType.NUMERIC, this, "");

    /**
     * The column <code>appeals.topic_appeal.total_appeals</code>.
     */
    public final TableField<TopicAppealRecord, BigDecimal> TOTAL_APPEALS = createField(DSL.name("total_appeals"), SQLDataType.NUMERIC, this, "");

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

    private TopicAppeal(Name alias, Table<TopicAppealRecord> aliased, Field<?>[] parameters, Condition where) {
        super(alias, null, aliased, parameters, DSL.comment("Тема обжалования уровень РФ"), TableOptions.table(), where);
    }

    /**
     * Create an aliased <code>appeals.topic_appeal</code> table reference
     */
    public TopicAppeal(String alias) {
        this(DSL.name(alias), TOPIC_APPEAL);
    }

    /**
     * Create an aliased <code>appeals.topic_appeal</code> table reference
     */
    public TopicAppeal(Name alias) {
        this(alias, TOPIC_APPEAL);
    }

    /**
     * Create a <code>appeals.topic_appeal</code> table reference
     */
    public TopicAppeal() {
        this(DSL.name("topic_appeal"), null);
    }

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

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

    @Override
    public UniqueKey<TopicAppealRecord> getPrimaryKey() {
        return Keys.PK_TOPIC_APPEAL;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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