import {ModelUtil, ModelUtilImpl, ConditionUtil, ConditionUtilImpl, FieldUtil } from 'model-util'
import {Container, Singleton} from 'typescript-ioc' 
import { GatewayVO } from '../models/index' 


/**
 * @author auto generate
 * @version 1.0
 * @date 2021-05-28 14:16
 */
interface GatewayVOCU extends ConditionUtil<GatewayVOCU>{
    ID:FieldUtil<GatewayVOCU>;
    K8S_ID:FieldUtil<GatewayVOCU>;
    NAME:FieldUtil<GatewayVOCU>;
    LABEL:FieldUtil<GatewayVOCU>;
    CONFIG_CENTER_CODE:FieldUtil<GatewayVOCU>;
    IMAGE_ID:FieldUtil<GatewayVOCU>;
    SPEC_NAME:FieldUtil<GatewayVOCU>;
    METRICS_NAME:FieldUtil<GatewayVOCU>;
    IMAGE_PORT_MAPPING:FieldUtil<GatewayVOCU>;
    DOMAIN:FieldUtil<GatewayVOCU>;
    URI:FieldUtil<GatewayVOCU>;
    SLB:FieldUtil<GatewayVOCU>;
    DELETED:FieldUtil<GatewayVOCU>;
}

class GatewayVOCUImpl extends ConditionUtilImpl<GatewayVOCUImpl> implements GatewayVOCU{ 
    newInstance(): GatewayVOCUImpl {
        return new GatewayVOCUImpl();
    } 
    get ID(): FieldUtil<GatewayVOCU>{  
        return new FieldUtil('id','id','id', this);
    }
    get K8S_ID(): FieldUtil<GatewayVOCU>{  
        return new FieldUtil('k8s_id','k8sId','k8s_id', this);
    }
    get NAME(): FieldUtil<GatewayVOCU>{  
        return new FieldUtil('name','name','name', this);
    }
    get LABEL(): FieldUtil<GatewayVOCU>{  
        return new FieldUtil('label','label','label', this);
    }
    get CONFIG_CENTER_CODE(): FieldUtil<GatewayVOCU>{  
        return new FieldUtil('config_center_code','configCenterCode','config_center_code', this);
    }
    get IMAGE_ID(): FieldUtil<GatewayVOCU>{  
        return new FieldUtil('image_id','imageId','image_id', this);
    }
    get SPEC_NAME(): FieldUtil<GatewayVOCU>{  
        return new FieldUtil('spec_name','specName','spec_name', this);
    }
    get METRICS_NAME(): FieldUtil<GatewayVOCU>{  
        return new FieldUtil('metrics_name','metricsName','metrics_name', this);
    }
    get IMAGE_PORT_MAPPING(): FieldUtil<GatewayVOCU>{  
        return new FieldUtil('image_port_mapping','imagePortMapping','image_port_mapping', this);
    }
    get DOMAIN(): FieldUtil<GatewayVOCU>{  
        return new FieldUtil('domain','domain','domain', this);
    }
    get URI(): FieldUtil<GatewayVOCU>{  
        return new FieldUtil('uri','uri','uri', this);
    }
    get SLB(): FieldUtil<GatewayVOCU>{  
        return new FieldUtil('slb','slb','slb', this);
    }
    get DELETED(): FieldUtil<GatewayVOCU>{  
        return new FieldUtil('deleted','deleted','deleted', this);
    }
}

@Singleton
class GatewayVOMU extends ModelUtilImpl<GatewayVOCU,GatewayVO>{ 
    joinTables = [];
    selectSQL ='select  g.id as id,g.k8s_id,g.name as name,t.name as label,g.config_center_code,g.image_id,d.name as spec_name,m."name" as metrics_name,g.image_port_mapping,g."domain",g.uri,s."name" as slb,g.deleted from kt_cn.cn_gateway g left join  kt_cn.cn_label t on g.label_id = t.id left join kt_cn.cn_slb s on g.cn_slb_id = s."id" left join  kt_ms.ms_monitor_metrics_template m on g.metrics_template_id = m.id left join kt_ms.ms_deploy_spec_template d on g.spec_template_id = d.id';
    tableFields  = ['id','k8s_id','name','label','config_center_code','image_id','spec_name','metrics_name','image_port_mapping','domain','uri','slb','deleted'];
    modelFields  = ['id','k8sId','name','label','configCenterCode','imageId','specName','metricsName','imagePortMapping','domain','uri','slb','deleted'];

