import { FieldInfo } from 'model-util-base'
import { ConditionUtil, ConditionUtilImpl, FieldUtil, TableUtilImpl, IdType, JoinTable, SubTable } from 'model-util'
import { Container, Singleton } from 'typescript-ioc' 
import { TelephoneArea } from '../models/index' 
/**
 * @author auto generate
 * @version 1.0
 * @date 2020-10-16 11:27
 */
interface TelephoneAreaCU extends ConditionUtil<TelephoneAreaCU>{
    ID:FieldUtil<TelephoneAreaCU>;
    AREA_NAME:FieldUtil<TelephoneAreaCU>;
    AREA_CODE:FieldUtil<TelephoneAreaCU>;
    REMARK:FieldUtil<TelephoneAreaCU>;
    STATE:FieldUtil<TelephoneAreaCU>;
}

class TelephoneAreaCUImpl extends ConditionUtilImpl<TelephoneAreaCUImpl> implements TelephoneAreaCU{ 
    newInstance(): TelephoneAreaCUImpl {
        return new TelephoneAreaCUImpl();
    } 
    get ID(): FieldUtil<TelephoneAreaCU>{  
        return new FieldUtil('ID','id','', this);
    }
    get AREA_NAME(): FieldUtil<TelephoneAreaCU>{  
        return new FieldUtil('AREA_NAME','areaName','区域名称', this);
    }
    get AREA_CODE(): FieldUtil<TelephoneAreaCU>{  
        return new FieldUtil('AREA_CODE','areaCode','手机区域号', this);
    }
    get REMARK(): FieldUtil<TelephoneAreaCU>{  
        return new FieldUtil('REMARK','remark','备注', this);
    }
    get STATE(): FieldUtil<TelephoneAreaCU>{  
        return new FieldUtil('STATE','state','0-正常，1-删除', this);
    }
}

@Singleton 
class TelephoneAreaMU extends TableUtilImpl<TelephoneAreaCU,TelephoneArea>{ 
    tableName  = 'telephone_area';
    tableFields  = ['id','area_name','area_code','remark','state'];
    modelFields  = ['id','areaName','areaCode','remark','state'];
    modelIdFields  = ['id'];
    tableIdFields  = ['id'];
    idType = IdType.CUSTOM;
    joinTables = [];
    subTables = [];

    createConditionUtil(): TelephoneAreaCU {
        return new TelephoneAreaCUImpl();
    }   

    static get ID(): FieldUtil<TelephoneAreaCU>{ 
        return new FieldUtil('ID','id','', new TelephoneAreaCUImpl());
    }
    static get AREA_NAME(): FieldUtil<TelephoneAreaCU>{ 
        return new FieldUtil('AREA_NAME','areaName','区域名称', new TelephoneAreaCUImpl());
    }
    static get AREA_CODE(): FieldUtil<TelephoneAreaCU>{ 
        return new FieldUtil('AREA_CODE','areaCode','手机区域号', new TelephoneAreaCUImpl());
    }
    static get REMARK(): FieldUtil<TelephoneAreaCU>{ 
        return new FieldUtil('REMARK','remark','备注', new TelephoneAreaCUImpl());
    }
    static get STATE(): FieldUtil<TelephoneAreaCU>{ 
        return new FieldUtil('STATE','state','0-正常，1-删除', new TelephoneAreaCUImpl());
    }

    get ID(): FieldUtil<TelephoneAreaCU>{ 
        return TelephoneAreaMU.ID;
    }
    get AREA_NAME(): FieldUtil<TelephoneAreaCU>{ 
        return TelephoneAreaMU.AREA_NAME;
    }
    get AREA_CODE(): FieldUtil<TelephoneAreaCU>{ 
        return TelephoneAreaMU.AREA_CODE;
    }
    get REMARK(): FieldUtil<TelephoneAreaCU>{ 
        return TelephoneAreaMU.REMARK;
    }
    get STATE(): FieldUtil<TelephoneAreaCU>{ 
        return TelephoneAreaMU.STATE;
    }
}
export {TelephoneAreaMU, TelephoneAreaCU}
