/*
 * This file is generated by jOOQ.
 */
package ru.micord.webbpm.ervu.business_metrics.db_beans.summonses_list_subsystem.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.summonses_list_subsystem.Keys;
import ru.micord.webbpm.ervu.business_metrics.db_beans.summonses_list_subsystem.SummonsesListSubsystem;
import ru.micord.webbpm.ervu.business_metrics.db_beans.summonses_list_subsystem.tables.records.RequestsDirectToPersAccRecord;


/**
 * Реестр повесток подсистема. Направление запросов в ЛК РП для выписки
 */
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class RequestsDirectToPersAcc extends TableImpl<RequestsDirectToPersAccRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of
     * <code>summonses_list_subsystem.requests_direct_to_pers_acc</code>
     */
    public static final RequestsDirectToPersAcc REQUESTS_DIRECT_TO_PERS_ACC = new RequestsDirectToPersAcc();

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

    /**
     * The column
     * <code>summonses_list_subsystem.requests_direct_to_pers_acc.requests_direct_to_pers_acc_id</code>.
     */
    public final TableField<RequestsDirectToPersAccRecord, Long> REQUESTS_DIRECT_TO_PERS_ACC_ID = createField(DSL.name("requests_direct_to_pers_acc_id"), SQLDataType.BIGINT.nullable(false).identity(true), this, "");

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

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

    /**
     * The column
     * <code>summonses_list_subsystem.requests_direct_to_pers_acc.count_registered</code>.
     * состоящие на ВУ
     */
    public final TableField<RequestsDirectToPersAccRecord, Long> COUNT_REGISTERED = createField(DSL.name("count_registered"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, "состоящие на ВУ");

    /**
     * The column
     * <code>summonses_list_subsystem.requests_direct_to_pers_acc.count_registered_formed</code>.
     * сформировано для состоящих на ВУ
     */
    public final TableField<RequestsDirectToPersAccRecord, Long> COUNT_REGISTERED_FORMED = createField(DSL.name("count_registered_formed"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, "сформировано для состоящих на ВУ");

    /**
     * The column
     * <code>summonses_list_subsystem.requests_direct_to_pers_acc.count_not_registered</code>.
     * не состоящие на ВУ
     */
    public final TableField<RequestsDirectToPersAccRecord, Long> COUNT_NOT_REGISTERED = createField(DSL.name("count_not_registered"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, "не состоящие на ВУ");

    /**
     * The column
     * <code>summonses_list_subsystem.requests_direct_to_pers_acc.count_not_registered_formed</code>.
     * сформировано для не состоящих на ВУ
     */
    public final TableField<RequestsDirectToPersAccRecord, Long> COUNT_NOT_REGISTERED_FORMED = createField(DSL.name("count_not_registered_formed"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, "сформировано для не состоящих на ВУ");

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

    private RequestsDirectToPersAcc(Name alias, Table<RequestsDirectToPersAccRecord> aliased, Field<?>[] parameters, Condition where) {
        super(alias, null, aliased, parameters, DSL.comment("Реестр повесток подсистема. Направление запросов в ЛК РП для выписки"), TableOptions.table(), where);
    }

    /**
     * Create an aliased
     * <code>summonses_list_subsystem.requests_direct_to_pers_acc</code> table
     * reference
     */
    public RequestsDirectToPersAcc(String alias) {
        this(DSL.name(alias), REQUESTS_DIRECT_TO_PERS_ACC);
    }

    /**
     * Create an aliased
     * <code>summonses_list_subsystem.requests_direct_to_pers_acc</code> table
     * reference
     */
    public RequestsDirectToPersAcc(Name alias) {
        this(alias, REQUESTS_DIRECT_TO_PERS_ACC);
    }

    /**
     * Create a
     * <code>summonses_list_subsystem.requests_direct_to_pers_acc</code> table
     * reference
     */
    public RequestsDirectToPersAcc() {
        this(DSL.name("requests_direct_to_pers_acc"), null);
    }

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

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

    @Override
    public UniqueKey<RequestsDirectToPersAccRecord> getPrimaryKey() {
        return Keys.REQUESTS_DIRECT_TO_PERS_ACC_PKEY;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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