import { FieldInfo } from 'model-util-base'
import { ConditionUtil, ConditionUtilImpl, FieldUtil, TableUtilImpl, IdType, JoinTable, SubTable } from 'model-util'
import { Container, Singleton } from 'typescript-ioc' 
import { SysUser } from '../models/index' 
/**
 * @author auto generate
 * @version 1.0
 * @date 2020-07-31 17:08
 */
interface SysUserCU extends ConditionUtil<SysUserCU>{
    ID:FieldUtil<SysUserCU>;
    NAME:FieldUtil<SysUserCU>;
}

class SysUserCUImpl extends ConditionUtilImpl<SysUserCUImpl> implements SysUserCU{ 
    newInstance(): SysUserCUImpl {
        return new SysUserCUImpl();
    } 
    get ID(): FieldUtil<SysUserCU>{  
        return new FieldUtil('ID','id','', this);
    }
    get NAME(): FieldUtil<SysUserCU>{  
        return new FieldUtil('NAME','name','', this);
    }
}

@Singleton 
class SysUserMU extends TableUtilImpl<SysUserCU,SysUser>{ 
    tableName  = 'sys_user_demo';
    tableFields  = ['id','name'];
    modelFields  = ['id','name'];
    modelIdFields  = ['id'];
    tableIdFields  = ['id'];
    idType = IdType.CUSTOM;
    joinTables = [];
    subTables = [];

    createConditionUtil(): SysUserCU {
        return new SysUserCUImpl();
    }   

    static get ID(): FieldUtil<SysUserCU>{ 
        return new FieldUtil('ID','id','', new SysUserCUImpl());
    }
    static get NAME(): FieldUtil<SysUserCU>{ 
        return new FieldUtil('NAME','name','', new SysUserCUImpl());
    }

    get ID(): FieldUtil<SysUserCU>{ 
        return SysUserMU.ID;
    }
    get NAME(): FieldUtil<SysUserCU>{ 
        return SysUserMU.NAME;
    }
}
export {SysUserMU, SysUserCU}
