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


/**
 * Постановка на воинский учет при смене адреса. Статистика по запросу личных
 * дел
 */
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class PersonalInfoStat extends TableImpl<PersonalInfoStatRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of
     * <code>registration_change_address.personal_info_stat</code>
     */
    public static final PersonalInfoStat PERSONAL_INFO_STAT = new PersonalInfoStat();

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

    /**
     * The column
     * <code>registration_change_address.personal_info_stat.personal_info_stat_id</code>.
     */
    public final TableField<PersonalInfoStatRecord, Long> PERSONAL_INFO_STAT_ID = createField(DSL.name("personal_info_stat_id"), SQLDataType.BIGINT.nullable(false).identity(true), this, "");

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

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

    /**
     * The column
     * <code>registration_change_address.personal_info_stat.count_refused</code>.
     */
    public final TableField<PersonalInfoStatRecord, Long> COUNT_REFUSED = createField(DSL.name("count_refused"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, "");

    /**
     * The column
     * <code>registration_change_address.personal_info_stat.count_unloaded</code>.
     */
    public final TableField<PersonalInfoStatRecord, Long> COUNT_UNLOADED = createField(DSL.name("count_unloaded"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, "");

    /**
     * The column
     * <code>registration_change_address.personal_info_stat.count_accepted_to_send</code>.
     */
    public final TableField<PersonalInfoStatRecord, Long> COUNT_ACCEPTED_TO_SEND = createField(DSL.name("count_accepted_to_send"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, "");

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

    private PersonalInfoStat(Name alias, Table<PersonalInfoStatRecord> aliased, Field<?>[] parameters, Condition where) {
        super(alias, null, aliased, parameters, DSL.comment("Постановка на воинский учет при смене адреса. Статистика по запросу личных дел"), TableOptions.table(), where);
    }

    /**
     * Create an aliased
     * <code>registration_change_address.personal_info_stat</code> table
     * reference
     */
    public PersonalInfoStat(String alias) {
        this(DSL.name(alias), PERSONAL_INFO_STAT);
    }

    /**
     * Create an aliased
     * <code>registration_change_address.personal_info_stat</code> table
     * reference
     */
    public PersonalInfoStat(Name alias) {
        this(alias, PERSONAL_INFO_STAT);
    }

    /**
     * Create a <code>registration_change_address.personal_info_stat</code>
     * table reference
     */
    public PersonalInfoStat() {
        this(DSL.name("personal_info_stat"), null);
    }

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

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

    @Override
    public UniqueKey<PersonalInfoStatRecord> getPrimaryKey() {
        return Keys.PERSONAL_INFO_STAT_PKEY;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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