import {ModelConditionUtil, ModelConditionUtilImpl, FieldUtil, TableUtilImpl, IdType, BasicFieldUtil, JoinTable, SubTable, DataState } from 'model-util'
import {Container, Singleton} from 'typescript-ioc' 
/**
 * @author Keytop midend auto generate
 * @version 1.0
 * @date 2020-06-13 11:02
 */
interface SysUserDemo{
    /**
    * ID
    * @type { string }
    */
    id?: string;
    /**
    * 姓名
    * @type { string }
    */
    name?: string;
}
interface SysUserDemoMCU extends ModelConditionUtil<SysUserDemoMCU>{
    ID:FieldUtil<SysUserDemoMCU>;
    NAME:FieldUtil<SysUserDemoMCU>;
}

class SysUserDemoMCUImpl extends ModelConditionUtilImpl<SysUserDemoMCUImpl> implements SysUserDemoMCU{ 
    newInstance(): SysUserDemoMCUImpl {
        return new SysUserDemoMCUImpl();
    } 
    get ID(): FieldUtil<SysUserDemoMCU>{  
        return new FieldUtil('ID','id','ID', this);
    }
    get NAME(): FieldUtil<SysUserDemoMCU>{  
        return new FieldUtil('NAME','name','姓名', this);
    }
}

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

    createModelConditionUtil(): SysUserDemoMCU {
        return new SysUserDemoMCUImpl();
    }   

    static get ID(): FieldUtil<SysUserDemoMCU>{ 
        return new FieldUtil('ID','id','ID', new SysUserDemoMCUImpl());
    }
    static get NAME(): FieldUtil<SysUserDemoMCU>{ 
        return new FieldUtil('NAME','name','姓名', new SysUserDemoMCUImpl());
    }

    get ID(): FieldUtil<SysUserDemoMCU>{ 
        return SysUserDemoMU.ID;
    }
    get NAME(): FieldUtil<SysUserDemoMCU>{ 
        return SysUserDemoMU.NAME;
    }
}
export {SysUserDemo, SysUserDemoMU}
