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


/**
 * @author auto generate
 * @version 1.0
 * @date 2021-05-31 14:21
 */
interface BaseServiceVOCU extends ConditionUtil<BaseServiceVOCU>{
    ID:FieldUtil<BaseServiceVOCU>;
    K8S_ID:FieldUtil<BaseServiceVOCU>;
    LABEL:FieldUtil<BaseServiceVOCU>;
    CONFIG_CENTER_CODE:FieldUtil<BaseServiceVOCU>;
    IMAGE_ID:FieldUtil<BaseServiceVOCU>;
    SPEC_NAME:FieldUtil<BaseServiceVOCU>;
    METRICS_NAME:FieldUtil<BaseServiceVOCU>;
    IMAGE_PORT_MAPPING:FieldUtil<BaseServiceVOCU>;
    SLB:FieldUtil<BaseServiceVOCU>;
    SLB_PORT_MAPPING:FieldUtil<BaseServiceVOCU>;
    PROGRESS_KEYWORD:FieldUtil<BaseServiceVOCU>;
}

class BaseServiceVOCUImpl extends ConditionUtilImpl<BaseServiceVOCUImpl> implements BaseServiceVOCU{ 
    newInstance(): BaseServiceVOCUImpl {
        return new BaseServiceVOCUImpl();
    } 
    get ID(): FieldUtil<BaseServiceVOCU>{  
        return new FieldUtil('id','id','id', this);
    }
    get K8S_ID(): FieldUtil<BaseServiceVOCU>{  
        return new FieldUtil('k8s_id','k8sId','k8s_id', this);
    }
    get LABEL(): FieldUtil<BaseServiceVOCU>{  
        return new FieldUtil('label','label','label', this);
    }
    get CONFIG_CENTER_CODE(): FieldUtil<BaseServiceVOCU>{  
        return new FieldUtil('config_center_code','configCenterCode','config_center_code', this);
    }
    get IMAGE_ID(): FieldUtil<BaseServiceVOCU>{  
        return new FieldUtil('image_id','imageId','image_id', this);
    }
    get SPEC_NAME(): FieldUtil<BaseServiceVOCU>{  
        return new FieldUtil('spec_name','specName','spec_name', this);
    }
    get METRICS_NAME(): FieldUtil<BaseServiceVOCU>{  
        return new FieldUtil('metrics_name','metricsName','metrics_name', this);
    }
    get IMAGE_PORT_MAPPING(): FieldUtil<BaseServiceVOCU>{  
        return new FieldUtil('image_port_mapping','imagePortMapping','image_port_mapping', this);
    }
    get SLB(): FieldUtil<BaseServiceVOCU>{  
        return new FieldUtil('slb','slb','slb', this);
    }
    get SLB_PORT_MAPPING(): FieldUtil<BaseServiceVOCU>{  
        return new FieldUtil('slb_port_mapping','slbPortMapping','slb_port_mapping', this);
    }
    get PROGRESS_KEYWORD(): FieldUtil<BaseServiceVOCU>{  
        return new FieldUtil('progress_keyword','progressKeyword','progress_keyword', this);
    }
}

