import { FieldInfo } from 'model-util-base'
import { ConditionUtil, ConditionUtilImpl, FieldUtil, TableUtilImpl, IdType, JoinTable, SubTable } from 'model-util'
import { Container, Singleton } from 'typescript-ioc' 
import { BmVersion } from '../models/index' 

import {BmViewModelMU} from './BmViewModel' 


/**
 * @author auto generate
 * @version 1.0
 * @date 2020-07-31 17:08
 */
interface BmVersionCU extends ConditionUtil<BmVersionCU>{
    ID:FieldUtil<BmVersionCU>;
    SERVICE_CENTER_ID:FieldUtil<BmVersionCU>;
    APP_ID:FieldUtil<BmVersionCU>;
    BM_PROJECT_ID:FieldUtil<BmVersionCU>;
    BASIC_VERSION_ID:FieldUtil<BmVersionCU>;
    VERSION_NO:FieldUtil<BmVersionCU>;
    MAJOR:FieldUtil<BmVersionCU>;
    MINOR:FieldUtil<BmVersionCU>;
    RELEASED:FieldUtil<BmVersionCU>;
    BMS_RELEASED:FieldUtil<BmVersionCU>;
    DESCRIPTION:FieldUtil<BmVersionCU>;
    JAVA_BUILD_STATUS:FieldUtil<BmVersionCU>;
    NPM_BUILD_STATUS:FieldUtil<BmVersionCU>;
    NPM_PACKAGE_NAME:FieldUtil<BmVersionCU>;
    NODE_BUILD_STATUS:FieldUtil<BmVersionCU>;
    GRADLE_PACKAGE_NAME:FieldUtil<BmVersionCU>;
    CREATE_USER_ID:FieldUtil<BmVersionCU>;
    UPDATE_USER_ID:FieldUtil<BmVersionCU>;
    CREATE_TIME:FieldUtil<BmVersionCU>;
    UPDATE_TIME:FieldUtil<BmVersionCU>;
}

class BmVersionCUImpl extends ConditionUtilImpl<BmVersionCUImpl> implements BmVersionCU{ 
    newInstance(): BmVersionCUImpl {
        return new BmVersionCUImpl();
    } 
    get ID(): FieldUtil<BmVersionCU>{  
        return new FieldUtil('ID','id','', this);
    }
    get SERVICE_CENTER_ID(): FieldUtil<BmVersionCU>{  
        return new FieldUtil('SERVICE_CENTER_ID','serviceCenterId','', this);
    }
    get APP_ID(): FieldUtil<BmVersionCU>{  
        return new FieldUtil('APP_ID','appId','', this);
    }
    get BM_PROJECT_ID(): FieldUtil<BmVersionCU>{  
        return new FieldUtil('BM_PROJECT_ID','bmProjectId','', this);
    }
    get BASIC_VERSION_ID(): FieldUtil<BmVersionCU>{  
        return new FieldUtil('BASIC_VERSION_ID','basicVersionId','', this);
    }
    get VERSION_NO(): FieldUtil<BmVersionCU>{  
        return new FieldUtil('VERSION_NO','versionNo','', this);
    }
    get MAJOR(): FieldUtil<BmVersionCU>{  
        return new FieldUtil('MAJOR','major','', this);
    }
    get MINOR(): FieldUtil<BmVersionCU>{  
        return new FieldUtil('MINOR','minor','', this);
    }
    get RELEASED(): FieldUtil<BmVersionCU>{  
        return new FieldUtil('RELEASED','released','', this);
    }
    get BMS_RELEASED(): FieldUtil<BmVersionCU>{  
        return new FieldUtil('BMS_RELEASED','bmsReleased','', this);
    }
    get DESCRIPTION(): FieldUtil<BmVersionCU>{  
        return new FieldUtil('DESCRIPTION','description','', this);
    }
    get JAVA_BUILD_STATUS(): FieldUtil<BmVersionCU>{  
        return new FieldUtil('JAVA_BUILD_STATUS','javaBuildStatus','', this);
    }
    get NPM_BUILD_STATUS(): FieldUtil<BmVersionCU>{  
        return new FieldUtil('NPM_BUILD_STATUS','npmBuildStatus','', this);
    }
    get NPM_PACKAGE_NAME(): FieldUtil<BmVersionCU>{  
        return new FieldUtil('NPM_PACKAGE_NAME','npmPackageName','', this);
    }
    get NODE_BUILD_STATUS(): FieldUtil<BmVersionCU>{  
        return new FieldUtil('NODE_BUILD_STATUS','nodeBuildStatus','', this);
    }
    get GRADLE_PACKAGE_NAME(): FieldUtil<BmVersionCU>{  
        return new FieldUtil('GRADLE_PACKAGE_NAME','gradlePackageName','', this);
    }
    get CREATE_USER_ID(): FieldUtil<BmVersionCU>{  
        return new FieldUtil('CREATE_USER_ID','createUserId','', this);
    }
    get UPDATE_USER_ID(): FieldUtil<BmVersionCU>{  
        return new FieldUtil('UPDATE_USER_ID','updateUserId','', this);
    }
    get CREATE_TIME(): FieldUtil<BmVersionCU>{  
        return new FieldUtil('CREATE_TIME','createTime','', this);
    }
    get UPDATE_TIME(): FieldUtil<BmVersionCU>{  
        return new FieldUtil('UPDATE_TIME','updateTime','', this);
    }
}

