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


/**
 * Инциденты. Изменения сведений из ГИР ВУ
 */
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class IncidentsChangeDataFromGirVu extends TableImpl<IncidentsChangeDataFromGirVuRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of
     * <code>metrics.incidents_change_data_from_gir_vu</code>
     */
    public static final IncidentsChangeDataFromGirVu INCIDENTS_CHANGE_DATA_FROM_GIR_VU = new IncidentsChangeDataFromGirVu();

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

    /**
     * The column
     * <code>metrics.incidents_change_data_from_gir_vu.incidents_change_data_from_gir_vu_id</code>.
     */
    public final TableField<IncidentsChangeDataFromGirVuRecord, Long> INCIDENTS_CHANGE_DATA_FROM_GIR_VU_ID = createField(DSL.name("incidents_change_data_from_gir_vu_id"), SQLDataType.BIGINT.nullable(false).identity(true), this, "");

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

    /**
     * The column
     * <code>metrics.incidents_change_data_from_gir_vu.update_date</code>.
     */
    public final TableField<IncidentsChangeDataFromGirVuRecord, 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.incidents_change_data_from_gir_vu.info_date</code>.
     */
    public final TableField<IncidentsChangeDataFromGirVuRecord, Date> INFO_DATE = createField(DSL.name("info_date"), SQLDataType.DATE.nullable(false), this, "");

    /**
     * The column
     * <code>metrics.incidents_change_data_from_gir_vu.count_epgu_citizen_appeal</code>.
     */
    public final TableField<IncidentsChangeDataFromGirVuRecord, Long> COUNT_EPGU_CITIZEN_APPEAL = createField(DSL.name("count_epgu_citizen_appeal"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, "");

    /**
     * The column
     * <code>metrics.incidents_change_data_from_gir_vu.count_manual</code>.
     */
    public final TableField<IncidentsChangeDataFromGirVuRecord, Long> COUNT_MANUAL = createField(DSL.name("count_manual"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, "");

    /**
     * The column
     * <code>metrics.incidents_change_data_from_gir_vu.count_send_to_gir_vu</code>.
     */
    public final TableField<IncidentsChangeDataFromGirVuRecord, Long> COUNT_SEND_TO_GIR_VU = createField(DSL.name("count_send_to_gir_vu"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, "");

    /**
     * The column
     * <code>metrics.incidents_change_data_from_gir_vu.count_accepted</code>.
     */
    public final TableField<IncidentsChangeDataFromGirVuRecord, Long> COUNT_ACCEPTED = createField(DSL.name("count_accepted"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, "");

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

    private IncidentsChangeDataFromGirVu(Name alias, Table<IncidentsChangeDataFromGirVuRecord> aliased, Field<?>[] parameters, Condition where) {
        super(alias, null, aliased, parameters, DSL.comment("Инциденты. Изменения сведений из ГИР ВУ"), TableOptions.table(), where);
    }

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

    /**
     * Create an aliased <code>metrics.incidents_change_data_from_gir_vu</code>
     * table reference
     */
    public IncidentsChangeDataFromGirVu(Name alias) {
        this(alias, INCIDENTS_CHANGE_DATA_FROM_GIR_VU);
    }

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

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

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

    @Override
    public UniqueKey<IncidentsChangeDataFromGirVuRecord> getPrimaryKey() {
        return Keys.INCIDENTS_CHANGE_DATA_FROM_GIR_VU_PKEY;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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