/*
 * This file is generated by jOOQ.
 */
package ru.micord.webbpm.ervu.business_metrics.db_beans.journal_log.tables;


import java.math.BigDecimal;
import java.util.Collection;

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.impl.DSL;
import org.jooq.impl.SQLDataType;
import org.jooq.impl.TableImpl;

import ru.micord.webbpm.ervu.business_metrics.db_beans.journal_log.JournalLog;
import ru.micord.webbpm.ervu.business_metrics.db_beans.journal_log.tables.records.ViewLoadRecordJourRecord;


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

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of <code>journal_log.view_load_record_jour</code>
     */
    public static final ViewLoadRecordJour VIEW_LOAD_RECORD_JOUR = new ViewLoadRecordJour();

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

    /**
     * The column
     * <code>journal_log.view_load_record_jour.load_record_jour_id</code>.
     */
    public final TableField<ViewLoadRecordJourRecord, Long> LOAD_RECORD_JOUR_ID = createField(DSL.name("load_record_jour_id"), SQLDataType.BIGINT, this, "");

    /**
     * The column <code>journal_log.view_load_record_jour.count_all</code>.
     */
    public final TableField<ViewLoadRecordJourRecord, Long> COUNT_ALL = createField(DSL.name("count_all"), SQLDataType.BIGINT, this, "");

    /**
     * The column
     * <code>journal_log.view_load_record_jour.percent_inform_system</code>.
     */
    public final TableField<ViewLoadRecordJourRecord, BigDecimal> PERCENT_INFORM_SYSTEM = createField(DSL.name("percent_inform_system"), SQLDataType.NUMERIC, this, "");

    /**
     * The column <code>journal_log.view_load_record_jour.percent_gir_vu</code>.
     */
    public final TableField<ViewLoadRecordJourRecord, BigDecimal> PERCENT_GIR_VU = createField(DSL.name("percent_gir_vu"), SQLDataType.NUMERIC, this, "");

    /**
     * The column
     * <code>journal_log.view_load_record_jour.percent_compare_citizen_info</code>.
     */
    public final TableField<ViewLoadRecordJourRecord, BigDecimal> PERCENT_COMPARE_CITIZEN_INFO = createField(DSL.name("percent_compare_citizen_info"), SQLDataType.NUMERIC, this, "");

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

    private ViewLoadRecordJour(Name alias, Table<ViewLoadRecordJourRecord> aliased, Field<?>[] parameters, Condition where) {
        super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.view("""
        create view "view_load_record_jour" as  SELECT load_record_jour.load_record_jour_id,
         ((load_record_jour.count_inform_system + load_record_jour.count_gir_vu) + load_record_jour.count_compare_citizen_info) AS count_all,
         round((((load_record_jour.count_inform_system)::numeric * (100)::numeric) / (((load_record_jour.count_inform_system + load_record_jour.count_gir_vu) + load_record_jour.count_compare_citizen_info))::numeric)) AS percent_inform_system,
         round((((load_record_jour.count_gir_vu)::numeric * (100)::numeric) / (((load_record_jour.count_inform_system + load_record_jour.count_gir_vu) + load_record_jour.count_compare_citizen_info))::numeric)) AS percent_gir_vu,
         round((((load_record_jour.count_compare_citizen_info)::numeric * (100)::numeric) / (((load_record_jour.count_inform_system + load_record_jour.count_gir_vu) + load_record_jour.count_compare_citizen_info))::numeric)) AS percent_compare_citizen_info
        FROM journal_log.load_record_jour;
        """), where);
    }

    /**
     * Create an aliased <code>journal_log.view_load_record_jour</code> table
     * reference
     */
    public ViewLoadRecordJour(String alias) {
        this(DSL.name(alias), VIEW_LOAD_RECORD_JOUR);
    }

    /**
     * Create an aliased <code>journal_log.view_load_record_jour</code> table
     * reference
     */
    public ViewLoadRecordJour(Name alias) {
        this(alias, VIEW_LOAD_RECORD_JOUR);
    }

    /**
     * Create a <code>journal_log.view_load_record_jour</code> table reference
     */
    public ViewLoadRecordJour() {
        this(DSL.name("view_load_record_jour"), null);
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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