@Singleton 
class BmVersionMU extends TableUtilImpl<BmVersionCU,BmVersion>{ 
    tableName  = 'bm_version';
    tableFields  = ['ID','SERVICE_CENTER_ID','APP_ID','BM_PROJECT_ID','BASIC_VERSION_ID','VERSION_NO','MAJOR','MINOR','RELEASED','BMS_RELEASED','DESCRIPTION','JAVA_BUILD_STATUS','NPM_BUILD_STATUS','NPM_PACKAGE_NAME','NODE_BUILD_STATUS','GRADLE_PACKAGE_NAME','CREATE_USER_ID','UPDATE_USER_ID','CREATE_TIME','UPDATE_TIME'];
    modelFields  = ['id','serviceCenterId','appId','bmProjectId','basicVersionId','versionNo','major','minor','released','bmsReleased','description','javaBuildStatus','npmBuildStatus','npmPackageName','nodeBuildStatus','gradlePackageName','createUserId','updateUserId','createTime','updateTime'];
    modelIdFields  = ['id'];
    tableIdFields  = ['ID'];
    idType = IdType.CUSTOM;
    joinTables = [];
    subTables = [{
            name: 'bmViewModel',
            parentIdFields: [BmVersionMU.ID],
            foreignKeyFields: [BmViewModelMU.VERSION_ID],
            getTableUtil: ()=>{
                return Container.get(BmViewModelMU);
            }
        } as SubTable

];

    createConditionUtil(): BmVersionCU {
        return new BmVersionCUImpl();
    }   

    static get ID(): FieldUtil<BmVersionCU>{ 
        return new FieldUtil('ID','id','', new BmVersionCUImpl());
    }
    static get SERVICE_CENTER_ID(): FieldUtil<BmVersionCU>{ 
        return new FieldUtil('SERVICE_CENTER_ID','serviceCenterId','', new BmVersionCUImpl());
    }
    static get APP_ID(): FieldUtil<BmVersionCU>{ 
        return new FieldUtil('APP_ID','appId','', new BmVersionCUImpl());
    }
    static get BM_PROJECT_ID(): FieldUtil<BmVersionCU>{ 
        return new FieldUtil('BM_PROJECT_ID','bmProjectId','', new BmVersionCUImpl());
    }
    static get BASIC_VERSION_ID(): FieldUtil<BmVersionCU>{ 
        return new FieldUtil('BASIC_VERSION_ID','basicVersionId','', new BmVersionCUImpl());
    }
    static get VERSION_NO(): FieldUtil<BmVersionCU>{ 
        return new FieldUtil('VERSION_NO','versionNo','', new BmVersionCUImpl());
    }
    static get MAJOR(): FieldUtil<BmVersionCU>{ 
        return new FieldUtil('MAJOR','major','', new BmVersionCUImpl());
    }
    static get MINOR(): FieldUtil<BmVersionCU>{ 
        return new FieldUtil('MINOR','minor','', new BmVersionCUImpl());
    }
    static get RELEASED(): FieldUtil<BmVersionCU>{ 
        return new FieldUtil('RELEASED','released','', new BmVersionCUImpl());
    }
    static get BMS_RELEASED(): FieldUtil<BmVersionCU>{ 
        return new FieldUtil('BMS_RELEASED','bmsReleased','', new BmVersionCUImpl());
    }
    static get DESCRIPTION(): FieldUtil<BmVersionCU>{ 
        return new FieldUtil('DESCRIPTION','description','', new BmVersionCUImpl());
    }
    static get JAVA_BUILD_STATUS(): FieldUtil<BmVersionCU>{ 
        return new FieldUtil('JAVA_BUILD_STATUS','javaBuildStatus','', new BmVersionCUImpl());
    }
    static get NPM_BUILD_STATUS(): FieldUtil<BmVersionCU>{ 
        return new FieldUtil('NPM_BUILD_STATUS','npmBuildStatus','', new BmVersionCUImpl());
    }
    static get NPM_PACKAGE_NAME(): FieldUtil<BmVersionCU>{ 
        return new FieldUtil('NPM_PACKAGE_NAME','npmPackageName','', new BmVersionCUImpl());
    }
    static get NODE_BUILD_STATUS(): FieldUtil<BmVersionCU>{ 
        return new FieldUtil('NODE_BUILD_STATUS','nodeBuildStatus','', new BmVersionCUImpl());
    }
    static get GRADLE_PACKAGE_NAME(): FieldUtil<BmVersionCU>{ 
        return new FieldUtil('GRADLE_PACKAGE_NAME','gradlePackageName','', new BmVersionCUImpl());
    }
    static get CREATE_USER_ID(): FieldUtil<BmVersionCU>{ 
        return new FieldUtil('CREATE_USER_ID','createUserId','', new BmVersionCUImpl());
    }
    static get UPDATE_USER_ID(): FieldUtil<BmVersionCU>{ 
        return new FieldUtil('UPDATE_USER_ID','updateUserId','', new BmVersionCUImpl());
    }
    static get CREATE_TIME(): FieldUtil<BmVersionCU>{ 
        return new FieldUtil('CREATE_TIME','createTime','', new BmVersionCUImpl());
    }
    static get UPDATE_TIME(): FieldUtil<BmVersionCU>{ 
        return new FieldUtil('UPDATE_TIME','updateTime','', new BmVersionCUImpl());
    }

