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

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

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;


/**
 * сведения о гражданах, стоящих на учете в ПНД/по ВИЧ
 */
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class MedicalAuthorities extends TableImpl<MedicalAuthoritiesRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of <code>ervu_dashboard.medical_authorities</code>
     */
    public static final MedicalAuthorities MEDICAL_AUTHORITIES = new MedicalAuthorities();

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

    /**
     * The column
     * <code>ervu_dashboard.medical_authorities.medical_authorities_id</code>.
     */
    public final TableField<MedicalAuthoritiesRecord, Long> MEDICAL_AUTHORITIES_ID = createField(DSL.name("medical_authorities_id"), SQLDataType.BIGINT.nullable(false).identity(true), this, "");

    /**
     * The column <code>ervu_dashboard.medical_authorities.recruit_id</code>.
     * ссылка на гражданина (citizen)
     */
    public final TableField<MedicalAuthoritiesRecord, UUID> RECRUIT_ID = createField(DSL.name("recruit_id"), SQLDataType.UUID.nullable(false), this, "ссылка на гражданина (citizen)");

    /**
     * The column <code>ervu_dashboard.medical_authorities.start_date</code>.
     * дата постановки на учет
     */
    public final TableField<MedicalAuthoritiesRecord, Date> START_DATE = createField(DSL.name("start_date"), SQLDataType.DATE, this, "дата постановки на учет");

    /**
     * The column <code>ervu_dashboard.medical_authorities.close_date</code>.
     * дата снятия с учета
     */
    public final TableField<MedicalAuthoritiesRecord, Date> CLOSE_DATE = createField(DSL.name("close_date"), SQLDataType.DATE, this, "дата снятия с учета");

    /**
     * The column <code>ervu_dashboard.medical_authorities.change_date</code>.
     * дата планового срока пересмотра диагноза
     */
    public final TableField<MedicalAuthoritiesRecord, Date> CHANGE_DATE = createField(DSL.name("change_date"), SQLDataType.DATE, this, "дата планового срока пересмотра диагноза");

    /**
     * The column <code>ervu_dashboard.medical_authorities.hiv</code>. на учете
     * по ВИЧ(true) или в ПНД(false)
     */
    public final TableField<MedicalAuthoritiesRecord, Boolean> HIV = createField(DSL.name("hiv"), SQLDataType.BOOLEAN.defaultValue(DSL.field(DSL.raw("false"), SQLDataType.BOOLEAN)), this, "на учете по ВИЧ(true) или в ПНД(false)");

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

    private MedicalAuthorities(Name alias, Table<MedicalAuthoritiesRecord> aliased, Field<?>[] parameters, Condition where) {
        super(alias, null, aliased, parameters, DSL.comment("сведения о гражданах, стоящих на учете в ПНД/по ВИЧ"), TableOptions.table(), where);
    }

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

    /**
     * Create an aliased <code>ervu_dashboard.medical_authorities</code> table
     * reference
     */
    public MedicalAuthorities(Name alias) {
        this(alias, MEDICAL_AUTHORITIES);
    }

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

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

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

    @Override
    public UniqueKey<MedicalAuthoritiesRecord> getPrimaryKey() {
        return Keys.PK_MEDICAL_AUTHORITIES;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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