/*
 * This file is generated by jOOQ.
 */
package ru.micord.webbpm.ervu.business_metrics.db_beans.metrics.tables;


import java.sql.Date;
import java.sql.Timestamp;
import java.util.Collection;

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.webbpm.ervu.business_metrics.db_beans.metrics.Keys;
import ru.micord.webbpm.ervu.business_metrics.db_beans.metrics.Metrics;
import ru.micord.webbpm.ervu.business_metrics.db_beans.metrics.tables.records.Fz_53AppealsRecord;


/**
 * Обжалования. Обжалования решений ФЗ-53
 */
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class Fz_53Appeals extends TableImpl<Fz_53AppealsRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of <code>metrics.fz_53_appeals</code>
     */
    public static final Fz_53Appeals FZ_53_APPEALS = new Fz_53Appeals();

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

    /**
     * The column <code>metrics.fz_53_appeals.fz_53_appeals_id</code>.
     */
    public final TableField<Fz_53AppealsRecord, Long> FZ_53_APPEALS_ID = createField(DSL.name("fz_53_appeals_id"), SQLDataType.BIGINT.nullable(false).identity(true), this, "");

    /**
     * The column <code>metrics.fz_53_appeals.recruitment_id</code>.
     */
    public final TableField<Fz_53AppealsRecord, String> RECRUITMENT_ID = createField(DSL.name("recruitment_id"), SQLDataType.VARCHAR(36).nullable(false), this, "");

    /**
     * The column <code>metrics.fz_53_appeals.update_date</code>.
     */
    public final TableField<Fz_53AppealsRecord, Timestamp> UPDATE_DATE = createField(DSL.name("update_date"), SQLDataType.TIMESTAMP(0).nullable(false).defaultValue(DSL.field(DSL.raw("now()"), SQLDataType.TIMESTAMP)), this, "");

    /**
     * The column <code>metrics.fz_53_appeals.info_date</code>.
     */
    public final TableField<Fz_53AppealsRecord, Date> INFO_DATE = createField(DSL.name("info_date"), SQLDataType.DATE.nullable(false), this, "");

    /**
     * The column <code>metrics.fz_53_appeals.count_accepted</code>.
     * Удовлетворенных жалоб
     */
    public final TableField<Fz_53AppealsRecord, Long> COUNT_ACCEPTED = createField(DSL.name("count_accepted"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, "Удовлетворенных жалоб");

    /**
     * The column <code>metrics.fz_53_appeals.count_refused</code>. Отклоненных
     * жалоб
     */
    public final TableField<Fz_53AppealsRecord, Long> COUNT_REFUSED = createField(DSL.name("count_refused"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, "Отклоненных жалоб");

    /**
     * The column <code>metrics.fz_53_appeals.count_partially</code>.
     */
    public final TableField<Fz_53AppealsRecord, Long> COUNT_PARTIALLY = createField(DSL.name("count_partially"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, "");

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

    private Fz_53Appeals(Name alias, Table<Fz_53AppealsRecord> aliased, Field<?>[] parameters, Condition where) {
        super(alias, null, aliased, parameters, DSL.comment("Обжалования. Обжалования решений ФЗ-53"), TableOptions.table(), where);
    }

    /**
     * Create an aliased <code>metrics.fz_53_appeals</code> table reference
     */
    public Fz_53Appeals(String alias) {
        this(DSL.name(alias), FZ_53_APPEALS);
    }

    /**
     * Create an aliased <code>metrics.fz_53_appeals</code> table reference
     */
    public Fz_53Appeals(Name alias) {
        this(alias, FZ_53_APPEALS);
    }

    /**
     * Create a <code>metrics.fz_53_appeals</code> table reference
     */
    public Fz_53Appeals() {
        this(DSL.name("fz_53_appeals"), null);
    }

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

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

    @Override
    public UniqueKey<Fz_53AppealsRecord> getPrimaryKey() {
        return Keys.FZ_53_APPEALS_PKEY;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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