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


/**
 * Обжалования
 */
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class Appeals extends TableImpl<AppealsRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of <code>forecast.appeals</code>
     */
    public static final Appeals APPEALS = new Appeals();

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

    /**
     * The column <code>forecast.appeals.appeals_id</code>.
     */
    public final TableField<AppealsRecord, Long> APPEALS_ID = createField(DSL.name("appeals_id"), SQLDataType.BIGINT.nullable(false).identity(true), this, "");

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

    /**
     * The column <code>forecast.appeals.recording_date</code>.
     */
    public final TableField<AppealsRecord, Date> RECORDING_DATE = createField(DSL.name("recording_date"), SQLDataType.DATE.nullable(false).defaultValue(DSL.field(DSL.raw("now()"), SQLDataType.DATE)), this, "");

    /**
     * The column <code>forecast.appeals.schema</code>.
     */
    public final TableField<AppealsRecord, String> SCHEMA = createField(DSL.name("schema"), SQLDataType.VARCHAR(64).nullable(false).defaultValue(DSL.field(DSL.raw("'empty'::character varying"), SQLDataType.VARCHAR)), this, "");

    /**
     * The column <code>forecast.appeals.resolved_appeals</code>. Решенные
     * обжалования
     */
    public final TableField<AppealsRecord, BigDecimal> RESOLVED_APPEALS = createField(DSL.name("resolved_appeals"), SQLDataType.NUMERIC, this, "Решенные обжалования");

    /**
     * The column <code>forecast.appeals.document_retrieval</code>. Досыл
     * документов
     */
    public final TableField<AppealsRecord, BigDecimal> DOCUMENT_RETRIEVAL = createField(DSL.name("document_retrieval"), SQLDataType.NUMERIC, this, "Досыл документов");

    /**
     * The column <code>forecast.appeals.retraction_complaint</code>. Отзыв
     * жалобы
     */
    public final TableField<AppealsRecord, BigDecimal> RETRACTION_COMPLAINT = createField(DSL.name("retraction_complaint"), SQLDataType.NUMERIC, this, "Отзыв жалобы");

    /**
     * The column <code>forecast.appeals.disagreement_decision</code>.
     * Несогласие с решением
     */
    public final TableField<AppealsRecord, BigDecimal> DISAGREEMENT_DECISION = createField(DSL.name("disagreement_decision"), SQLDataType.NUMERIC, this, "Несогласие с решением");

    /**
     * The column <code>forecast.appeals.incorrect_information</code>.
     * Некорректные данные
     */
    public final TableField<AppealsRecord, BigDecimal> INCORRECT_INFORMATION = createField(DSL.name("incorrect_information"), SQLDataType.NUMERIC, this, "Некорректные данные");

    /**
     * The column <code>forecast.appeals.maintaining_military_records</code>.
     * Ведение воинского учета
     */
    public final TableField<AppealsRecord, BigDecimal> MAINTAINING_MILITARY_RECORDS = createField(DSL.name("maintaining_military_records"), SQLDataType.NUMERIC, this, "Ведение воинского учета");

    /**
     * The column <code>forecast.appeals.conscription</code>. Призыв на службу
     */
    public final TableField<AppealsRecord, BigDecimal> CONSCRIPTION = createField(DSL.name("conscription"), SQLDataType.NUMERIC, this, "Призыв на службу");

    /**
     * The column <code>forecast.appeals.temporary_measures</code>. Временные
     * меры
     */
    public final TableField<AppealsRecord, BigDecimal> TEMPORARY_MEASURES = createField(DSL.name("temporary_measures"), SQLDataType.NUMERIC, this, "Временные меры");

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

    private Appeals(Name alias, Table<AppealsRecord> aliased, Field<?>[] parameters, Condition where) {
        super(alias, null, aliased, parameters, DSL.comment("Обжалования"), TableOptions.table(), where);
    }

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

    /**
     * Create an aliased <code>forecast.appeals</code> table reference
     */
    public Appeals(Name alias) {
        this(alias, APPEALS);
    }

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

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

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

    @Override
    public UniqueKey<AppealsRecord> getPrimaryKey() {
        return Keys.PK_APPEALS;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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