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


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

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;

import ru.micord.webbpm.ervu.business_metrics.db_beans.summonses_list.Keys;
import ru.micord.webbpm.ervu.business_metrics.db_beans.summonses_list.SummonsesList;
import ru.micord.webbpm.ervu.business_metrics.db_beans.summonses_list.tables.SummonsesReason.SummonsesReasonPath;
import ru.micord.webbpm.ervu.business_metrics.db_beans.summonses_list.tables.records.InfoSentToLkEpguRecord;


/**
 * Реестр повесток. Отправка уведомлений в ЛК на ЕПГУ
 */
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class InfoSentToLkEpgu extends TableImpl<InfoSentToLkEpguRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of
     * <code>summonses_list.info_sent_to_lk_epgu</code>
     */
    public static final InfoSentToLkEpgu INFO_SENT_TO_LK_EPGU = new InfoSentToLkEpgu();

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

    /**
     * The column
     * <code>summonses_list.info_sent_to_lk_epgu.info_sent_to_lk_epgu_id</code>.
     */
    public final TableField<InfoSentToLkEpguRecord, Long> INFO_SENT_TO_LK_EPGU_ID = createField(DSL.name("info_sent_to_lk_epgu_id"), SQLDataType.BIGINT.nullable(false).identity(true), this, "");

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

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

    /**
     * The column
     * <code>summonses_list.info_sent_to_lk_epgu.summonses_reason_id</code>.
     */
    public final TableField<InfoSentToLkEpguRecord, Long> SUMMONSES_REASON_ID = createField(DSL.name("summonses_reason_id"), SQLDataType.BIGINT.nullable(false), this, "");

    /**
     * The column
     * <code>summonses_list.info_sent_to_lk_epgu.count_status_formed</code>.
     */
    public final TableField<InfoSentToLkEpguRecord, Long> COUNT_STATUS_FORMED = createField(DSL.name("count_status_formed"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, "");

    /**
     * The column <code>summonses_list.info_sent_to_lk_epgu.count_sended</code>.
     */
    public final TableField<InfoSentToLkEpguRecord, Long> COUNT_SENDED = createField(DSL.name("count_sended"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, "");

    /**
     * The column
     * <code>summonses_list.info_sent_to_lk_epgu.count_delivered</code>.
     */
    public final TableField<InfoSentToLkEpguRecord, Long> COUNT_DELIVERED = createField(DSL.name("count_delivered"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, "");

    /**
     * The column <code>summonses_list.info_sent_to_lk_epgu.count_error</code>.
     */
    public final TableField<InfoSentToLkEpguRecord, Long> COUNT_ERROR = createField(DSL.name("count_error"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, "");

    /**
     * The column <code>summonses_list.info_sent_to_lk_epgu.count_viewed</code>.
     */
    public final TableField<InfoSentToLkEpguRecord, Long> COUNT_VIEWED = createField(DSL.name("count_viewed"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, "");

    /**
     * The column
     * <code>summonses_list.info_sent_to_lk_epgu.count_not_viewed</code>.
     */
    public final TableField<InfoSentToLkEpguRecord, Long> COUNT_NOT_VIEWED = createField(DSL.name("count_not_viewed"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, "");

    /**
     * The column
     * <code>summonses_list.info_sent_to_lk_epgu.count_status_not_formed</code>.
     */
    public final TableField<InfoSentToLkEpguRecord, Long> COUNT_STATUS_NOT_FORMED = createField(DSL.name("count_status_not_formed"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, "");

    /**
     * The column
     * <code>summonses_list.info_sent_to_lk_epgu.count_exceeded_send</code>.
     * Превышено время ожидания отправки уведомления
     */
    public final TableField<InfoSentToLkEpguRecord, Long> COUNT_EXCEEDED_SEND = createField(DSL.name("count_exceeded_send"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, "Превышено время ожидания отправки уведомления");

    /**
     * The column
     * <code>summonses_list.info_sent_to_lk_epgu.count_exceeded_delivered</code>.
     * Превышено время ожидания доставки уведомления
     */
    public final TableField<InfoSentToLkEpguRecord, Long> COUNT_EXCEEDED_DELIVERED = createField(DSL.name("count_exceeded_delivered"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, "Превышено время ожидания доставки уведомления");

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

    private InfoSentToLkEpgu(Name alias, Table<InfoSentToLkEpguRecord> aliased, Field<?>[] parameters, Condition where) {
        super(alias, null, aliased, parameters, DSL.comment("Реестр повесток. Отправка уведомлений в ЛК на ЕПГУ"), TableOptions.table(), where);
    }

    /**
     * Create an aliased <code>summonses_list.info_sent_to_lk_epgu</code> table
     * reference
     */
    public InfoSentToLkEpgu(String alias) {
        this(DSL.name(alias), INFO_SENT_TO_LK_EPGU);
    }

    /**
     * Create an aliased <code>summonses_list.info_sent_to_lk_epgu</code> table
     * reference
     */
    public InfoSentToLkEpgu(Name alias) {
        this(alias, INFO_SENT_TO_LK_EPGU);
    }

    /**
     * Create a <code>summonses_list.info_sent_to_lk_epgu</code> table reference
     */
    public InfoSentToLkEpgu() {
        this(DSL.name("info_sent_to_lk_epgu"), null);
    }

    public <O extends Record> InfoSentToLkEpgu(Table<O> path, ForeignKey<O, InfoSentToLkEpguRecord> childPath, InverseForeignKey<O, InfoSentToLkEpguRecord> parentPath) {
        super(path, childPath, parentPath, INFO_SENT_TO_LK_EPGU);
    }

    /**
     * A subtype implementing {@link Path} for simplified path-based joins.
     */
    public static class InfoSentToLkEpguPath extends InfoSentToLkEpgu implements Path<InfoSentToLkEpguRecord> {
        public <O extends Record> InfoSentToLkEpguPath(Table<O> path, ForeignKey<O, InfoSentToLkEpguRecord> childPath, InverseForeignKey<O, InfoSentToLkEpguRecord> parentPath) {
            super(path, childPath, parentPath);
        }
        private InfoSentToLkEpguPath(Name alias, Table<InfoSentToLkEpguRecord> aliased) {
            super(alias, aliased);
        }

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

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

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

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

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

    @Override
    public UniqueKey<InfoSentToLkEpguRecord> getPrimaryKey() {
        return Keys.INFO_SENT_TO_LK_EPGU_PKEY;
    }

    @Override
    public List<ForeignKey<InfoSentToLkEpguRecord, ?>> getReferences() {
        return Arrays.asList(Keys.INFO_SENT_TO_LK_EPGU__FK_SUMMONSES_REASON_ID);
    }

    private transient SummonsesReasonPath _summonsesReason;

    /**
     * Get the implicit join path to the
     * <code>summonses_list.summonses_reason</code> table.
     */
    public SummonsesReasonPath summonsesReason() {
        if (_summonsesReason == null)
            _summonsesReason = new SummonsesReasonPath(this, Keys.INFO_SENT_TO_LK_EPGU__FK_SUMMONSES_REASON_ID, null);

        return _summonsesReason;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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