import { FieldInfo } from 'model-util-base'
import { ConditionUtil, ConditionUtilImpl, FieldUtil, TableUtilImpl, IdType, JoinTable, SubTable } from 'model-util'
import { Container, Singleton } from 'typescript-ioc' 
import { AdDeliveryPlanDisplay } from '../models/index' 
/**
 * @author auto generate
 * @version 1.0
 * @date 2021-04-20 13:55
 */
interface AdDeliveryPlanDisplayCU extends ConditionUtil<AdDeliveryPlanDisplayCU>{
    AD_DELIVERY_PLAN_ID:FieldUtil<AdDeliveryPlanDisplayCU>;
    AD_INFO_ID:FieldUtil<AdDeliveryPlanDisplayCU>;
    SERVER_DISPLAY_TIMES:FieldUtil<AdDeliveryPlanDisplayCU>;
    CLIENT_DISPLAY_TIMES:FieldUtil<AdDeliveryPlanDisplayCU>;
    LIMIT_DISPLAY_TIMES:FieldUtil<AdDeliveryPlanDisplayCU>;
}

class AdDeliveryPlanDisplayCUImpl extends ConditionUtilImpl<AdDeliveryPlanDisplayCUImpl> implements AdDeliveryPlanDisplayCU{ 
    newInstance(): AdDeliveryPlanDisplayCUImpl {
        return new AdDeliveryPlanDisplayCUImpl();
    } 
    get AD_DELIVERY_PLAN_ID(): FieldUtil<AdDeliveryPlanDisplayCU>{  
        return new FieldUtil('AD_DELIVERY_PLAN_ID','adDeliveryPlanId','', this);
    }
    get AD_INFO_ID(): FieldUtil<AdDeliveryPlanDisplayCU>{  
        return new FieldUtil('AD_INFO_ID','adInfoId','广告id', this);
    }
    get SERVER_DISPLAY_TIMES(): FieldUtil<AdDeliveryPlanDisplayCU>{  
        return new FieldUtil('SERVER_DISPLAY_TIMES','serverDisplayTimes','服务端上报次数', this);
    }
    get CLIENT_DISPLAY_TIMES(): FieldUtil<AdDeliveryPlanDisplayCU>{  
        return new FieldUtil('CLIENT_DISPLAY_TIMES','clientDisplayTimes','客户端上报次数', this);
    }
    get LIMIT_DISPLAY_TIMES(): FieldUtil<AdDeliveryPlanDisplayCU>{  
        return new FieldUtil('LIMIT_DISPLAY_TIMES','limitDisplayTimes','限制曝光次数', this);
    }
}

@Singleton 
class AdDeliveryPlanDisplayMU extends TableUtilImpl<AdDeliveryPlanDisplayCU,AdDeliveryPlanDisplay>{ 
    tableName  = 'ad_delivery_plan_display';
    tableFields  = ['ad_delivery_plan_id','ad_info_id','server_display_times','client_display_times','limit_display_times'];
    modelFields  = ['adDeliveryPlanId','adInfoId','serverDisplayTimes','clientDisplayTimes','limitDisplayTimes'];
    modelIdFields  = ['adDeliveryPlanId'];
    tableIdFields  = ['ad_delivery_plan_id'];
    idType = IdType.CUSTOM;
    joinTables = [];
    subTables = [];

    createConditionUtil(): AdDeliveryPlanDisplayCU {
        return new AdDeliveryPlanDisplayCUImpl();
    }   

    static get AD_DELIVERY_PLAN_ID(): FieldUtil<AdDeliveryPlanDisplayCU>{ 
        return new FieldUtil('AD_DELIVERY_PLAN_ID','adDeliveryPlanId','', new AdDeliveryPlanDisplayCUImpl());
    }
    static get AD_INFO_ID(): FieldUtil<AdDeliveryPlanDisplayCU>{ 
        return new FieldUtil('AD_INFO_ID','adInfoId','广告id', new AdDeliveryPlanDisplayCUImpl());
    }
    static get SERVER_DISPLAY_TIMES(): FieldUtil<AdDeliveryPlanDisplayCU>{ 
        return new FieldUtil('SERVER_DISPLAY_TIMES','serverDisplayTimes','服务端上报次数', new AdDeliveryPlanDisplayCUImpl());
    }
    static get CLIENT_DISPLAY_TIMES(): FieldUtil<AdDeliveryPlanDisplayCU>{ 
        return new FieldUtil('CLIENT_DISPLAY_TIMES','clientDisplayTimes','客户端上报次数', new AdDeliveryPlanDisplayCUImpl());
    }
    static get LIMIT_DISPLAY_TIMES(): FieldUtil<AdDeliveryPlanDisplayCU>{ 
        return new FieldUtil('LIMIT_DISPLAY_TIMES','limitDisplayTimes','限制曝光次数', new AdDeliveryPlanDisplayCUImpl());
    }

    get AD_DELIVERY_PLAN_ID(): FieldUtil<AdDeliveryPlanDisplayCU>{ 
        return AdDeliveryPlanDisplayMU.AD_DELIVERY_PLAN_ID;
    }
    get AD_INFO_ID(): FieldUtil<AdDeliveryPlanDisplayCU>{ 
        return AdDeliveryPlanDisplayMU.AD_INFO_ID;
    }
    get SERVER_DISPLAY_TIMES(): FieldUtil<AdDeliveryPlanDisplayCU>{ 
        return AdDeliveryPlanDisplayMU.SERVER_DISPLAY_TIMES;
    }
    get CLIENT_DISPLAY_TIMES(): FieldUtil<AdDeliveryPlanDisplayCU>{ 
        return AdDeliveryPlanDisplayMU.CLIENT_DISPLAY_TIMES;
    }
    get LIMIT_DISPLAY_TIMES(): FieldUtil<AdDeliveryPlanDisplayCU>{ 
        return AdDeliveryPlanDisplayMU.LIMIT_DISPLAY_TIMES;
    }
}
export {AdDeliveryPlanDisplayMU, AdDeliveryPlanDisplayCU}
