/*
 * This file is generated by jOOQ.
 */
package jj.tech.paolu.repository.jooq.tables;


import java.util.Arrays;
import java.util.Collection;
import java.util.List;

import jj.tech.paolu.repository.jooq.Keys;
import jj.tech.paolu.repository.jooq.Yx;
import jj.tech.paolu.repository.jooq.tables.records.SysAdminRecord;

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


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

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of <code>yx.sys_admin</code>
     */
    public static final SysAdmin SYS_ADMIN = new SysAdmin();

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

    /**
     * The column <code>yx.sys_admin.id</code>.
     */
    public final TableField<SysAdminRecord, String> ID = createField(DSL.name("id"), SQLDataType.VARCHAR(20).nullable(false), this, "");

    /**
     * The column <code>yx.sys_admin.org_id</code>.
     */
    public final TableField<SysAdminRecord, String> ORG_ID = createField(DSL.name("org_id"), SQLDataType.VARCHAR(20).defaultValue(DSL.field(DSL.raw("NULL"), SQLDataType.VARCHAR)), this, "");

    /**
     * The column <code>yx.sys_admin.type</code>. 0管理员,1普通用户
     */
    public final TableField<SysAdminRecord, Integer> TYPE = createField(DSL.name("type"), SQLDataType.INTEGER.defaultValue(DSL.field(DSL.raw("0"), SQLDataType.INTEGER)), this, "0管理员,1普通用户");

    /**
     * The column <code>yx.sys_admin.realname</code>.
     */
    public final TableField<SysAdminRecord, String> REALNAME = createField(DSL.name("realname"), SQLDataType.VARCHAR(100).nullable(false), this, "");

    /**
     * The column <code>yx.sys_admin.username</code>.
     */
    public final TableField<SysAdminRecord, String> USERNAME = createField(DSL.name("username"), SQLDataType.VARCHAR(100).nullable(false), this, "");

    /**
     * The column <code>yx.sys_admin.password</code>. sha3_256hex
     */
    public final TableField<SysAdminRecord, String> PASSWORD = createField(DSL.name("password"), SQLDataType.VARCHAR(100).nullable(false), this, "sha3_256hex");

    /**
     * The column <code>yx.sys_admin.islock</code>. 0正常,1锁定
     */
    public final TableField<SysAdminRecord, Integer> ISLOCK = createField(DSL.name("islock"), SQLDataType.INTEGER.defaultValue(DSL.field(DSL.raw("0"), SQLDataType.INTEGER)), this, "0正常,1锁定");

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

    private SysAdmin(Name alias, Table<SysAdminRecord> aliased, Field<?>[] parameters, Condition where) {
        super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table(), where);
    }

    /**
     * Create an aliased <code>yx.sys_admin</code> table reference
     */
    public SysAdmin(String alias) {
        this(DSL.name(alias), SYS_ADMIN);
    }

    /**
     * Create an aliased <code>yx.sys_admin</code> table reference
     */
    public SysAdmin(Name alias) {
        this(alias, SYS_ADMIN);
    }

    /**
     * Create a <code>yx.sys_admin</code> table reference
     */
    public SysAdmin() {
        this(DSL.name("sys_admin"), null);
    }

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

    @Override
    public UniqueKey<SysAdminRecord> getPrimaryKey() {
        return Keys.KEY_SYS_ADMIN_PRIMARY;
    }

    @Override
    public List<UniqueKey<SysAdminRecord>> getUniqueKeys() {
        return Arrays.asList(Keys.KEY_SYS_ADMIN_USERNAME);
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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