    createConditionUtil(): GatewayVOCU {
        return new GatewayVOCUImpl();
    }   

    static get ID(): FieldUtil<GatewayVOCU>{ 
        return new FieldUtil('id','id','id', new GatewayVOCUImpl());
    }
    static get K8S_ID(): FieldUtil<GatewayVOCU>{ 
        return new FieldUtil('k8s_id','k8sId','k8s_id', new GatewayVOCUImpl());
    }
    static get NAME(): FieldUtil<GatewayVOCU>{ 
        return new FieldUtil('name','name','name', new GatewayVOCUImpl());
    }
    static get LABEL(): FieldUtil<GatewayVOCU>{ 
        return new FieldUtil('label','label','label', new GatewayVOCUImpl());
    }
    static get CONFIG_CENTER_CODE(): FieldUtil<GatewayVOCU>{ 
        return new FieldUtil('config_center_code','configCenterCode','config_center_code', new GatewayVOCUImpl());
    }
    static get IMAGE_ID(): FieldUtil<GatewayVOCU>{ 
        return new FieldUtil('image_id','imageId','image_id', new GatewayVOCUImpl());
    }
    static get SPEC_NAME(): FieldUtil<GatewayVOCU>{ 
        return new FieldUtil('spec_name','specName','spec_name', new GatewayVOCUImpl());
    }
    static get METRICS_NAME(): FieldUtil<GatewayVOCU>{ 
        return new FieldUtil('metrics_name','metricsName','metrics_name', new GatewayVOCUImpl());
    }
    static get IMAGE_PORT_MAPPING(): FieldUtil<GatewayVOCU>{ 
        return new FieldUtil('image_port_mapping','imagePortMapping','image_port_mapping', new GatewayVOCUImpl());
    }
    static get DOMAIN(): FieldUtil<GatewayVOCU>{ 
        return new FieldUtil('domain','domain','domain', new GatewayVOCUImpl());
    }
    static get URI(): FieldUtil<GatewayVOCU>{ 
        return new FieldUtil('uri','uri','uri', new GatewayVOCUImpl());
    }
    static get SLB(): FieldUtil<GatewayVOCU>{ 
        return new FieldUtil('slb','slb','slb', new GatewayVOCUImpl());
    }
    static get DELETED(): FieldUtil<GatewayVOCU>{ 
        return new FieldUtil('deleted','deleted','deleted', new GatewayVOCUImpl());
    }

    get ID(): FieldUtil<GatewayVOCU>{ 
        return GatewayVOMU.ID;
    }
    get K8S_ID(): FieldUtil<GatewayVOCU>{ 
        return GatewayVOMU.K8S_ID;
    }
    get NAME(): FieldUtil<GatewayVOCU>{ 
        return GatewayVOMU.NAME;
    }
    get LABEL(): FieldUtil<GatewayVOCU>{ 
        return GatewayVOMU.LABEL;
    }
    get CONFIG_CENTER_CODE(): FieldUtil<GatewayVOCU>{ 
        return GatewayVOMU.CONFIG_CENTER_CODE;
    }
    get IMAGE_ID(): FieldUtil<GatewayVOCU>{ 
        return GatewayVOMU.IMAGE_ID;
    }
    get SPEC_NAME(): FieldUtil<GatewayVOCU>{ 
        return GatewayVOMU.SPEC_NAME;
    }
    get METRICS_NAME(): FieldUtil<GatewayVOCU>{ 
        return GatewayVOMU.METRICS_NAME;
    }
    get IMAGE_PORT_MAPPING(): FieldUtil<GatewayVOCU>{ 
        return GatewayVOMU.IMAGE_PORT_MAPPING;
    }
    get DOMAIN(): FieldUtil<GatewayVOCU>{ 
        return GatewayVOMU.DOMAIN;
    }
    get URI(): FieldUtil<GatewayVOCU>{ 
        return GatewayVOMU.URI;
    }
    get SLB(): FieldUtil<GatewayVOCU>{ 
        return GatewayVOMU.SLB;
    }
    get DELETED(): FieldUtil<GatewayVOCU>{ 
        return GatewayVOMU.DELETED;
    }
}
export {GatewayVOMU, GatewayVOCU}
