---
# System prepended metadata

title: 撈出報表from CID
tags: [report, Google Ads]

---

---
title: '撈出報表from CID'
disqus: hackmd
---
###### tags: `report` `Google Ads`
撈出報表from CID
===

[TOC]

## 筆記目的

了解如何從給定的CID(customerID)去撈出所屬的campaign，以及一些他們想要的欄位

## 實用連結

[Query Builder](https://developers.google.com/google-ads/api/fields/v8/query_validator)

## 不太懂要去哪裡看

1. 如何從後台看startdate 還有開播天數



1. Resource fields :把她想成設定
2. Segments:例如device
3. Metrics:KPI的指標



## 步驟

1. find each CID 的MCC
2. use CID and MCC to get information
3. put the information you get into java variable
4. write excel to my computer

## find each CID 的MCC

反過來，使用每個MCC的ID當作CID去獲得所有五個帳號的CID有哪些，

```java=

package com.example.value;

import com.example.value.properties.DefaultOAuthProperties;
import com.google.ads.googleads.lib.GoogleAdsClient;
import com.google.ads.googleads.v8.errors.GoogleAdsException;
//import com.google.ads.googleads.v8.resources.AdGroup;
//import com.google.ads.googleads.v8.enums.AdGroupStatusEnum.AdGroupStatus;
import com.google.ads.googleads.v8.errors.GoogleAdsError;
import com.google.ads.googleads.v8.services.GoogleAdsRow;
import com.google.ads.googleads.v8.services.GoogleAdsServiceClient;
import com.google.ads.googleads.v8.services.GoogleAdsServiceClient.SearchPagedResponse;
import com.google.ads.googleads.v8.services.SearchGoogleAdsRequest;
//import com.google.ads.googleads.v8.utils.ResourceNames;
import com.google.auth.Credentials;
import com.google.auth.oauth2.UserCredentials;
//import com.google.protobuf.Int64Value;
//import java.io.FileNotFoundException;
import java.io.IOException;

public class GetCustomerMCC {
		//809-235-9339
	private static final int PAGE_SIZE = 10000;

	private static String MCCID = "825-849-0584";
	private static String CID = "825-849-0584";
	//124-574-0503
	//809-235-9339 //APOC_MCC
	//370-460-5386
	//987-448-8471
	public static void main(String[] args) throws IOException {
		
		Long login_mcc_id = Long.parseLong(MCCID.replaceAll("-", ""));
		Long customerId = Long.parseLong(CID.replaceAll("-", ""));

		Credentials credentials = null;
		GoogleAdsClient googleAdsClient = null;

		try {
			credentials = UserCredentials.newBuilder().setClientId(DefaultOAuthProperties.Default_ClientId)
					.setClientSecret(DefaultOAuthProperties.Default_ClientSecret)
					.setRefreshToken(DefaultOAuthProperties.Default_RefreshToken).build();

			googleAdsClient = GoogleAdsClient.newBuilder().setCredentials(credentials)
					.setDeveloperToken(DefaultOAuthProperties.Default_DeveloperToken).setLoginCustomerId(login_mcc_id) // Manager
																												// accounts
					// only.
					.build();
		} catch (GoogleAdsException adse) {
			System.out.println(adse.toString());
		} catch (Exception e) {
			System.out.println(e.toString());
		}

		try {
			runExample(googleAdsClient, customerId);
		} catch (GoogleAdsException gae) {
			System.err.printf("Request ID %s failed due to GoogleAdsException. Underlying errors:%n",
					gae.getRequestId());
			int i = 0;
			for (GoogleAdsError googleAdsError : gae.getGoogleAdsFailure().getErrorsList()) {
				System.err.printf("  Error %d: %s%n", i++, googleAdsError);
			}
		}
	}

	private static void runExample(GoogleAdsClient googleAdsClient, long customerId) {
		try (GoogleAdsServiceClient googleAdsServiceClient = googleAdsClient.getLatestVersion()
				.createGoogleAdsServiceClient()) {
			String resultString="SELECT customer_client.client_customer,customer_client.currency_code,customer_client.hidden,customer_client.id,customer_client.level,customer_client.manager,customer_client.resource_name,customer_client.resource_name,customer_client.test_account,customer_client.time_zone FROM customer_client";
			SearchGoogleAdsRequest request = SearchGoogleAdsRequest.newBuilder()
					.setCustomerId(Long.toString(customerId)).setPageSize(PAGE_SIZE)
					.setQuery(resultString).build();
			// Issues the search request.
			SearchPagedResponse searchPagedResponse = googleAdsServiceClient.search(request);
			// Iterates over all rows in all pages and prints the requested field values for
			// the campaign
			// in each row.
			for (GoogleAdsRow googleAdsRow : searchPagedResponse.iterateAll()) {
				System.out.printf(" CustomerID %d and itsMCC '%s' was found.%n", googleAdsRow.getCustomerClient().getId(),
						customerId);
			}
		}
	}

}


```

## use CID and MCC to get information

write gaql and get it

```java=
String resultString="SELECT customer.id,campaign.id, campaign.name,campaign.bidding_strategy_type,campaign.start_date FROM campaign WHERE campaign.status=ENABLED ORDER BY campaign.id";
			SearchGoogleAdsRequest request = SearchGoogleAdsRequest.newBuilder()
					.setCustomerId(Long.toString(customerId)).setPageSize(10000)
					.setQuery(resultString).build();
			// Issues the search request.
			SearchPagedResponse searchPagedResponse = googleAdsServiceClient.search(request);
```

## put the information you get into java variable

```java=
List<ReportBean> reportBeanList=new ArrayList<ReportBean>();
			for (GoogleAdsRow googleAdsRow : searchPagedResponse.iterateAll()) {
				Long CID=googleAdsRow.getCustomer().getId();
				String CIDused=formatString(CID);
				Long CampaignID=googleAdsRow.getCampaign().getId();
				String CampaignName=googleAdsRow.getCampaign().getName();
				String BiddingStrategyType=googleAdsRow.getCampaign().getBiddingStrategyType().toString();
				String start_date=googleAdsRow.getCampaign().getStartDate();
				Date start_dateused = sdf.parse(start_date);
				int days=differentDaysByMillisecond(start_dateused,todayused);
				ReportBean tempReportBean=new ReportBean(CIDused,CampaignID,CampaignName,BiddingStrategyType,days);
				reportBeanList.add( tempReportBean);
			}
```

## write excel to my computer

use opencsv library which can help you write csv with **pojo** bean

## 程式碼部分

1. 有個特殊的語法可以取得 這張報表主要是去撈出 CID 所屬的MCC

QUSTION: 我的理解是這張報表是撈出MCC下面有哪些CID
沒錯:我的理解是隊的

### MAIN

```java=
package com.example.value;

import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

import com.example.value.agent.GoogleAdsServiceClientAgent;
import com.example.value.bean.ReportBean;
import com.example.value.properties.ClientOAuthPropertiesBean;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.fasterxml.jackson.dataformat.csv.CsvMapper;
import com.fasterxml.jackson.dataformat.csv.CsvSchema;
import com.fasterxml.jackson.core.JsonGenerator;
import com.google.ads.googleads.lib.GoogleAdsClient;
import com.google.ads.googleads.v8.services.GoogleAdsRow;
import com.google.ads.googleads.v8.services.GoogleAdsServiceClient;
import com.google.ads.googleads.v8.services.SearchGoogleAdsRequest;
import com.opencsv.bean.ColumnPositionMappingStrategy;
import com.opencsv.bean.StatefulBeanToCsv;
import com.opencsv.bean.StatefulBeanToCsvBuilder;
import com.google.ads.googleads.v8.services.GoogleAdsServiceClient.SearchPagedResponse;

public class GetAllMCCandCID {
	
	
	public static void main(String[] args) throws Exception {
		String Today="2021-09-06";
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
		Date todayused = sdf.parse(Today);

		String targetArray[]={"140-874-5225","156-635-7556","243-700-1598","280-836-1164","373-439-1099","398-786-8147"
				,"468-623-6768","478-943-4442","860-067-8392","921-088-1239","923-406-2250","929-054-5168","948-654-1588"
				,"985-870-8791","124-574-0503","175-056-1101","294-016-4382","346-683-3519","357-040-8515","381-777-8239"
				,"393-418-9244","609-898-7539","703-903-8427","918-840-1939","952-385-6094","967-653-8501","971-746-4629"
				,"139-751-8807","169-507-9690","207-267-2364","258-974-4517","272-014-1494","372-901-4794","380-606-4786","383-335-2976","391-893-8876","434-107-4988"
				,"603-955-3093","661-412-2893","721-356-1774","741-868-8944","793-091-1548","823-753-7909"};
		// step1 get all mcc's Cid
		
		String MCCarray[]= {"370-460-5386","673-120-8557","676-033-5214","809-235-9339","825-849-0584"};
		
		Long MCCarrayused[]=new Long[MCCarray.length];
		Long targetArrayused[]=new Long[targetArray.length];
		
		//change String to Long number
		for(int i=0;i<MCCarray.length;i++) {
			MCCarrayused[i] = Long.parseLong(MCCarray[i].replaceAll("-", ""));
		}
		
		for(int i=0;i<targetArray.length;i++) {
			targetArrayused[i] = Long.parseLong(targetArray[i].replaceAll("-", ""));
		}
		
		
		System.out.println(targetArrayused);
		System.out.println(Arrays.toString(MCCarrayused)); 
		
		System.out.println("targetArrayused總共有"+targetArrayused+"筆");
		//declare OAuthBean
		ClientOAuthPropertiesBean clientOAuthPropertiesBean = new ClientOAuthPropertiesBean();
		//declare AllMCC_CustomerIdMap
		HashMap<Long,Long >AllMCC_CustomerIdMap=new HashMap<Long, Long>();
		for(int i=0;i<MCCarrayused.length;i++) {
			GoogleAdsServiceClientAgent gasAgent = new GoogleAdsServiceClientAgent(MCCarrayused[i], clientOAuthPropertiesBean);
			GoogleAdsClient googleAdsClient = gasAgent.giveMeAnUsefulGoogleAdsClient();
			HashMap<Long,Long > map=giveMeSingleMCC_CustomerID(googleAdsClient, MCCarrayused[i]);
			AllMCC_CustomerIdMap.putAll(map);
		}
		System.out.println("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");
		System.out.println("總共有多少個customerID在所有MCC當中"+""+AllMCC_CustomerIdMap.size()+"個");
		System.out.println("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");
		
		HashMap<Long,Long >target_CustomerIdMap=new HashMap<Long, Long>();
		
		for(int i=0;i<targetArrayused.length;i++) {
			target_CustomerIdMap.put( targetArrayused[i],AllMCC_CustomerIdMap.get(targetArrayused[i]));
		}
		
		System.out.println("總共有多少個目標customerID還有他們對應的MCC"+""+target_CustomerIdMap.size()+"個");
		
		List<ReportBean> targetreportBeanList=new ArrayList<ReportBean>();
		
		for(Map.Entry<Long,Long> entry : target_CustomerIdMap.entrySet()   ) {
			GoogleAdsServiceClientAgent gasAgent = new GoogleAdsServiceClientAgent(entry.getValue(), clientOAuthPropertiesBean);
			GoogleAdsClient googleAdsClient = gasAgent.giveMeAnUsefulGoogleAdsClient();
			
			List<ReportBean> list=giveMeSingleCustomerIdInfo(googleAdsClient, entry.getKey(), todayused);
			targetreportBeanList.addAll(list);
		}
		
		System.out.println("總共有多少個目標campaign在All target customerID當中"+""+targetreportBeanList.size()+"個" );
		for(int i=0;i<50;i++) {
			System.out.println(targetreportBeanList.get(i).toString());
		}
		
//	    File csvOutputFile = new File("C:\\Users\\TDG_USER\\Documents\\doc\\resultforme.csv");
//	    CsvMapper mapper = new CsvMapper();
//        mapper.configure(JsonGenerator.Feature.IGNORE_UNKNOWN, true);
//
//        CsvSchema schema = CsvSchema.builder().setUseHeader(true)
//                .addColumn("CID")
//                .addColumn("CampaignID")
//                .addColumn("CampaignName")
//                .addColumn("BiddingStrategyType")
//                .addColumn("periods")
//                .build();
//
//        ObjectWriter writer = mapper.writerFor(ReportBean.class).with(schema);
//
//        writer.writeValues(csvOutputFile).writeAll(targetreportBeanList);
//
//        System.out.println("data saved to csv file under path: ");
//        System.out.println(csvOutputFile);
		
		
		////write csv
		////used opencsv
	       final String CSV_LOCATION = "C:\\Users\\TDG_USER\\Documents\\doc\\resultforteacher.csv";
	       
	        try {
	  
	            // Creating writer class to generate
	            // csv file
	            FileWriter writer = new 
	                       FileWriter(CSV_LOCATION);
	            writer.append("CID, CampaignID, CampaignName, BiddingStrategyType,開播天數(日)\n");
	            ColumnPositionMappingStrategy mappingStrategy=
	                        new ColumnPositionMappingStrategy();
	            mappingStrategy.setType(ReportBean.class);
	  
	            // Arrange column name as provided in below array.
	            String[] columns = new String[] 
	                    { "CID", "CampaignID", "CampaignName", "BiddingStrategyType","periods" };
	            mappingStrategy.setColumnMapping(columns);
	  
	            // Createing StatefulBeanToCsv object
	            StatefulBeanToCsvBuilder<ReportBean> builder=
	                        new StatefulBeanToCsvBuilder(writer);
	            StatefulBeanToCsv beanWriter = 
	          builder.withMappingStrategy(mappingStrategy).build();
	  
	            // Write list to StatefulBeanToCsv object
	            beanWriter.write(targetreportBeanList);
	  
	            // closing the writer object
	            writer.close();
	        }
	        catch (Exception e) {
	            e.printStackTrace();
	        }
		
//		3704605386L 
//		6731208557L
//		6760335214L
//		8092359339L
//		8258490584L
//		9874888471L //wrong dont use
//		Long testMCC=3704605386L;
//		GoogleAdsServiceClientAgent gasAgent = new GoogleAdsServiceClientAgent(testMCC, clientOAuthPropertiesBean);
//		GoogleAdsClient googleAdsClient = gasAgent.giveMeAnUsefulGoogleAdsClient();
//		HashMap<Long,  Long > map=giveMeSingleMCC_CustomerID(googleAdsClient, testMCC);
//		System.out.println("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");
//		System.out.println(testMCC+"總共有"+map.size());
//		System.out.println("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");
		
		//AllMCC_CustomerID this map has key=customerID and value=MCC and
		
		
		
	}
	private static List<ReportBean> giveMeSingleCustomerIdInfo(GoogleAdsClient googleAdsClient, long customerId,Date todayused) throws ParseException {
		try (GoogleAdsServiceClient googleAdsServiceClient = googleAdsClient.getLatestVersion()
				.createGoogleAdsServiceClient()) {
			// Creates a request that will retrieve all campaigns using pages of the
			// specified page size.
			String resultString="SELECT customer.id,campaign.id, campaign.name,campaign.bidding_strategy_type,campaign.start_date FROM campaign WHERE campaign.status=ENABLED ORDER BY campaign.id";
			SearchGoogleAdsRequest request = SearchGoogleAdsRequest.newBuilder()
					.setCustomerId(Long.toString(customerId)).setPageSize(10000)
					.setQuery(resultString).build();
			// Issues the search request.
			SearchPagedResponse searchPagedResponse = googleAdsServiceClient.search(request);
			// Iterates over all rows in all pages and prints the requested field values for
			// the campaign
			// in each row.
			SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
			List<ReportBean> reportBeanList=new ArrayList<ReportBean>();
			for (GoogleAdsRow googleAdsRow : searchPagedResponse.iterateAll()) {
				Long CID=googleAdsRow.getCustomer().getId();
				String CIDused=formatString(CID);
				Long CampaignID=googleAdsRow.getCampaign().getId();
				String CampaignName=googleAdsRow.getCampaign().getName();
				String BiddingStrategyType=googleAdsRow.getCampaign().getBiddingStrategyType().toString();
				String start_date=googleAdsRow.getCampaign().getStartDate();
				Date start_dateused = sdf.parse(start_date);
				int days=differentDaysByMillisecond(start_dateused,todayused);
				ReportBean tempReportBean=new ReportBean(CIDused,CampaignID,CampaignName,BiddingStrategyType,days);
				reportBeanList.add( tempReportBean);
			}
			return reportBeanList;
		}
	}
	private static HashMap<Long, Long > giveMeSingleMCC_CustomerID(GoogleAdsClient googleAdsClient, long customerId) {
		try (GoogleAdsServiceClient googleAdsServiceClient = googleAdsClient.getLatestVersion()
				.createGoogleAdsServiceClient()) {
			String resultString="SELECT customer_client.id,customer_client.manager,customer_client.resource_name FROM customer_client";
			SearchGoogleAdsRequest request = SearchGoogleAdsRequest.newBuilder()
					.setCustomerId(Long.toString(customerId)).setPageSize(10000)
					.setQuery(resultString).build();
			// Issues the search request.
			SearchPagedResponse searchPagedResponse = googleAdsServiceClient.search(request);
			HashMap<   Long,  Long > mccMap=new HashMap<Long, Long>();
			for (GoogleAdsRow googleAdsRow : searchPagedResponse.iterateAll()) {
				mccMap.put(googleAdsRow.getCustomerClient().getId() ,customerId  );
//				System.out.printf("MCC with customerID %d  was found.%n", googleAdsRow.getCustomerClient().getId()
//						);
			}
			return mccMap;
		}//end for try
	}//end for function
	public static String formatString(Long data) {
		String y= data.toString();
		String result=y.substring(0,3) +"-"+y.substring(3,6)+"-"+y.substring(6);
	    return result;
	
	}
	public static int differentDaysByMillisecond(Date date1,Date date2)
	{
	int days = (int) ((date2.getTime() - date1.getTime()) / (1000*3600*24));
	return days;
	}
}


```

### GoogleAdsServiceClientAgent

```java=
package com.example.value.agent;

import com.example.value.properties.ClientOAuthPropertiesBean;
import com.google.ads.googleads.lib.GoogleAdsClient;
import com.google.auth.Credentials;
import com.google.auth.oauth2.UserCredentials;

public class GoogleAdsServiceClientAgent {
	
	private Long loginCustomerId;
	private ClientOAuthPropertiesBean clientOAuthPropertiesBean;
	private Credentials credentials;
	private GoogleAdsClient googleAdsClient;
	
	
	
	public GoogleAdsServiceClientAgent(ClientOAuthPropertiesBean clientOAuthPropertiesBean) {
		super();
		this.clientOAuthPropertiesBean = clientOAuthPropertiesBean;
	}


	public GoogleAdsServiceClientAgent(Long loginCustomerId, ClientOAuthPropertiesBean clientOAuthPropertiesBean) {
		super();
		this.loginCustomerId = loginCustomerId;
		this.clientOAuthPropertiesBean = clientOAuthPropertiesBean;
	}
	
	public GoogleAdsClient giveMeAnUsefulGoogleAdsClient() throws Exception {
		makingAnUsefulGoogleAdsClient();
		
		return this.googleAdsClient;
	}//End function



	private void makingAnUsefulGoogleAdsClient() {
		try{
			credentials =
				    UserCredentials.newBuilder()
				        .setClientId(clientOAuthPropertiesBean.getClientId())
				        .setClientSecret(clientOAuthPropertiesBean.getClientSecret())
				        .setRefreshToken(clientOAuthPropertiesBean.getRefreshToken())
				        .build();
			
				googleAdsClient =
				    GoogleAdsClient.newBuilder()
				        .setCredentials(credentials)
				        .setDeveloperToken(clientOAuthPropertiesBean.getDeveloperToken())
				        .setLoginCustomerId(loginCustomerId) // Manager accounts only.
				        .build();
				
		} catch(Exception e) {
			e.printStackTrace();
			System.out.println(e.toString());
		}	

	}//End function


	public Long getLoginCustomerId() {
		return loginCustomerId;
	}


	public void setLoginCustomerId(Long loginCustomerId) {
		this.loginCustomerId = loginCustomerId;
	}


	public ClientOAuthPropertiesBean getClientOAuthPropertiesBean() {
		return clientOAuthPropertiesBean;
	}


	public void setClientOAuthPropertiesBean(ClientOAuthPropertiesBean clientOAuthPropertiesBean) {
		this.clientOAuthPropertiesBean = clientOAuthPropertiesBean;
	}


	public Credentials getCredentials() {
		return credentials;
	}


	public void setCredentials(Credentials credentials) {
		this.credentials = credentials;
	}


	public GoogleAdsClient getGoogleAdsClient() {
		return googleAdsClient;
	}


	public void setGoogleAdsClient(GoogleAdsClient googleAdsClient) {
		this.googleAdsClient = googleAdsClient;
	}
	


}//End class

```

### ClientOAuthPropertiesBean

```java=
package com.example.value.properties;

public class ClientOAuthPropertiesBean {
	
	private String ClientId;
	private String ClientSecret;
	private String RefreshToken;
	private String DeveloperToken;
	
	public ClientOAuthPropertiesBean() {
		super();
		this.ClientId = DefaultOAuthProperties.Default_ClientId;
		this.ClientSecret = DefaultOAuthProperties.Default_ClientSecret;
		this.RefreshToken = DefaultOAuthProperties.Default_RefreshToken;
		this.DeveloperToken = DefaultOAuthProperties.Default_DeveloperToken;
	}



	public ClientOAuthPropertiesBean(String clientId, String clientSecret, String refreshToken, String developerToken) {
		super();
		ClientId = clientId;
		ClientSecret = clientSecret;
		RefreshToken = refreshToken;
		DeveloperToken = developerToken;
	}
	
	
	
	public String getClientId() {
		return ClientId;
	}
	public void setClientId(String clientId) {
		ClientId = clientId;
	}
	public String getClientSecret() {
		return ClientSecret;
	}
	public void setClientSecret(String clientSecret) {
		ClientSecret = clientSecret;
	}
	public String getRefreshToken() {
		return RefreshToken;
	}
	public void setRefreshToken(String refreshToken) {
		RefreshToken = refreshToken;
	}
	public String getDeveloperToken() {
		return DeveloperToken;
	}
	public void setDeveloperToken(String developerToken) {
		DeveloperToken = developerToken;
	}
	
	
	
	

}//End class

```

### DefaultOAuthProperties

```java
package com.example.value.properties;

public class DefaultOAuthProperties {
	/*
	 * @Email Account: engr01.api@tradeserv.com
	 * 
	 * Google API Console Project: GoogleAdsAPI-Robin
	 * 
	 * OAuth 2.0 用戶端 ID Name: Allproduct Ads API
	 */
	public static final String Default_ClientId = "557959983907-4bc3ao5ltjl4ikjnbcu5cq2a5al8rktn.apps.googleusercontent.com";
	public static final String Default_ClientSecret = "Y-SuRlSLFdkh3tWHHPOHYvDk";
	public static final String Default_RefreshToken = "1/FreU73mj-clmQc0ZAaBz8J1bd4j_b4WwaIpiGeYHggE";
	public static final String Default_DeveloperToken = "LKt5cU2jKFCvjk9UNfyM0A";
	
}//End class
```

### ReportBean

```java
package com.example.value.bean;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.opencsv.bean.CsvBindByName;
import com.opencsv.bean.CsvBindByPosition;
@JsonIgnoreProperties(ignoreUnknown = true)
public class ReportBean {
	
//	@CsvBindByName(column = "CID")
//	@CsvBindByPosition(position = 0)
	String   CID;
	
	@CsvBindByName(column = "CampaignID")
//	@CsvBindByPosition(position = 1)
	Long  CampaignID;
	
	@CsvBindByName(column = "CampaignName")
//	@CsvBindByPosition(position = 2)
	String  CampaignName;
	
	@CsvBindByName(column = "BiddingStrategyType")
//	@CsvBindByPosition(position = 3)
	String  BiddingStrategyType;
	
	@CsvBindByName(column = "periods")
//	@CsvBindByPosition(position = 4)
	int periods;
	
	public ReportBean() {
		super();
	}

	public String getCID() {
		return CID;
	}

	public void setCID(String cID) {
		CID = cID;
	}

	public Long getCampaignID() {
		return CampaignID;
	}

	public void setCampaignID(Long campaignID) {
		CampaignID = campaignID;
	}

	public String getCampaignName() {
		return CampaignName;
	}

	public void setCampaignName(String campaignName) {
		CampaignName = campaignName;
	}

	public String getBiddingStrategyType() {
		return BiddingStrategyType;
	}

	public void setBiddingStrategyType(String biddingStrategyType) {
		BiddingStrategyType = biddingStrategyType;
	}

	public int getPeriods() {
		return periods;
	}

	public void setPeriods(int periods) {
		this.periods = periods;
	}

	public ReportBean(String cID, Long campaignID, String campaignName, String biddingStrategyType, int periods) {
		super();
		CID = cID;
		CampaignID = campaignID;
		CampaignName = campaignName;
		BiddingStrategyType = biddingStrategyType;
		this.periods = periods;
	}

	@Override
	public String toString() {
		return "ReportBean [CID=" + CID + ", CampaignID=" + CampaignID + ", CampaignName=" + CampaignName
				+ ", BiddingStrategyType=" + BiddingStrategyType + ", periods=" + periods + "]";
	}


}

```
