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


import ervu_dashboard.ervu_dashboard.db_beans.public_.tables.PubRecruitment.PubRecruitmentPath;
import ervu_dashboard.ervu_dashboard.db_beans.recruitment_campaign.Keys;
import ervu_dashboard.ervu_dashboard.db_beans.recruitment_campaign.RecruitmentCampaign;
import ervu_dashboard.ervu_dashboard.db_beans.recruitment_campaign.tables.records.AppealsRecord;

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;


/**
 * This class is generated by jOOQ.
 */
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class Appeals extends TableImpl<AppealsRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of <code>recruitment_campaign.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>recruitment_campaign.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>recruitment_campaign.appeals.total_appeal</code>.
     * Получено жалоб
     */
    public final TableField<AppealsRecord, BigDecimal> TOTAL_APPEAL = createField(DSL.name("total_appeal"), SQLDataType.NUMERIC, this, "Получено жалоб");

    /**
     * The column <code>recruitment_campaign.appeals.resolved</code>. Решено
     */
    public final TableField<AppealsRecord, BigDecimal> RESOLVED = createField(DSL.name("resolved"), SQLDataType.NUMERIC, this, "Решено");

    /**
     * The column <code>recruitment_campaign.appeals.not_resolved</code>. Не
     * решено
     */
    public final TableField<AppealsRecord, BigDecimal> NOT_RESOLVED = createField(DSL.name("not_resolved"), SQLDataType.NUMERIC, this, "Не решено");

    /**
     * The column
     * <code>recruitment_campaign.appeals.average_consideration</code>. Время
     * решения
     */
    public final TableField<AppealsRecord, BigDecimal> AVERAGE_CONSIDERATION = createField(DSL.name("average_consideration"), SQLDataType.NUMERIC, this, "Время решения");

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

    /**
     * The column <code>recruitment_campaign.appeals.spring_autumn</code>.
     * Весна/Осень
     */
    public final TableField<AppealsRecord, String> SPRING_AUTUMN = createField(DSL.name("spring_autumn"), SQLDataType.CLOB, this, "Весна/Осень");

    /**
     * The column <code>recruitment_campaign.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>recruitment_campaign.appeals.resolved_percent</code>.
     * Процент решенных
     */
    public final TableField<AppealsRecord, BigDecimal> RESOLVED_PERCENT = createField(DSL.name("resolved_percent"), SQLDataType.NUMERIC, this, "Процент решенных");

    /**
     * The column
     * <code>recruitment_campaign.appeals.not_resolved_percent</code>. Процент
     * не решенных
     */
    public final TableField<AppealsRecord, BigDecimal> NOT_RESOLVED_PERCENT = createField(DSL.name("not_resolved_percent"), SQLDataType.NUMERIC, this, "Процент не решенных");

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

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

    /**
     * Create a <code>recruitment_campaign.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 : RecruitmentCampaign.RECRUITMENT_CAMPAIGN;
    }

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