import { FieldInfo } from 'model-util-base'
import { ConditionUtil, ConditionUtilImpl, FieldUtil, TableUtilImpl, IdType, JoinTable, SubTable } from 'model-util'
import { Container, Singleton } from 'typescript-ioc' 
import { MonitorRulesettingServiceRel } from '../models/index' 

import {MonitorServiceProjectMU} from './MonitorServiceProject' 


/**
 * @author auto generate
 * @version 1.0
 * @date 2021-09-15 13:26
 */
interface MonitorRulesettingServiceRelCU extends ConditionUtil<MonitorRulesettingServiceRelCU>{
    ID:FieldUtil<MonitorRulesettingServiceRelCU>;
    SETTING_ID:FieldUtil<MonitorRulesettingServiceRelCU>;
    SERVICE_GROUP_ID:FieldUtil<MonitorRulesettingServiceRelCU>;
    DELETED:FieldUtil<MonitorRulesettingServiceRelCU>;
    CREATE_TIME:FieldUtil<MonitorRulesettingServiceRelCU>;
    UPDATE_TIME:FieldUtil<MonitorRulesettingServiceRelCU>;
}

class MonitorRulesettingServiceRelCUImpl extends ConditionUtilImpl<MonitorRulesettingServiceRelCUImpl> implements MonitorRulesettingServiceRelCU{ 
    newInstance(): MonitorRulesettingServiceRelCUImpl {
        return new MonitorRulesettingServiceRelCUImpl();
    } 
    get ID(): FieldUtil<MonitorRulesettingServiceRelCU>{  
        return new FieldUtil('id','id','主键', this);
    }
    get SETTING_ID(): FieldUtil<MonitorRulesettingServiceRelCU>{  
        return new FieldUtil('setting_id','settingId','规则设置id', this);
    }
    get SERVICE_GROUP_ID(): FieldUtil<MonitorRulesettingServiceRelCU>{  
        return new FieldUtil('service_group_id','serviceGroupId','服务分组id', this);
    }
    get DELETED(): FieldUtil<MonitorRulesettingServiceRelCU>{  
        return new FieldUtil('deleted','deleted','deleted', this);
    }
    get CREATE_TIME(): FieldUtil<MonitorRulesettingServiceRelCU>{  
        return new FieldUtil('create_time','createTime','create_time', this);
    }
    get UPDATE_TIME(): FieldUtil<MonitorRulesettingServiceRelCU>{  
        return new FieldUtil('update_time','updateTime','update_time', this);
    }
    get SERVICE_CENTER_CODE(): FieldInfo{  
        return new FieldInfo('serviceCenterCode','服务中心编码');
    }
    get SERVICE_CENTER_NAME(): FieldInfo{  
        return new FieldInfo('serviceCenterName','服务中心名称');
    }
    get APP_CODE(): FieldInfo{  
        return new FieldInfo('appCode','应用编码');
    }
    get APP_NAME(): FieldInfo{  
        return new FieldInfo('appName','应用名称');
    }
    get ENV_CODE(): FieldInfo{  
        return new FieldInfo('envCode','env_code');
    }
    get PROJECT_ID(): FieldInfo{  
        return new FieldInfo('projectId','project_id');
    }
    get PROJECT_TYPE(): FieldInfo{  
        return new FieldInfo('projectType','project_type');
    }
    get PID(): FieldInfo{  
        return new FieldInfo('pid','pid');
    }
    get SERVICE_PROJECT_ID(): FieldInfo{  
        return new FieldInfo('serviceProjectId','主键');
    }
}

@Singleton 
class MonitorRulesettingServiceRelMU extends TableUtilImpl<MonitorRulesettingServiceRelCU,MonitorRulesettingServiceRel>{ 
    tableName  = 'monitor_rulesetting_service_rel';
    tableFields  = ['id','setting_id','service_group_id','deleted','create_time','update_time'];
    modelFields  = ['id','settingId','serviceGroupId','deleted','createTime','updateTime','serviceCenterCode','serviceCenterName','appCode','appName','envCode','projectId','projectType','pid','serviceProjectId'];
    modelIdFields  = ['id'];
    tableIdFields  = ['id'];
    idType = IdType.CUSTOM;
    joinTables = [{
            joinByDefault: true,
            foreignKeyFields: [MonitorRulesettingServiceRelMU.SERVICE_GROUP_ID,MonitorRulesettingServiceRelMU.DELETED],
            joinIdFields: [MonitorServiceProjectMU.SERVICE_GROUP_ID,MonitorServiceProjectMU.DELETED],
            getTableUtil: ()=>{
                return Container.get(MonitorServiceProjectMU);
            },
            fields: [
                {
                    fieldUtil: MonitorServiceProjectMU.SERVICE_CENTER_CODE,
                    alias: 'serviceCenterCode'
                }
                ,{
                    fieldUtil: MonitorServiceProjectMU.SERVICE_CENTER_NAME,
                    alias: 'serviceCenterName'
                }
                ,{
                    fieldUtil: MonitorServiceProjectMU.APP_CODE,
                    alias: 'appCode'
                }
                ,{
                    fieldUtil: MonitorServiceProjectMU.APP_NAME,
                    alias: 'appName'
                }
                ,{
                    fieldUtil: MonitorServiceProjectMU.ENV_CODE,
                    alias: 'envCode'
                }
                ,{
                    fieldUtil: MonitorServiceProjectMU.PROJECT_ID,
                    alias: 'projectId'
                }
                ,{
                    fieldUtil: MonitorServiceProjectMU.PROJECT_TYPE,
                    alias: 'projectType'
                }
                ,{
                    fieldUtil: MonitorServiceProjectMU.PID,
                    alias: 'pid'
                }
                ,{
                    fieldUtil: MonitorServiceProjectMU.ID,
                    alias: 'serviceProjectId'
                }
            ]

        } as JoinTable

];
    subTables = [];