@Singleton
class BaseServiceVOMU extends ModelUtilImpl<BaseServiceVOCU,BaseServiceVO>{ 
    joinTables = [];
    selectSQL ='select  g.id as id,g.k8s_id,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,s."name" as slb,g.slb_port_mapping,g.progress_keyword from kt_cn.cn_base_service g left join 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" 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','label','config_center_code','image_id','spec_name','metrics_name','image_port_mapping','slb','slb_port_mapping','progress_keyword'];
    modelFields  = ['id','k8sId','label','configCenterCode','imageId','specName','metricsName','imagePortMapping','slb','slbPortMapping','progressKeyword'];

    createConditionUtil(): BaseServiceVOCU {
        return new BaseServiceVOCUImpl();
    }   

    static get ID(): FieldUtil<BaseServiceVOCU>{ 
        return new FieldUtil('id','id','id', new BaseServiceVOCUImpl());
    }
    static get K8S_ID(): FieldUtil<BaseServiceVOCU>{ 
        return new FieldUtil('k8s_id','k8sId','k8s_id', new BaseServiceVOCUImpl());
    }
    static get LABEL(): FieldUtil<BaseServiceVOCU>{ 
        return new FieldUtil('label','label','label', new BaseServiceVOCUImpl());
    }
    static get CONFIG_CENTER_CODE(): FieldUtil<BaseServiceVOCU>{ 
        return new FieldUtil('config_center_code','configCenterCode','config_center_code', new BaseServiceVOCUImpl());
    }
    static get IMAGE_ID(): FieldUtil<BaseServiceVOCU>{ 
        return new FieldUtil('image_id','imageId','image_id', new BaseServiceVOCUImpl());
    }
    static get SPEC_NAME(): FieldUtil<BaseServiceVOCU>{ 
        return new FieldUtil('spec_name','specName','spec_name', new BaseServiceVOCUImpl());
    }
    static get METRICS_NAME(): FieldUtil<BaseServiceVOCU>{ 
        return new FieldUtil('metrics_name','metricsName','metrics_name', new BaseServiceVOCUImpl());
    }
    static get IMAGE_PORT_MAPPING(): FieldUtil<BaseServiceVOCU>{ 
        return new FieldUtil('image_port_mapping','imagePortMapping','image_port_mapping', new BaseServiceVOCUImpl());
    }
    static get SLB(): FieldUtil<BaseServiceVOCU>{ 
        return new FieldUtil('slb','slb','slb', new BaseServiceVOCUImpl());
    }
    static get SLB_PORT_MAPPING(): FieldUtil<BaseServiceVOCU>{ 
        return new FieldUtil('slb_port_mapping','slbPortMapping','slb_port_mapping', new BaseServiceVOCUImpl());
    }
    static get PROGRESS_KEYWORD(): FieldUtil<BaseServiceVOCU>{ 
        return new FieldUtil('progress_keyword','progressKeyword','progress_keyword', new BaseServiceVOCUImpl());
    }

    get ID(): FieldUtil<BaseServiceVOCU>{ 
        return BaseServiceVOMU.ID;
    }
    get K8S_ID(): FieldUtil<BaseServiceVOCU>{ 
        return BaseServiceVOMU.K8S_ID;
    }
    get LABEL(): FieldUtil<BaseServiceVOCU>{ 
        return BaseServiceVOMU.LABEL;
    }
    get CONFIG_CENTER_CODE(): FieldUtil<BaseServiceVOCU>{ 
        return BaseServiceVOMU.CONFIG_CENTER_CODE;
    }
    get IMAGE_ID(): FieldUtil<BaseServiceVOCU>{ 
        return BaseServiceVOMU.IMAGE_ID;
    }
    get SPEC_NAME(): FieldUtil<BaseServiceVOCU>{ 
        return BaseServiceVOMU.SPEC_NAME;
    }
    get METRICS_NAME(): FieldUtil<BaseServiceVOCU>{ 
        return BaseServiceVOMU.METRICS_NAME;
    }
    get IMAGE_PORT_MAPPING(): FieldUtil<BaseServiceVOCU>{ 
        return BaseServiceVOMU.IMAGE_PORT_MAPPING;
    }
    get SLB(): FieldUtil<BaseServiceVOCU>{ 
        return BaseServiceVOMU.SLB;
    }
    get SLB_PORT_MAPPING(): FieldUtil<BaseServiceVOCU>{ 
        return BaseServiceVOMU.SLB_PORT_MAPPING;
    }
    get PROGRESS_KEYWORD(): FieldUtil<BaseServiceVOCU>{ 
        return BaseServiceVOMU.PROGRESS_KEYWORD;
    }
}
export {BaseServiceVOMU, BaseServiceVOCU}
