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-06-09 09:11
 */
interface GatewayVOCU extends ConditionUtil<GatewayVOCU>{
    ID:FieldUtil<GatewayVOCU>;
    SERVICE_CENTER_NAME:FieldUtil<GatewayVOCU>;
    APP_NAME:FieldUtil<GatewayVOCU>;
    ENV_CODE:FieldUtil<GatewayVOCU>;
    K8S_NAME:FieldUtil<GatewayVOCU>;
    NAME:FieldUtil<GatewayVOCU>;
    LABEL:FieldUtil<GatewayVOCU>;
    CONFIG_CENTER_CODE:FieldUtil<GatewayVOCU>;
    IMAGE_NAME:FieldUtil<GatewayVOCU>;
    SPEC_TEMPLATE_NAME:FieldUtil<GatewayVOCU>;
    METRICS_TEMPLATE_NAME:FieldUtil<GatewayVOCU>;
    IMAGE_PORT_MAPPING:FieldUtil<GatewayVOCU>;
    DOMAIN:FieldUtil<GatewayVOCU>;
    URI:FieldUtil<GatewayVOCU>;
    SLB_NAME: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 SERVICE_CENTER_NAME(): FieldUtil<GatewayVOCU>{  
        return new FieldUtil('service_center_name','serviceCenterName','service_center_name', this);
    }
    get APP_NAME(): FieldUtil<GatewayVOCU>{  
        return new FieldUtil('app_name','appName','app_name', this);
    }
    get ENV_CODE(): FieldUtil<GatewayVOCU>{  
        return new FieldUtil('env_code','envCode','env_code', this);
    }
    get K8S_NAME(): FieldUtil<GatewayVOCU>{  
        return new FieldUtil('k8s_name','k8sName','k8s_name', 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_NAME(): FieldUtil<GatewayVOCU>{  
        return new FieldUtil('image_name','imageName','image_name', this);
    }
    get SPEC_TEMPLATE_NAME(): FieldUtil<GatewayVOCU>{  
        return new FieldUtil('spec_template_name','specTemplateName','spec_template_name', this);
    }
    get METRICS_TEMPLATE_NAME(): FieldUtil<GatewayVOCU>{  
        return new FieldUtil('metrics_template_name','metricsTemplateName','metrics_template_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_NAME(): FieldUtil<GatewayVOCU>{  
        return new FieldUtil('slb_name','slbName','slb_name', this);
    }
}

@Singleton
class GatewayVOMU extends ModelUtilImpl<GatewayVOCU,GatewayVO>{ 
    joinTables = [];
    selectSQL ='select  g.id as id,g.service_center_name,g.app_name,g.env_code,g.k8s_name,g.name as name,t.name as label,g.config_center_code,g.image_name,g.spec_template_name ,g.metrics_template_name,g.image_port_mapping,g."domain",g.uri,s.name as slb_name from kt_cn.cn_gateway g left join kt_cn.cn_label_ref lf on g.id = lf.bussiness_id left join  kt_cn.cn_label t on lf.label_id = t.id left join kt_cn.cn_slb s on g.cn_slb_id = s."id"';
    tableFields  = ['id','service_center_name','app_name','env_code','k8s_name','name','label','config_center_code','image_name','spec_template_name','metrics_template_name','image_port_mapping','domain','uri','slb_name'];
    modelFields  = ['id','serviceCenterName','appName','envCode','k8sName','name','label','configCenterCode','imageName','specTemplateName','metricsTemplateName','imagePortMapping','domain','uri','slbName'];

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

    static get ID(): FieldUtil<GatewayVOCU>{ 
        return new FieldUtil('id','id','id', new GatewayVOCUImpl());
    }
    static get SERVICE_CENTER_NAME(): FieldUtil<GatewayVOCU>{ 
        return new FieldUtil('service_center_name','serviceCenterName','service_center_name', new GatewayVOCUImpl());
    }
    static get APP_NAME(): FieldUtil<GatewayVOCU>{ 
        return new FieldUtil('app_name','appName','app_name', new GatewayVOCUImpl());
    }
    static get ENV_CODE(): FieldUtil<GatewayVOCU>{ 
        return new FieldUtil('env_code','envCode','env_code', new GatewayVOCUImpl());
    }
    static get K8S_NAME(): FieldUtil<GatewayVOCU>{ 
        return new FieldUtil('k8s_name','k8sName','k8s_name', 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_NAME(): FieldUtil<GatewayVOCU>{ 
        return new FieldUtil('image_name','imageName','image_name', new GatewayVOCUImpl());
    }
    static get SPEC_TEMPLATE_NAME(): FieldUtil<GatewayVOCU>{ 
        return new FieldUtil('spec_template_name','specTemplateName','spec_template_name', new GatewayVOCUImpl());
    }
    static get METRICS_TEMPLATE_NAME(): FieldUtil<GatewayVOCU>{ 
        return new FieldUtil('metrics_template_name','metricsTemplateName','metrics_template_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_NAME(): FieldUtil<GatewayVOCU>{ 
        return new FieldUtil('slb_name','slbName','slb_name', new GatewayVOCUImpl());
    }

    get ID(): FieldUtil<GatewayVOCU>{ 
        return GatewayVOMU.ID;
    }
    get SERVICE_CENTER_NAME(): FieldUtil<GatewayVOCU>{ 
        return GatewayVOMU.SERVICE_CENTER_NAME;
    }
    get APP_NAME(): FieldUtil<GatewayVOCU>{ 
        return GatewayVOMU.APP_NAME;
    }
    get ENV_CODE(): FieldUtil<GatewayVOCU>{ 
        return GatewayVOMU.ENV_CODE;
    }
    get K8S_NAME(): FieldUtil<GatewayVOCU>{ 
        return GatewayVOMU.K8S_NAME;
    }
    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_NAME(): FieldUtil<GatewayVOCU>{ 
        return GatewayVOMU.IMAGE_NAME;
    }
    get SPEC_TEMPLATE_NAME(): FieldUtil<GatewayVOCU>{ 
        return GatewayVOMU.SPEC_TEMPLATE_NAME;
    }
    get METRICS_TEMPLATE_NAME(): FieldUtil<GatewayVOCU>{ 
        return GatewayVOMU.METRICS_TEMPLATE_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_NAME(): FieldUtil<GatewayVOCU>{ 
        return GatewayVOMU.SLB_NAME;
    }
}
export {GatewayVOMU, GatewayVOCU}
