/*
 * This file is generated by jOOQ.
 */
package ervu_dashboard.ervu_dashboard.db_beans.main_dashboard.tables;


import ervu_dashboard.ervu_dashboard.db_beans.main_dashboard.Keys;
import ervu_dashboard.ervu_dashboard.db_beans.main_dashboard.MainDashboard;
import ervu_dashboard.ervu_dashboard.db_beans.main_dashboard.tables.records.AppealsRecord;
import ervu_dashboard.ervu_dashboard.db_beans.public_.tables.PubRecruitment.PubRecruitmentPath;

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 Appeals extends TableImpl<AppealsRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of <code>main_dashboard.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>main_dashboard.appeals.id_appeal</code>.
     */
    public final TableField<AppealsRecord, Long> ID_APPEAL = createField(DSL.name("id_appeal"), SQLDataType.BIGINT.nullable(false).identity(true), this, "");

    /**
     * The column <code>main_dashboard.appeals.total_appeals</code>. Всего жалоб
     */
    public final TableField<AppealsRecord, BigDecimal> TOTAL_APPEALS = createField(DSL.name("total_appeals"), SQLDataType.NUMERIC, this, "Всего жалоб");

    /**
     * The column <code>main_dashboard.appeals.resolved</code>. Количество
     * решенных
     */
    public final TableField<AppealsRecord, BigDecimal> RESOLVED = createField(DSL.name("resolved"), SQLDataType.NUMERIC, this, "Количество решенных");

    /**
     * The column <code>main_dashboard.appeals.average_consideration</code>.
     * Средний срок рассмотрения
     */
    public final TableField<AppealsRecord, BigDecimal> AVERAGE_CONSIDERATION = createField(DSL.name("average_consideration"), SQLDataType.NUMERIC, this, "Средний срок рассмотрения");

    /**
     * The column <code>main_dashboard.appeals.average_rating</code>. Оценка
     * удовлетворенности
     */
    public final TableField<AppealsRecord, BigDecimal> AVERAGE_RATING = createField(DSL.name("average_rating"), SQLDataType.NUMERIC, this, "Оценка удовлетворенности");

    /**
     * The column <code>main_dashboard.appeals.average_to_face</code>. Способ
     * подачи жалоб очно
     */
    public final TableField<AppealsRecord, BigDecimal> AVERAGE_TO_FACE = createField(DSL.name("average_to_face"), SQLDataType.NUMERIC, this, "Способ подачи жалоб очно");

    /**
     * The column <code>main_dashboard.appeals.average_EPGU</code>. Способ
     * подачи ЕПГУ
     */
    public final TableField<AppealsRecord, BigDecimal> AVERAGE_EPGU = createField(DSL.name("average_EPGU"), SQLDataType.NUMERIC, this, "Способ подачи ЕПГУ");

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

    /**
     * The column <code>main_dashboard.appeals.average_to_face_percent</code>.
     * Способ подачи жалоб очно в процентах
     */
    public final TableField<AppealsRecord, BigDecimal> AVERAGE_TO_FACE_PERCENT = createField(DSL.name("average_to_face_percent"), SQLDataType.NUMERIC, this, "Способ подачи жалоб очно в процентах");

    /**
     * The column <code>main_dashboard.appeals.average_EPGU_percent</code>.
     * Способ подачи ЕПГУ в процентах
     */
    public final TableField<AppealsRecord, BigDecimal> AVERAGE_EPGU_PERCENT = createField(DSL.name("average_EPGU_percent"), SQLDataType.NUMERIC, this, "Способ подачи ЕПГУ в процентах");

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

    /**
     * The column <code>main_dashboard.appeals.testrecruitment_id</code>.
     */
    public final TableField<AppealsRecord, String> TESTRECRUITMENT_ID = createField(DSL.name("testrecruitment_id"), SQLDataType.CHAR(36), 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>main_dashboard.appeals</code> table reference
     */
    public Appeals(String alias) {
        this(DSL.name(alias), APPEALS);
    }

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

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

    public <O extends Record> Appeals(Table<O> path, ForeignKey<O, AppealsRecord> childPath, InverseForeignKey<O, AppealsRecord> parentPath) {
        super(path, childPath, parentPath, APPEALS);
    }

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

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

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

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

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

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

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

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

        return _pubRecruitment;
    }

    @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));
    }
}
