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


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.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.ervu_dashboard.db_beans.ratings.Keys;
import ru.micord.ervu_dashboard.db_beans.ratings.Ratings;
import ru.micord.ervu_dashboard.db_beans.ratings.tables.records.AppearSubppoenaRecord;


/**
 * Явка по повестке уровень РФ
 */
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class AppearSubppoena extends TableImpl<AppearSubppoenaRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of <code>ratings.appear_subppoena</code>
     */
    public static final AppearSubppoena APPEAR_SUBPPOENA = new AppearSubppoena();

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

    /**
     * The column <code>ratings.appear_subppoena.id_appear_subppoena</code>.
     */
    public final TableField<AppearSubppoenaRecord, Long> ID_APPEAR_SUBPPOENA = createField(DSL.name("id_appear_subppoena"), SQLDataType.BIGINT.nullable(false).identity(true), this, "");

    /**
     * The column <code>ratings.appear_subppoena.appear_mil_com</code>. Явка в
     * военкомат
     */
    public final TableField<AppearSubppoenaRecord, BigDecimal> APPEAR_MIL_COM = createField(DSL.name("appear_mil_com"), SQLDataType.NUMERIC, this, "Явка в военкомат");

    /**
     * The column <code>ratings.appear_subppoena.recording_date</code>. Дата
     * записи
     */
    public final TableField<AppearSubppoenaRecord, Date> RECORDING_DATE = createField(DSL.name("recording_date"), SQLDataType.DATE.nullable(false).defaultValue(DSL.field(DSL.raw("(now())::date"), SQLDataType.DATE)), this, "Дата записи");

    /**
     * The column <code>ratings.appear_subppoena.appear_mil_com_percent</code>.
     * Явка в военкомат в процентах
     */
    public final TableField<AppearSubppoenaRecord, BigDecimal> APPEAR_MIL_COM_PERCENT = createField(DSL.name("appear_mil_com_percent"), SQLDataType.NUMERIC, this, "Явка в военкомат в процентах");

    /**
     * The column <code>ratings.appear_subppoena.recruitment_id</code>.
     */
    public final TableField<AppearSubppoenaRecord, UUID> RECRUITMENT_ID = createField(DSL.name("recruitment_id"), SQLDataType.UUID, this, "");

    /**
     * The column <code>ratings.appear_subppoena.id_region</code>.
     */
    public final TableField<AppearSubppoenaRecord, UUID> ID_REGION = createField(DSL.name("id_region"), SQLDataType.UUID.nullable(false), this, "");

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

    private AppearSubppoena(Name alias, Table<AppearSubppoenaRecord> aliased, Field<?>[] parameters, Condition where) {
        super(alias, null, aliased, parameters, DSL.comment("Явка по повестке уровень РФ"), TableOptions.table(), where);
    }

    /**
     * Create an aliased <code>ratings.appear_subppoena</code> table reference
     */
    public AppearSubppoena(String alias) {
        this(DSL.name(alias), APPEAR_SUBPPOENA);
    }

    /**
     * Create an aliased <code>ratings.appear_subppoena</code> table reference
     */
    public AppearSubppoena(Name alias) {
        this(alias, APPEAR_SUBPPOENA);
    }

    /**
     * Create a <code>ratings.appear_subppoena</code> table reference
     */
    public AppearSubppoena() {
        this(DSL.name("appear_subppoena"), null);
    }

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

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

    @Override
    public UniqueKey<AppearSubppoenaRecord> getPrimaryKey() {
        return Keys.PK_APPEAR_SUBPPOENA;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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