    createConditionUtil(): MonitorRulesettingServiceRelCU {
        return new MonitorRulesettingServiceRelCUImpl();
    }   

    static get ID(): FieldUtil<MonitorRulesettingServiceRelCU>{ 
        return new FieldUtil('id','id','主键', new MonitorRulesettingServiceRelCUImpl());
    }
    static get SETTING_ID(): FieldUtil<MonitorRulesettingServiceRelCU>{ 
        return new FieldUtil('setting_id','settingId','规则设置id', new MonitorRulesettingServiceRelCUImpl());
    }
    static get SERVICE_GROUP_ID(): FieldUtil<MonitorRulesettingServiceRelCU>{ 
        return new FieldUtil('service_group_id','serviceGroupId','服务分组id', new MonitorRulesettingServiceRelCUImpl());
    }
    static get DELETED(): FieldUtil<MonitorRulesettingServiceRelCU>{ 
        return new FieldUtil('deleted','deleted','deleted', new MonitorRulesettingServiceRelCUImpl());
    }
    static get CREATE_TIME(): FieldUtil<MonitorRulesettingServiceRelCU>{ 
        return new FieldUtil('create_time','createTime','create_time', new MonitorRulesettingServiceRelCUImpl());
    }
    static get UPDATE_TIME(): FieldUtil<MonitorRulesettingServiceRelCU>{ 
        return new FieldUtil('update_time','updateTime','update_time', new MonitorRulesettingServiceRelCUImpl());
    }
    static get SERVICE_CENTER_CODE(): FieldInfo{  
        return new FieldInfo('serviceCenterCode','服务中心编码');
    }
    static get SERVICE_CENTER_NAME(): FieldInfo{  
        return new FieldInfo('serviceCenterName','服务中心名称');
    }
    static get APP_CODE(): FieldInfo{  
        return new FieldInfo('appCode','应用编码');
    }
    static get APP_NAME(): FieldInfo{  
        return new FieldInfo('appName','应用名称');
    }
    static get ENV_CODE(): FieldInfo{  
        return new FieldInfo('envCode','env_code');
    }
    static get PROJECT_ID(): FieldInfo{  
        return new FieldInfo('projectId','project_id');
    }
    static get PROJECT_TYPE(): FieldInfo{  
        return new FieldInfo('projectType','project_type');
    }
    static get PID(): FieldInfo{  
        return new FieldInfo('pid','pid');
    }
    static get SERVICE_PROJECT_ID(): FieldInfo{  
        return new FieldInfo('serviceProjectId','主键');
    }

    get ID(): FieldUtil<MonitorRulesettingServiceRelCU>{ 
        return MonitorRulesettingServiceRelMU.ID;
    }
    get SETTING_ID(): FieldUtil<MonitorRulesettingServiceRelCU>{ 
        return MonitorRulesettingServiceRelMU.SETTING_ID;
    }
    get SERVICE_GROUP_ID(): FieldUtil<MonitorRulesettingServiceRelCU>{ 
        return MonitorRulesettingServiceRelMU.SERVICE_GROUP_ID;
    }
    get DELETED(): FieldUtil<MonitorRulesettingServiceRelCU>{ 
        return MonitorRulesettingServiceRelMU.DELETED;
    }
    get CREATE_TIME(): FieldUtil<MonitorRulesettingServiceRelCU>{ 
        return MonitorRulesettingServiceRelMU.CREATE_TIME;
    }
    get UPDATE_TIME(): FieldUtil<MonitorRulesettingServiceRelCU>{ 
        return MonitorRulesettingServiceRelMU.UPDATE_TIME;
    }
    get SERVICE_CENTER_CODE(): FieldInfo{  
        return MonitorRulesettingServiceRelMU.SERVICE_CENTER_CODE;
    }
    get SERVICE_CENTER_NAME(): FieldInfo{  
        return MonitorRulesettingServiceRelMU.SERVICE_CENTER_NAME;
    }
    get APP_CODE(): FieldInfo{  
        return MonitorRulesettingServiceRelMU.APP_CODE;
    }
    get APP_NAME(): FieldInfo{  
        return MonitorRulesettingServiceRelMU.APP_NAME;
    }
    get ENV_CODE(): FieldInfo{  
        return MonitorRulesettingServiceRelMU.ENV_CODE;
    }
    get PROJECT_ID(): FieldInfo{  
        return MonitorRulesettingServiceRelMU.PROJECT_ID;
    }
    get PROJECT_TYPE(): FieldInfo{  
        return MonitorRulesettingServiceRelMU.PROJECT_TYPE;
    }
    get PID(): FieldInfo{  
        return MonitorRulesettingServiceRelMU.PID;
    }
    get SERVICE_PROJECT_ID(): FieldInfo{  
        return MonitorRulesettingServiceRelMU.SERVICE_PROJECT_ID;
    }
}
export {MonitorRulesettingServiceRelMU, MonitorRulesettingServiceRelCU}
