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


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

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of
     * <code>metrics.view_convert_info_not_identifited_records</code>
     */
    public static final ViewConvertInfoNotIdentifitedRecords VIEW_CONVERT_INFO_NOT_IDENTIFITED_RECORDS = new ViewConvertInfoNotIdentifitedRecords();

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

    /**
     * The column
     * <code>metrics.view_convert_info_not_identifited_records.convert_info_not_identifited_records_id</code>.
     */
    public final TableField<ViewConvertInfoNotIdentifitedRecordsRecord, Long> CONVERT_INFO_NOT_IDENTIFITED_RECORDS_ID = createField(DSL.name("convert_info_not_identifited_records_id"), SQLDataType.BIGINT, this, "");

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

    /**
     * The column
     * <code>metrics.view_convert_info_not_identifited_records.percent_not_in_xml</code>.
     */
    public final TableField<ViewConvertInfoNotIdentifitedRecordsRecord, BigDecimal> PERCENT_NOT_IN_XML = createField(DSL.name("percent_not_in_xml"), SQLDataType.NUMERIC, this, "");

    /**
     * The column
     * <code>metrics.view_convert_info_not_identifited_records.percent_not_in_csv</code>.
     */
    public final TableField<ViewConvertInfoNotIdentifitedRecordsRecord, BigDecimal> PERCENT_NOT_IN_CSV = createField(DSL.name("percent_not_in_csv"), SQLDataType.NUMERIC, this, "");

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

    private ViewConvertInfoNotIdentifitedRecords(Name alias, Table<ViewConvertInfoNotIdentifitedRecordsRecord> aliased, Field<?>[] parameters, Condition where) {
        super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.view("""
        create view "view_convert_info_not_identifited_records" as  SELECT convert_info_not_identifited_records.convert_info_not_identifited_records_id,
         (convert_info_not_identifited_records.count_not_in_csv + convert_info_not_identifited_records.count_not_in_xml) AS count_all,
         COALESCE(round((((convert_info_not_identifited_records.count_not_in_xml)::numeric * (100)::numeric) / NULLIF(((convert_info_not_identifited_records.count_not_in_csv + convert_info_not_identifited_records.count_not_in_xml))::numeric, (0)::numeric))), (0)::numeric) AS percent_not_in_xml,
         COALESCE(round((((convert_info_not_identifited_records.count_not_in_csv)::numeric * (100)::numeric) / NULLIF(((convert_info_not_identifited_records.count_not_in_csv + convert_info_not_identifited_records.count_not_in_xml))::numeric, (0)::numeric))), (0)::numeric) AS percent_not_in_csv
        FROM metrics.convert_info_not_identifited_records;
        """), where);
    }

    /**
     * Create an aliased
     * <code>metrics.view_convert_info_not_identifited_records</code> table
     * reference
     */
    public ViewConvertInfoNotIdentifitedRecords(String alias) {
        this(DSL.name(alias), VIEW_CONVERT_INFO_NOT_IDENTIFITED_RECORDS);
    }

    /**
     * Create an aliased
     * <code>metrics.view_convert_info_not_identifited_records</code> table
     * reference
     */
    public ViewConvertInfoNotIdentifitedRecords(Name alias) {
        this(alias, VIEW_CONVERT_INFO_NOT_IDENTIFITED_RECORDS);
    }

    /**
     * Create a <code>metrics.view_convert_info_not_identifited_records</code>
     * table reference
     */
    public ViewConvertInfoNotIdentifitedRecords() {
        this(DSL.name("view_convert_info_not_identifited_records"), null);
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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