import { FieldInfo } from 'model-util-base'
import { ConditionUtil, ConditionUtilImpl, FieldUtil, TableUtilImpl, IdType, JoinTable, SubTable } from 'model-util'
import { Container, Singleton } from 'typescript-ioc' 
import { AdInfoMaterial } from '../models/index' 
/**
 * @author auto generate
 * @version 1.0
 * @date 2021-05-23 16:06
 */
interface AdInfoMaterialCU extends ConditionUtil<AdInfoMaterialCU>{
    AD_INFO_ID:FieldUtil<AdInfoMaterialCU>;
    AD_MATERIAL_ID:FieldUtil<AdInfoMaterialCU>;
    DEL_FLAG:FieldUtil<AdInfoMaterialCU>;
}

class AdInfoMaterialCUImpl extends ConditionUtilImpl<AdInfoMaterialCUImpl> implements AdInfoMaterialCU{ 
    newInstance(): AdInfoMaterialCUImpl {
        return new AdInfoMaterialCUImpl();
    } 
    get AD_INFO_ID(): FieldUtil<AdInfoMaterialCU>{  
        return new FieldUtil('ad_info_id','adInfoId','广告信息id', this);
    }
    get AD_MATERIAL_ID(): FieldUtil<AdInfoMaterialCU>{  
        return new FieldUtil('ad_material_id','adMaterialId','素材id', this);
    }
    get DEL_FLAG(): FieldUtil<AdInfoMaterialCU>{  
        return new FieldUtil('del_flag','delFlag','是否删除：0，否；1，是', this);
    }
}

@Singleton 
class AdInfoMaterialMU extends TableUtilImpl<AdInfoMaterialCU,AdInfoMaterial>{ 
    tableName  = 'ad_info_material';
    tableFields  = ['ad_info_id','ad_material_id','del_flag'];
    modelFields  = ['adInfoId','adMaterialId','delFlag'];
    modelIdFields  = ['adInfoId','adMaterialId'];
    tableIdFields  = ['ad_info_id','ad_material_id'];
    idType = IdType.CUSTOM;
    joinTables = [];
    subTables = [];

    createConditionUtil(): AdInfoMaterialCU {
        return new AdInfoMaterialCUImpl();
    }   

    static get AD_INFO_ID(): FieldUtil<AdInfoMaterialCU>{ 
        return new FieldUtil('ad_info_id','adInfoId','广告信息id', new AdInfoMaterialCUImpl());
    }
    static get AD_MATERIAL_ID(): FieldUtil<AdInfoMaterialCU>{ 
        return new FieldUtil('ad_material_id','adMaterialId','素材id', new AdInfoMaterialCUImpl());
    }
    static get DEL_FLAG(): FieldUtil<AdInfoMaterialCU>{ 
        return new FieldUtil('del_flag','delFlag','是否删除：0，否；1，是', new AdInfoMaterialCUImpl());
    }

    get AD_INFO_ID(): FieldUtil<AdInfoMaterialCU>{ 
        return AdInfoMaterialMU.AD_INFO_ID;
    }
    get AD_MATERIAL_ID(): FieldUtil<AdInfoMaterialCU>{ 
        return AdInfoMaterialMU.AD_MATERIAL_ID;
    }
    get DEL_FLAG(): FieldUtil<AdInfoMaterialCU>{ 
        return AdInfoMaterialMU.DEL_FLAG;
    }
}
export {AdInfoMaterialMU, AdInfoMaterialCU}
