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


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 org.jooq.types.YearToSecond;

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.ViewUserWorkTimeRecord;


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

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of <code>journal_log.view_user_work_time</code>
     */
    public static final ViewUserWorkTime VIEW_USER_WORK_TIME = new ViewUserWorkTime();

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

    /**
     * The column
     * <code>journal_log.view_user_work_time.user_work_time_id</code>.
     */
    public final TableField<ViewUserWorkTimeRecord, Long> USER_WORK_TIME_ID = createField(DSL.name("user_work_time_id"), SQLDataType.BIGINT, this, "");

    /**
     * The column <code>journal_log.view_user_work_time.working_time</code>.
     */
    public final TableField<ViewUserWorkTimeRecord, YearToSecond> WORKING_TIME = createField(DSL.name("working_time"), SQLDataType.INTERVAL, this, "");

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

    private ViewUserWorkTime(Name alias, Table<ViewUserWorkTimeRecord> aliased, Field<?>[] parameters, Condition where) {
        super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.view("""
        create view "view_user_work_time" as  SELECT user_work_time.user_work_time_id,
         (user_work_time.stop_working_time - user_work_time.start_working_time) AS working_time
        FROM journal_log.user_work_time;
        """), where);
    }

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

    /**
     * Create an aliased <code>journal_log.view_user_work_time</code> table
     * reference
     */
    public ViewUserWorkTime(Name alias) {
        this(alias, VIEW_USER_WORK_TIME);
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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