import { FieldInfo } from 'model-util-base'
import { ConditionUtil, ConditionUtilImpl, FieldUtil, TableUtilImpl, IdType, JoinTable, SubTable } from 'model-util'
import { Container, Singleton } from 'typescript-ioc' 
import { CmCity } from '../models/index' 
/**
 * @author auto generate
 * @version 1.0
 * @date 2021-12-13 14:52
 */
interface CmCityCU extends ConditionUtil<CmCityCU>{
    ID:FieldUtil<CmCityCU>;
    CODE:FieldUtil<CmCityCU>;
    PROV_ID:FieldUtil<CmCityCU>;
    NAME:FieldUtil<CmCityCU>;
    CAR_PREFFIX:FieldUtil<CmCityCU>;
}

class CmCityCUImpl extends ConditionUtilImpl<CmCityCUImpl> implements CmCityCU{ 
    newInstance(): CmCityCUImpl {
        return new CmCityCUImpl();
    } 
    get ID(): FieldUtil<CmCityCU>{  
        return new FieldUtil('ID','id','唯一标识', this);
    }
    get CODE(): FieldUtil<CmCityCU>{  
        return new FieldUtil('CODE','code','代码', this);
    }
    get PROV_ID(): FieldUtil<CmCityCU>{  
        return new FieldUtil('PROV_ID','provId','', this);
    }
    get NAME(): FieldUtil<CmCityCU>{  
        return new FieldUtil('NAME','name','', this);
    }
    get CAR_PREFFIX(): FieldUtil<CmCityCU>{  
        return new FieldUtil('CAR_PREFFIX','carPreffix','', this);
    }
}

@Singleton 
class CmCityMU extends TableUtilImpl<CmCityCU,CmCity>{ 
    tableName  = 'cm_city';
    tableFields  = ['ID','CODE','PROV_ID','NAME','CAR_PREFFIX'];
    modelFields  = ['id','code','provId','name','carPreffix'];
    modelIdFields  = ['id'];
    tableIdFields  = ['ID'];
    idType = IdType.CUSTOM;
    joinTables = [];
    subTables = [];

    createConditionUtil(): CmCityCU {
        return new CmCityCUImpl();
    }   

    static get ID(): FieldUtil<CmCityCU>{ 
        return new FieldUtil('ID','id','唯一标识', new CmCityCUImpl());
    }
    static get CODE(): FieldUtil<CmCityCU>{ 
        return new FieldUtil('CODE','code','代码', new CmCityCUImpl());
    }
    static get PROV_ID(): FieldUtil<CmCityCU>{ 
        return new FieldUtil('PROV_ID','provId','', new CmCityCUImpl());
    }
    static get NAME(): FieldUtil<CmCityCU>{ 
        return new FieldUtil('NAME','name','', new CmCityCUImpl());
    }
    static get CAR_PREFFIX(): FieldUtil<CmCityCU>{ 
        return new FieldUtil('CAR_PREFFIX','carPreffix','', new CmCityCUImpl());
    }

    get ID(): FieldUtil<CmCityCU>{ 
        return CmCityMU.ID;
    }
    get CODE(): FieldUtil<CmCityCU>{ 
        return CmCityMU.CODE;
    }
    get PROV_ID(): FieldUtil<CmCityCU>{ 
        return CmCityMU.PROV_ID;
    }
    get NAME(): FieldUtil<CmCityCU>{ 
        return CmCityMU.NAME;
    }
    get CAR_PREFFIX(): FieldUtil<CmCityCU>{ 
        return CmCityMU.CAR_PREFFIX;
    }
}
export {CmCityMU, CmCityCU}
