/*
 * 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.ReviewRatingRecord;


/**
 * Рейтинг рассмотрения жалоб уровень РФ
 */
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class ReviewRating extends TableImpl<ReviewRatingRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of <code>appeals.review_rating</code>
     */
    public static final ReviewRating REVIEW_RATING = new ReviewRating();

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

    /**
     * The column <code>appeals.review_rating.id_review_rating</code>.
     */
    public final TableField<ReviewRatingRecord, Long> ID_REVIEW_RATING = createField(DSL.name("id_review_rating"), SQLDataType.BIGINT.nullable(false).identity(true), this, "");

    /**
     * The column <code>appeals.review_rating.speed</code>. Скорость
     * рассмотрения
     */
    public final TableField<ReviewRatingRecord, BigDecimal> SPEED = createField(DSL.name("speed"), SQLDataType.NUMERIC, this, "Скорость рассмотрения");

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

    /**
     * The column <code>appeals.review_rating.recording_date</code>. Дата записи
     */
    public final TableField<ReviewRatingRecord, 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.review_rating.id_region</code>.
     */
    public final TableField<ReviewRatingRecord, String> ID_REGION = createField(DSL.name("id_region"), SQLDataType.VARCHAR, this, "");

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

    /**
     * The column <code>appeals.review_rating.schema</code>. 'Department' -
     * обычный ВК, 'Organization' - главный ВК региона, 'Region' - главный ВК
     * военного округа,
     *         'Ministry' - уровень РФ, 'REG_LVL' - сумма всех ВК региона,
     * 'MD_LVL' - сумма всех ВК ВО, 'Country' - все ВК РФ
     */
    public final TableField<ReviewRatingRecord, 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 ReviewRating(Name alias, Table<ReviewRatingRecord> aliased) {
        this(alias, aliased, (Field<?>[]) null, null);
    }

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

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

    /**
     * Create an aliased <code>appeals.review_rating</code> table reference
     */
    public ReviewRating(Name alias) {
        this(alias, REVIEW_RATING);
    }

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

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

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

    @Override
    public UniqueKey<ReviewRatingRecord> getPrimaryKey() {
        return Keys.PK_REVIEW_RATING;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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