    get ID(): FieldUtil<BmVersionCU>{ 
        return BmVersionMU.ID;
    }
    get SERVICE_CENTER_ID(): FieldUtil<BmVersionCU>{ 
        return BmVersionMU.SERVICE_CENTER_ID;
    }
    get APP_ID(): FieldUtil<BmVersionCU>{ 
        return BmVersionMU.APP_ID;
    }
    get BM_PROJECT_ID(): FieldUtil<BmVersionCU>{ 
        return BmVersionMU.BM_PROJECT_ID;
    }
    get BASIC_VERSION_ID(): FieldUtil<BmVersionCU>{ 
        return BmVersionMU.BASIC_VERSION_ID;
    }
    get VERSION_NO(): FieldUtil<BmVersionCU>{ 
        return BmVersionMU.VERSION_NO;
    }
    get MAJOR(): FieldUtil<BmVersionCU>{ 
        return BmVersionMU.MAJOR;
    }
    get MINOR(): FieldUtil<BmVersionCU>{ 
        return BmVersionMU.MINOR;
    }
    get RELEASED(): FieldUtil<BmVersionCU>{ 
        return BmVersionMU.RELEASED;
    }
    get BMS_RELEASED(): FieldUtil<BmVersionCU>{ 
        return BmVersionMU.BMS_RELEASED;
    }
    get DESCRIPTION(): FieldUtil<BmVersionCU>{ 
        return BmVersionMU.DESCRIPTION;
    }
    get JAVA_BUILD_STATUS(): FieldUtil<BmVersionCU>{ 
        return BmVersionMU.JAVA_BUILD_STATUS;
    }
    get NPM_BUILD_STATUS(): FieldUtil<BmVersionCU>{ 
        return BmVersionMU.NPM_BUILD_STATUS;
    }
    get NPM_PACKAGE_NAME(): FieldUtil<BmVersionCU>{ 
        return BmVersionMU.NPM_PACKAGE_NAME;
    }
    get NODE_BUILD_STATUS(): FieldUtil<BmVersionCU>{ 
        return BmVersionMU.NODE_BUILD_STATUS;
    }
    get GRADLE_PACKAGE_NAME(): FieldUtil<BmVersionCU>{ 
        return BmVersionMU.GRADLE_PACKAGE_NAME;
    }
    get CREATE_USER_ID(): FieldUtil<BmVersionCU>{ 
        return BmVersionMU.CREATE_USER_ID;
    }
    get UPDATE_USER_ID(): FieldUtil<BmVersionCU>{ 
        return BmVersionMU.UPDATE_USER_ID;
    }
    get CREATE_TIME(): FieldUtil<BmVersionCU>{ 
        return BmVersionMU.CREATE_TIME;
    }
    get UPDATE_TIME(): FieldUtil<BmVersionCU>{ 
        return BmVersionMU.UPDATE_TIME;
    }
}
export {BmVersionMU, BmVersionCU}
