/*
 * This file is generated by jOOQ.
 */
package ru.micord.webbpm.ervu.business_metrics.db_beans.admin_indicators.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.admin_indicators.AdminIndicators;
import ru.micord.webbpm.ervu.business_metrics.db_beans.admin_indicators.Keys;
import ru.micord.webbpm.ervu.business_metrics.db_beans.admin_indicators.tables.records.UserActivityDynamicsRecord;
import ru.micord.webbpm.ervu.business_metrics.db_beans.metrics.tables.Recruitment.RecruitmentPath;


/**
 * Администрирование. Динамика активности пользователей
 */
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class UserActivityDynamics extends TableImpl<UserActivityDynamicsRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of
     * <code>admin_indicators.user_activity_dynamics</code>
     */
    public static final UserActivityDynamics USER_ACTIVITY_DYNAMICS = new UserActivityDynamics();

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

    /**
     * The column
     * <code>admin_indicators.user_activity_dynamics.user_activity_dynamics_id</code>.
     */
    public final TableField<UserActivityDynamicsRecord, Long> USER_ACTIVITY_DYNAMICS_ID = createField(DSL.name("user_activity_dynamics_id"), SQLDataType.BIGINT.nullable(false).identity(true), this, "");

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

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

    /**
     * The column
     * <code>admin_indicators.user_activity_dynamics.count_external_exchange</code>.
     * внешний обмен
     */
    public final TableField<UserActivityDynamicsRecord, Long> COUNT_EXTERNAL_EXCHANGE = createField(DSL.name("count_external_exchange"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, "внешний обмен");

    /**
     * The column
     * <code>admin_indicators.user_activity_dynamics.count_summonses_list</code>.
     * реестр повесток
     */
    public final TableField<UserActivityDynamicsRecord, Long> COUNT_SUMMONSES_LIST = createField(DSL.name("count_summonses_list"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, "реестр повесток");

    /**
     * The column
     * <code>admin_indicators.user_activity_dynamics.count_etalon_data</code>.
     * эталонные данные
     */
    public final TableField<UserActivityDynamicsRecord, Long> COUNT_ETALON_DATA = createField(DSL.name("count_etalon_data"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, "эталонные данные");

    /**
     * The column
     * <code>admin_indicators.user_activity_dynamics.count_accounting</code>.
     * ведение учета
     */
    public final TableField<UserActivityDynamicsRecord, Long> COUNT_ACCOUNTING = createField(DSL.name("count_accounting"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, "ведение учета");

    /**
     * The column
     * <code>admin_indicators.user_activity_dynamics.count_sign_batch</code>.
     * пакетное подписание
     */
    public final TableField<UserActivityDynamicsRecord, Long> COUNT_SIGN_BATCH = createField(DSL.name("count_sign_batch"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, "пакетное подписание");

    /**
     * The column
     * <code>admin_indicators.user_activity_dynamics.count_analitic_subsystem</code>.
     * аналитическая подсистема
     */
    public final TableField<UserActivityDynamicsRecord, Long> COUNT_ANALITIC_SUBSYSTEM = createField(DSL.name("count_analitic_subsystem"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, "аналитическая подсистема");

    /**
     * The column
     * <code>admin_indicators.user_activity_dynamics.count_data_quality_control</code>.
     * контроль качества данных
     */
    public final TableField<UserActivityDynamicsRecord, Long> COUNT_DATA_QUALITY_CONTROL = createField(DSL.name("count_data_quality_control"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, "контроль качества данных");

    /**
     * The column
     * <code>admin_indicators.user_activity_dynamics.count_users_administation</code>.
     * администрирование УЗ
     */
    public final TableField<UserActivityDynamicsRecord, Long> COUNT_USERS_ADMINISTATION = createField(DSL.name("count_users_administation"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, "администрирование УЗ");

    /**
     * The column
     * <code>admin_indicators.user_activity_dynamics.count_reports</code>.
     * отчеты
     */
    public final TableField<UserActivityDynamicsRecord, Long> COUNT_REPORTS = createField(DSL.name("count_reports"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, "отчеты");

    /**
     * The column
     * <code>admin_indicators.user_activity_dynamics.count_dashboards</code>.
     * дашборды
     */
    public final TableField<UserActivityDynamicsRecord, Long> COUNT_DASHBOARDS = createField(DSL.name("count_dashboards"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, "дашборды");

    /**
     * The column
     * <code>admin_indicators.user_activity_dynamics.count_desktop</code>.
     * рабочий стол
     */
    public final TableField<UserActivityDynamicsRecord, Long> COUNT_DESKTOP = createField(DSL.name("count_desktop"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, "рабочий стол");

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

    private UserActivityDynamics(Name alias, Table<UserActivityDynamicsRecord> aliased, Field<?>[] parameters, Condition where) {
        super(alias, null, aliased, parameters, DSL.comment("Администрирование. Динамика активности пользователей"), TableOptions.table(), where);
    }

    /**
     * Create an aliased <code>admin_indicators.user_activity_dynamics</code>
     * table reference
     */
    public UserActivityDynamics(String alias) {
        this(DSL.name(alias), USER_ACTIVITY_DYNAMICS);
    }

    /**
     * Create an aliased <code>admin_indicators.user_activity_dynamics</code>
     * table reference
     */
    public UserActivityDynamics(Name alias) {
        this(alias, USER_ACTIVITY_DYNAMICS);
    }

    /**
     * Create a <code>admin_indicators.user_activity_dynamics</code> table
     * reference
     */
    public UserActivityDynamics() {
        this(DSL.name("user_activity_dynamics"), null);
    }

    public <O extends Record> UserActivityDynamics(Table<O> path, ForeignKey<O, UserActivityDynamicsRecord> childPath, InverseForeignKey<O, UserActivityDynamicsRecord> parentPath) {
        super(path, childPath, parentPath, USER_ACTIVITY_DYNAMICS);
    }

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

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

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

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

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

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

    @Override
    public UniqueKey<UserActivityDynamicsRecord> getPrimaryKey() {
        return Keys.USER_ACTIVITY_DYNAMICS_PKEY;
    }

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

    private transient RecruitmentPath _recruitment;

    /**
     * Get the implicit join path to the <code>metrics.recruitment</code> table.
     */
    public RecruitmentPath recruitment() {
        if (_recruitment == null)
            _recruitment = new RecruitmentPath(this, Keys.USER_ACTIVITY_DYNAMICS__FK_CONV_INFO_RECORDS_FROM_EASU_RECRUITMENT_ID, null);

        return _recruitment;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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