/*
 * This file is generated by jOOQ.
 */
package ervu_dashboard.ervu_dashboard.db_beans.ervu_dashboard.tables;


import ervu_dashboard.ervu_dashboard.db_beans.ervu_dashboard.ErvuDashboard;
import ervu_dashboard.ervu_dashboard.db_beans.ervu_dashboard.Keys;
import ervu_dashboard.ervu_dashboard.db_beans.ervu_dashboard.tables.records.CitizenRecord;

import java.math.BigDecimal;
import java.sql.Date;
import java.util.Collection;
import java.util.UUID;

import org.jooq.Condition;
import org.jooq.Field;
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;


/**
 * This class is generated by jOOQ.
 */
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class Citizen extends TableImpl<CitizenRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of <code>ervu_dashboard.citizen</code>
     */
    public static final Citizen CITIZEN = new Citizen();

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

    /**
     * The column <code>ervu_dashboard.citizen.residence</code>. Адрес места
     * жительства
     */
    public final TableField<CitizenRecord, String> RESIDENCE = createField(DSL.name("residence"), SQLDataType.VARCHAR, this, "Адрес места жительства");

    /**
     * The column <code>ervu_dashboard.citizen.is_registered</code>. Сведения о
     * воинском учёте
     */
    public final TableField<CitizenRecord, String> IS_REGISTERED = createField(DSL.name("is_registered"), SQLDataType.VARCHAR, this, "Сведения о воинском учёте");

    /**
     * The column <code>ervu_dashboard.citizen.passport_series</code>. Серия
     * паспорта
     */
    public final TableField<CitizenRecord, String> PASSPORT_SERIES = createField(DSL.name("passport_series"), SQLDataType.VARCHAR, this, "Серия паспорта");

    /**
     * The column <code>ervu_dashboard.citizen.passport_number</code>. Номер
     * паспорта
     */
    public final TableField<CitizenRecord, String> PASSPORT_NUMBER = createField(DSL.name("passport_number"), SQLDataType.VARCHAR, this, "Номер паспорта");

    /**
     * The column <code>ervu_dashboard.citizen.phone</code>. Телефон
     */
    public final TableField<CitizenRecord, String> PHONE = createField(DSL.name("phone"), SQLDataType.VARCHAR, this, "Телефон");

    /**
     * The column <code>ervu_dashboard.citizen.medical_requirements</code>.
     * Медицинские сведения
     */
    public final TableField<CitizenRecord, String> MEDICAL_REQUIREMENTS = createField(DSL.name("medical_requirements"), SQLDataType.VARCHAR, this, "Медицинские сведения");

    /**
     * The column <code>ervu_dashboard.citizen.deferment_liberation</code>.
     * Наличие отсрочки или освобождения от военной службы
     */
    public final TableField<CitizenRecord, String> DEFERMENT_LIBERATION = createField(DSL.name("deferment_liberation"), SQLDataType.VARCHAR, this, "Наличие отсрочки или освобождения от военной службы");

    /**
     * The column <code>ervu_dashboard.citizen.gender</code>. Пол
     */
    public final TableField<CitizenRecord, String> GENDER = createField(DSL.name("gender"), SQLDataType.VARCHAR, this, "Пол");

    /**
     * The column <code>ervu_dashboard.citizen.marital_status</code>. Семейное
     * положение
     */
    public final TableField<CitizenRecord, String> MARITAL_STATUS = createField(DSL.name("marital_status"), SQLDataType.VARCHAR, this, "Семейное положение");

    /**
     * The column <code>ervu_dashboard.citizen.education</code>. Образование
     */
    public final TableField<CitizenRecord, String> EDUCATION = createField(DSL.name("education"), SQLDataType.VARCHAR, this, "Образование");

    /**
     * The column <code>ervu_dashboard.citizen.employment</code>. Занятость
     */
    public final TableField<CitizenRecord, String> EMPLOYMENT = createField(DSL.name("employment"), SQLDataType.VARCHAR, this, "Занятость");

    /**
     * The column <code>ervu_dashboard.citizen.reason_registration</code>.
     * Причина постановки на учёт
     */
    public final TableField<CitizenRecord, String> REASON_REGISTRATION = createField(DSL.name("reason_registration"), SQLDataType.VARCHAR, this, "Причина постановки на учёт");

    /**
     * The column <code>ervu_dashboard.citizen.driver_license</code>.
     * Водительское удостоверение
     */
    public final TableField<CitizenRecord, String> DRIVER_LICENSE = createField(DSL.name("driver_license"), SQLDataType.VARCHAR, this, "Водительское удостоверение");

    /**
     * The column <code>ervu_dashboard.citizen.disability_group</code>. Группа
     * инвалидности
     */
    public final TableField<CitizenRecord, String> DISABILITY_GROUP = createField(DSL.name("disability_group"), SQLDataType.VARCHAR, this, "Группа инвалидности");

    /**
     * The column
     * <code>ervu_dashboard.citizen.dispensary_registration_code</code>. Код
     * диспансерного учета
     */
    public final TableField<CitizenRecord, String> DISPENSARY_REGISTRATION_CODE = createField(DSL.name("dispensary_registration_code"), SQLDataType.VARCHAR, this, "Код диспансерного учета");

    /**
     * The column <code>ervu_dashboard.citizen.region_birth</code>. Регион места
     * рождения
     */
    public final TableField<CitizenRecord, String> REGION_BIRTH = createField(DSL.name("region_birth"), SQLDataType.VARCHAR, this, "Регион места рождения");

    /**
     * The column <code>ervu_dashboard.citizen.city_birth</code>. Город места
     * рождения
     */
    public final TableField<CitizenRecord, String> CITY_BIRTH = createField(DSL.name("city_birth"), SQLDataType.VARCHAR, this, "Город места рождения");

    /**
     * The column <code>ervu_dashboard.citizen.right_deferment</code>. Имеет
     * право на отсрочку
     */
    public final TableField<CitizenRecord, Boolean> RIGHT_DEFERMENT = createField(DSL.name("right_deferment"), SQLDataType.BOOLEAN, this, "Имеет право на отсрочку");

    /**
     * The column <code>ervu_dashboard.citizen.took_break</code>. Воспользовался
     * отсрочкой
     */
    public final TableField<CitizenRecord, Boolean> TOOK_BREAK = createField(DSL.name("took_break"), SQLDataType.BOOLEAN, this, "Воспользовался отсрочкой");

    /**
     * The column <code>ervu_dashboard.citizen.medic</code>. Является медиком
     */
    public final TableField<CitizenRecord, Boolean> MEDIC = createField(DSL.name("medic"), SQLDataType.BOOLEAN, this, "Является медиком");

    /**
     * The column <code>ervu_dashboard.citizen.sports_category</code>. Имеет
     * спортивный разряд/звание
     */
    public final TableField<CitizenRecord, Boolean> SPORTS_CATEGORY = createField(DSL.name("sports_category"), SQLDataType.BOOLEAN, this, "Имеет спортивный разряд/звание");

    /**
     * The column <code>ervu_dashboard.citizen.tractor_license</code>. Имеет
     * удостоверение тракториста
     */
    public final TableField<CitizenRecord, Boolean> TRACTOR_LICENSE = createField(DSL.name("tractor_license"), SQLDataType.BOOLEAN, this, "Имеет удостоверение тракториста");

    /**
     * The column <code>ervu_dashboard.citizen.is_wanted</code>. Находится в
     * розыске
     */
    public final TableField<CitizenRecord, Boolean> IS_WANTED = createField(DSL.name("is_wanted"), SQLDataType.BOOLEAN, this, "Находится в розыске");

    /**
     * The column <code>ervu_dashboard.citizen.is_in_prison</code>. Находится в
     * местах лишения свободы
     */
    public final TableField<CitizenRecord, Boolean> IS_IN_PRISON = createField(DSL.name("is_in_prison"), SQLDataType.BOOLEAN, this, "Находится в местах лишения свободы");

    /**
     * The column <code>ervu_dashboard.citizen.acquired_citizenship</code>.
     * Получивший гражданство
     */
    public final TableField<CitizenRecord, Boolean> ACQUIRED_CITIZENSHIP = createField(DSL.name("acquired_citizenship"), SQLDataType.BOOLEAN, this, "Получивший гражданство");

    /**
     * The column <code>ervu_dashboard.citizen.urgent_service</code>. Признак
     * критерия срочной службы
     */
    public final TableField<CitizenRecord, Boolean> URGENT_SERVICE = createField(DSL.name("urgent_service"), SQLDataType.BOOLEAN, this, "Признак критерия срочной службы");

    /**
     * The column <code>ervu_dashboard.citizen.contract_service</code>. Признак
     * критерия контрактной службы
     */
    public final TableField<CitizenRecord, Boolean> CONTRACT_SERVICE = createField(DSL.name("contract_service"), SQLDataType.BOOLEAN, this, "Признак критерия контрактной службы");

    /**
     * The column <code>ervu_dashboard.citizen.mobilization</code>. Признак
     * критерия службы по мобмлизации
     */
    public final TableField<CitizenRecord, Boolean> MOBILIZATION = createField(DSL.name("mobilization"), SQLDataType.BOOLEAN, this, "Признак критерия службы по мобмлизации");

    /**
     * The column <code>ervu_dashboard.citizen.full_name</code>.
     */
    public final TableField<CitizenRecord, String> FULL_NAME = createField(DSL.name("full_name"), SQLDataType.VARCHAR, this, "");

    /**
     * The column <code>ervu_dashboard.citizen.last_name</code>.
     */
    public final TableField<CitizenRecord, String> LAST_NAME = createField(DSL.name("last_name"), SQLDataType.VARCHAR, this, "");

    /**
     * The column <code>ervu_dashboard.citizen.first_name</code>.
     */
    public final TableField<CitizenRecord, String> FIRST_NAME = createField(DSL.name("first_name"), SQLDataType.VARCHAR, this, "");

    /**
     * The column <code>ervu_dashboard.citizen.middle_name</code>.
     */
    public final TableField<CitizenRecord, String> MIDDLE_NAME = createField(DSL.name("middle_name"), SQLDataType.VARCHAR, this, "");

    /**
     * The column <code>ervu_dashboard.citizen.age</code>.
     */
    public final TableField<CitizenRecord, BigDecimal> AGE = createField(DSL.name("age"), SQLDataType.NUMERIC, this, "");

    /**
     * The column <code>ervu_dashboard.citizen.birth_place</code>.
     */
    public final TableField<CitizenRecord, String> BIRTH_PLACE = createField(DSL.name("birth_place"), SQLDataType.VARCHAR, this, "");

    /**
     * The column <code>ervu_dashboard.citizen.number_children</code>.
     */
    public final TableField<CitizenRecord, BigDecimal> NUMBER_CHILDREN = createField(DSL.name("number_children"), SQLDataType.NUMERIC, this, "");

    /**
     * The column <code>ervu_dashboard.citizen.birth_date</code>.
     */
    public final TableField<CitizenRecord, Date> BIRTH_DATE = createField(DSL.name("birth_date"), SQLDataType.DATE, this, "");

    /**
     * The column <code>ervu_dashboard.citizen.recruit_id</code>. id рекрута из
     * БД ЕРВУ
     */
    public final TableField<CitizenRecord, UUID> RECRUIT_ID = createField(DSL.name("recruit_id"), SQLDataType.UUID.nullable(false), this, "id рекрута из БД ЕРВУ");

    /**
     * The column <code>ervu_dashboard.citizen.recruitment_id</code>.
     */
    public final TableField<CitizenRecord, String> RECRUITMENT_ID = createField(DSL.name("recruitment_id"), SQLDataType.CHAR(36), this, "");

    /**
     * The column <code>ervu_dashboard.citizen.issue_date</code>.
     */
    public final TableField<CitizenRecord, Date> ISSUE_DATE = createField(DSL.name("issue_date"), SQLDataType.DATE, this, "");

    /**
     * The column <code>ervu_dashboard.citizen.number_children_18_old</code>.
     */
    public final TableField<CitizenRecord, BigDecimal> NUMBER_CHILDREN_18_OLD = createField(DSL.name("number_children_18_old"), SQLDataType.NUMERIC, this, "");

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

    private Citizen(Name alias, Table<CitizenRecord> aliased, Field<?>[] parameters, Condition where) {
        super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table(), where);
    }

    /**
     * Create an aliased <code>ervu_dashboard.citizen</code> table reference
     */
    public Citizen(String alias) {
        this(DSL.name(alias), CITIZEN);
    }

    /**
     * Create an aliased <code>ervu_dashboard.citizen</code> table reference
     */
    public Citizen(Name alias) {
        this(alias, CITIZEN);
    }

    /**
     * Create a <code>ervu_dashboard.citizen</code> table reference
     */
    public Citizen() {
        this(DSL.name("citizen"), null);
    }

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

    @Override
    public UniqueKey<CitizenRecord> getPrimaryKey() {
        return Keys.CITIZEN_PKEY;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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