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


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

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of <code>admin_indicators.user_analysis</code>
     */
    public static final UserAnalysis USER_ANALYSIS = new UserAnalysis();

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

    /**
     * The column <code>admin_indicators.user_analysis.user_analysis_id</code>.
     */
    public final TableField<UserAnalysisRecord, Long> USER_ANALYSIS_ID = createField(DSL.name("user_analysis_id"), SQLDataType.BIGINT.nullable(false).identity(true), this, "");

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

    /**
     * The column <code>admin_indicators.user_analysis.count_offices</code>.
     * количество военкоматов
     */
    public final TableField<UserAnalysisRecord, Long> COUNT_OFFICES = createField(DSL.name("count_offices"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, "количество военкоматов");

    /**
     * The column <code>admin_indicators.user_analysis.count_reg_users</code>.
     * зарегистрировано пользователей
     */
    public final TableField<UserAnalysisRecord, Long> COUNT_REG_USERS = createField(DSL.name("count_reg_users"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, "зарегистрировано пользователей");

    /**
     * The column
     * <code>admin_indicators.user_analysis.count_invalid_authentication</code>.
     * неверные аутентификации
     */
    public final TableField<UserAnalysisRecord, Long> COUNT_INVALID_AUTHENTICATION = createField(DSL.name("count_invalid_authentication"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, "неверные аутентификации");

    /**
     * The column
     * <code>admin_indicators.user_analysis.count_administrator_is</code>.
     * Администратор ИС
     */
    public final TableField<UserAnalysisRecord, Long> COUNT_ADMINISTRATOR_IS = createField(DSL.name("count_administrator_is"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, "Администратор ИС");

    /**
     * The column
     * <code>admin_indicators.user_analysis.count_administrator_poib</code>.
     * Администратор ПОИБ
     */
    public final TableField<UserAnalysisRecord, Long> COUNT_ADMINISTRATOR_POIB = createField(DSL.name("count_administrator_poib"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, "Администратор ПОИБ");

    /**
     * The column
     * <code>admin_indicators.user_analysis.count_employee_gomy</code>.
     * Сотрудник ГОМУ
     */
    public final TableField<UserAnalysisRecord, Long> COUNT_EMPLOYEE_GOMY = createField(DSL.name("count_employee_gomy"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, "Сотрудник ГОМУ");

    /**
     * The column
     * <code>admin_indicators.user_analysis.count_observer_gomy</code>.
     * Наблюдатель ГОМУ
     */
    public final TableField<UserAnalysisRecord, Long> COUNT_OBSERVER_GOMY = createField(DSL.name("count_observer_gomy"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, "Наблюдатель ГОМУ");

    /**
     * The column
     * <code>admin_indicators.user_analysis.count_supervisor_gomy</code>.
     * Супервайзер ГОМУ
     */
    public final TableField<UserAnalysisRecord, Long> COUNT_SUPERVISOR_GOMY = createField(DSL.name("count_supervisor_gomy"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, "Супервайзер ГОМУ");

    /**
     * The column
     * <code>admin_indicators.user_analysis.count_military_commissar</code>.
     * Военный комиссар
     */
    public final TableField<UserAnalysisRecord, Long> COUNT_MILITARY_COMMISSAR = createField(DSL.name("count_military_commissar"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, "Военный комиссар");

    /**
     * The column
     * <code>admin_indicators.user_analysis.count_specialist_statements</code>.
     * Специалист ВК по обработке заявлений
     */
    public final TableField<UserAnalysisRecord, Long> COUNT_SPECIALIST_STATEMENTS = createField(DSL.name("count_specialist_statements"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, "Специалист ВК по обработке заявлений");

    /**
     * The column <code>admin_indicators.user_analysis.count_observer_vo</code>.
     * Наблюдатель штаба ВО
     */
    public final TableField<UserAnalysisRecord, Long> COUNT_OBSERVER_VO = createField(DSL.name("count_observer_vo"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, "Наблюдатель штаба ВО");

    /**
     * The column <code>admin_indicators.user_analysis.count_observer_vk</code>.
     * Наблюдатель ВК субъекта
     */
    public final TableField<UserAnalysisRecord, Long> COUNT_OBSERVER_VK = createField(DSL.name("count_observer_vk"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, "Наблюдатель ВК субъекта");

    /**
     * The column
     * <code>admin_indicators.user_analysis.count_administrator_military_office</code>.
     * Администратор военкомата
     */
    public final TableField<UserAnalysisRecord, Long> COUNT_ADMINISTRATOR_MILITARY_OFFICE = createField(DSL.name("count_administrator_military_office"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, "Администратор военкомата");

    /**
     * The column
     * <code>admin_indicators.user_analysis.count_specialist_military_accounting</code>.
     * Специалист ВК по ВУ
     */
    public final TableField<UserAnalysisRecord, Long> COUNT_SPECIALIST_MILITARY_ACCOUNTING = createField(DSL.name("count_specialist_military_accounting"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, "Специалист ВК по ВУ");

    /**
     * The column
     * <code>admin_indicators.user_analysis.count_specialist_acquisition</code>.
     * Специалист по комплектованию
     */
    public final TableField<UserAnalysisRecord, Long> COUNT_SPECIALIST_ACQUISITION = createField(DSL.name("count_specialist_acquisition"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, "Специалист по комплектованию");

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

    /**
     * The column
     * <code>admin_indicators.user_analysis.count_responsible_zi</code>.
     * Ответственный за ЗИ
     */
    public final TableField<UserAnalysisRecord, Long> COUNT_RESPONSIBLE_ZI = createField(DSL.name("count_responsible_zi"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, "Ответственный за ЗИ");

    /**
     * The column
     * <code>admin_indicators.user_analysis.count_responsible_zi_svk</code>.
     * Ответственный за ЗИ СВК
     */
    public final TableField<UserAnalysisRecord, Long> COUNT_RESPONSIBLE_ZI_SVK = createField(DSL.name("count_responsible_zi_svk"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, "Ответственный за ЗИ СВК");

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

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

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

    /**
     * Create an aliased <code>admin_indicators.user_analysis</code> table
     * reference
     */
    public UserAnalysis(Name alias) {
        this(alias, USER_ANALYSIS);
    }

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

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

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

    @Override
    public UniqueKey<UserAnalysisRecord> getPrimaryKey() {
        return Keys.USER_ANALYSIS_PKEY;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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