Commit e7e78f3f by wutong

获取亚马逊广告费换一种写法

parent a5b2df59
package com.bailuntec;
import com.alibaba.druid.pool.DruidDataSource;
import com.bailuntec.job.AmazonAdProductJob;
import com.bailuntec.listener.AdvertSyncJobListener;
import com.bailuntec.job.AmazonAdDownloadReportJob;
import com.bailuntec.job.AmazonAdGenerateReportIdJob;
import com.bailuntec.utils.PropertiesUtil;
import com.dangdang.ddframe.job.config.JobCoreConfiguration;
import com.dangdang.ddframe.job.config.simple.SimpleJobConfiguration;
......@@ -26,7 +26,8 @@ public class Application {
private static final String EVENT_RDB_STORAGE_PASSWORD = propertiesUtil.getPropertyAsString("EVENT_RDB_STORAGE_PASSWORD");
public static void main(String[] args) {
new JobScheduler(createRegistryCenter(), createJobConfiguration1(), createJobEventConfiguration(), new AdvertSyncJobListener()).init();
new JobScheduler(createRegistryCenter(), createJobConfiguration1()).init();
new JobScheduler(createRegistryCenter(), createJobConfiguration2()).init();
}
private static CoordinatorRegistryCenter createRegistryCenter() {
......@@ -36,8 +37,15 @@ public class Application {
}
private static LiteJobConfiguration createJobConfiguration1() {
JobCoreConfiguration simpleCoreConfig = JobCoreConfiguration.newBuilder(propertiesUtil.getPropertyAsString("JOB_NAME_AD_PRODUCT"), propertiesUtil.getPropertyAsString("JOB_CRON_AD_PRODUCT"), propertiesUtil.getPropertyAsInt("SHARDING_TOTAL_COUNT")).build();
SimpleJobConfiguration simpleJobConfig = new SimpleJobConfiguration(simpleCoreConfig, AmazonAdProductJob.class.getCanonicalName());
JobCoreConfiguration simpleCoreConfig = JobCoreConfiguration.newBuilder(propertiesUtil.getPropertyAsString("JOB_NAME_AD_PRODUCT_GENERATE"), propertiesUtil.getPropertyAsString("JOB_CRON_AD_PRODUCT_GENERATE"), propertiesUtil.getPropertyAsInt("SHARDING_TOTAL_COUNT")).build();
SimpleJobConfiguration simpleJobConfig = new SimpleJobConfiguration(simpleCoreConfig, AmazonAdGenerateReportIdJob.class.getCanonicalName());
LiteJobConfiguration simpleJobRootConfig = LiteJobConfiguration.newBuilder(simpleJobConfig).build();
return simpleJobRootConfig;
}
private static LiteJobConfiguration createJobConfiguration2() {
JobCoreConfiguration simpleCoreConfig = JobCoreConfiguration.newBuilder(propertiesUtil.getPropertyAsString("JOB_NAME_AD_PRODUCT_DOWNLOAD"), propertiesUtil.getPropertyAsString("JOB_CRON_AD_PRODUCT_DOWNLOAD"), propertiesUtil.getPropertyAsInt("SHARDING_TOTAL_COUNT")).build();
SimpleJobConfiguration simpleJobConfig = new SimpleJobConfiguration(simpleCoreConfig, AmazonAdDownloadReportJob.class.getCanonicalName());
LiteJobConfiguration simpleJobRootConfig = LiteJobConfiguration.newBuilder(simpleJobConfig).build();
return simpleJobRootConfig;
}
......
package com.bailuntec.job;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.TypeReference;
import com.bailuntec.domain.entity.DcBaseCompanyAccount;
import com.bailuntec.domain.entity.DcBaseFinanceAmazonAdProduct;
import com.bailuntec.domain.entity.JobAmazonAdLog;
import com.bailuntec.domain.enumerate.CurrencyType;
import com.bailuntec.domain.example.DcBaseCompanyAccountExample;
import com.bailuntec.domain.example.DcBaseFinanceAmazonAdProductExample;
import com.bailuntec.domain.example.JobAmazonAdLogExample;
import com.bailuntec.domain.pojo.AmazonAdAuth;
import com.bailuntec.domain.pojo.AmazonAdProduct;
import com.bailuntec.mapper.DcBaseCompanyAccountMapper;
import com.bailuntec.mapper.DcBaseFinanceAmazonAdProductMapper;
import com.bailuntec.mapper.JobAmazonAdLogMapper;
import com.bailuntec.support.CallBailunSystem;
import com.bailuntec.utils.OkHttpUtil;
import com.bailuntec.utils.SessionUtil;
import com.dangdang.ddframe.job.api.ShardingContext;
import com.dangdang.ddframe.job.api.simple.SimpleJob;
import lombok.extern.slf4j.Slf4j;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import org.apache.commons.beanutils.BeanUtils;
import java.io.IOException;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;
import java.util.zip.GZIPInputStream;
@Slf4j
public class AmazonAdDownloadReportJob implements SimpleJob {
private final OkHttpClient client = OkHttpUtil.getInstance();
@Override
public void execute(ShardingContext shardingContext) {
/**
* 根据分片数去拿
* job_amazon_ad_log
* 中未下载
* 15分钟前
* 的reportId
*/
int totalPage = countJobAmazonAdLog();
int pageSize = totalPage % shardingContext.getShardingTotalCount() == 0 ? totalPage / shardingContext.getShardingTotalCount() : totalPage / shardingContext.getShardingTotalCount() + 1;
if (totalPage > 0) {
List<JobAmazonAdLog> jobAmazonAdLogList = findJobAmazonAdLogList(shardingContext, pageSize);
if (jobAmazonAdLogList != null && !jobAmazonAdLogList.isEmpty()) {
for (JobAmazonAdLog jobAmazonAdLog : jobAmazonAdLogList) {
downloadReport(jobAmazonAdLog);
}
}
}
}
private void handleReport(JobAmazonAdLog jobAmazonAdLog, AmazonAdAuth amazonAdAuth) {
Response response = null;
GZIPInputStream gzin = null;
Request request = new Request.Builder()
.url(AmazonAdGenerateReportIdJob.switchSiteUrl(jobAmazonAdLog.getSiteEn(), jobAmazonAdLog.getReportId()))
.get()
.addHeader("Authorization", amazonAdAuth.getAccessToken())
.addHeader("Amazon-Advertising-API-ClientId", amazonAdAuth.getClientId())
.addHeader("Amazon-Advertising-API-Scope", amazonAdAuth.getProfileId())
.addHeader("Content-Type", "application/json")
.build();
for (int i = 0; i < 3; i++) {
try {
response = client.newCall(request).execute();
if (response.isSuccessful()) {
gzin = new GZIPInputStream(response.body().byteStream());
List<AmazonAdProduct> amazonAdProductList = JSON.parseObject(gzin, new TypeReference<List<AmazonAdProduct>>() {
}.getType());
gzin.close();
response.close();
JobAmazonAdLogMapper jobAmazonAdLogMapper = SessionUtil.getSession().getMapper(JobAmazonAdLogMapper.class);
if (amazonAdProductList != null && amazonAdProductList.size() > 0) {
DcBaseFinanceAmazonAdProductMapper mapper = SessionUtil.getSession().getMapper(DcBaseFinanceAmazonAdProductMapper.class);
DcBaseFinanceAmazonAdProduct dcBaseFinanceAmazonAdProduct = new DcBaseFinanceAmazonAdProduct();
for (AmazonAdProduct amazonAdvert : amazonAdProductList) {
if (BigDecimal.ZERO.compareTo(amazonAdvert.getCost()) != 0) {
BeanUtils.copyProperties(dcBaseFinanceAmazonAdProduct, amazonAdvert);
dcBaseFinanceAmazonAdProduct.setAccountId(jobAmazonAdLog.getAccountId());
dcBaseFinanceAmazonAdProduct.setCompanyId(jobAmazonAdLog.getCompanyId());
dcBaseFinanceAmazonAdProduct.setReportDate(jobAmazonAdLog.getReportDate());
dcBaseFinanceAmazonAdProduct.setExchangeRate(CallBailunSystem.getExchangeRate(dcBaseFinanceAmazonAdProduct.getCurrency(), CurrencyType.CNY.value(), jobAmazonAdLog.getReportDate().atStartOfDay()));
dcBaseFinanceAmazonAdProduct.setExchangeRateUsd(CallBailunSystem.getExchangeRate(dcBaseFinanceAmazonAdProduct.getCurrency(), CurrencyType.USD.value(), jobAmazonAdLog.getReportDate().atStartOfDay()));
dcBaseFinanceAmazonAdProduct.setBjModifyTime(LocalDateTime.now());
DcBaseFinanceAmazonAdProductExample example = DcBaseFinanceAmazonAdProductExample.newAndCreateCriteria().andCompanyIdEqualTo(dcBaseFinanceAmazonAdProduct.getCompanyId()).andAccountIdEqualTo(dcBaseFinanceAmazonAdProduct.getAccountId()).andCampaignIdEqualTo(dcBaseFinanceAmazonAdProduct.getCampaignId()).andAdGroupIdEqualTo(dcBaseFinanceAmazonAdProduct.getAdGroupId()).andSkuEqualTo(dcBaseFinanceAmazonAdProduct.getSku()).andReportDateEqualTo(dcBaseFinanceAmazonAdProduct.getReportDate()).example();
int update = mapper.updateByExampleSelective(dcBaseFinanceAmazonAdProduct, example);
if (update == 0) {
mapper.insertSelective(dcBaseFinanceAmazonAdProduct);
}
}
}
}
jobAmazonAdLog.setStatus(true);
jobAmazonAdLogMapper.updateByExampleSelective(jobAmazonAdLog, JobAmazonAdLogExample.newAndCreateCriteria().andCompanyIdEqualTo(jobAmazonAdLog.getCompanyId()).andAccountIdEqualTo(jobAmazonAdLog.getAccountId()).andReportDateEqualTo(jobAmazonAdLog.getReportDate()).example());
break;
} else {
String s = response.body().string();
log.warn("第" + i+"次下载报告不成功: " + s);
}
} catch (Exception e) {
e.printStackTrace();
log.error("第" + i+"次调用获取AmazonADReportLocation错误:", e);
} finally {
SessionUtil.closeSession();
if (gzin != null) {
try {
gzin.close();
} catch (IOException e) {
e.printStackTrace();
log.error("gzin关闭错误:", e);
}
}
if (response != null) {
response.close();
}
}
}
}
private void downloadReport(JobAmazonAdLog jobAmazonAdLog) {
DcBaseCompanyAccount dcBaseCompanyAccount = getToken(jobAmazonAdLog);
AmazonAdAuth amazonAdAuth = JSON.parseObject(dcBaseCompanyAccount.getAmazonAdAuthJson(), AmazonAdAuth.class);
handleReport(jobAmazonAdLog, amazonAdAuth);
}
private DcBaseCompanyAccount getToken(JobAmazonAdLog jobAmazonAdLog) {
DcBaseCompanyAccountMapper mapper = SessionUtil.getSession().getMapper(DcBaseCompanyAccountMapper.class);
return mapper.selectOneByExample(DcBaseCompanyAccountExample.newAndCreateCriteria().andCompanyIdEqualTo(jobAmazonAdLog.getCompanyId()).andAccountIdEqualTo(jobAmazonAdLog.getAccountId()).example());
}
private List<JobAmazonAdLog> findJobAmazonAdLogList(ShardingContext shardingContext, int pageSize) {
try {
JobAmazonAdLogMapper mapper = SessionUtil.getSession().getMapper(JobAmazonAdLogMapper.class);
return mapper.selectByExample(JobAmazonAdLogExample.newAndCreateCriteria().andStatusEqualTo(false).andBjModifiedLessThan(LocalDateTime.now().minusMinutes(15)).example().orderBy("id").limit(shardingContext.getShardingItem() * pageSize, pageSize));
} catch (Exception e) {
e.printStackTrace();
return null;
} finally {
SessionUtil.closeSession();
}
}
private int countJobAmazonAdLog() {
try {
JobAmazonAdLogMapper mapper = SessionUtil.getSession().getMapper(JobAmazonAdLogMapper.class);
return (int) mapper.countByExample(JobAmazonAdLogExample.newAndCreateCriteria().andStatusEqualTo(false).example());
} catch (Exception e) {
e.printStackTrace();
return 0;
} finally {
SessionUtil.closeSession();
}
}
}
......@@ -3,6 +3,8 @@ EU_URL=https://advertising-api-eu.amazon.com
FE_URL=https://advertising-api-fe.amazon.com
POST_PRODUCT_ADS_REPORT_ID=/v2/sp/productAds/report
GET_PRODUCT_ADS_REPORT_LOCATION=/v2/reports/
GET_PRODUCT_ADS_REPORT_DOWNLOAD_PREFIX=/v1/reports/
GET_PRODUCT_ADS_REPORT_DOWNLOAD_SUFFIX=/download
WARN_API=https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=b4655a50-927a-4c3c-87ad-a900e54dcc8e
METRICS=campaignName,campaignId,adGroupName,adGroupId,impressions,clicks,cost,currency,asin,sku,attributedConversions1d,attributedConversions7d,attributedConversions14d,attributedConversions30d,attributedConversions1dSameSKU,attributedConversions7dSameSKU,attributedConversions14dSameSKU,attributedConversions30dSameSKU,attributedUnitsOrdered1d,attributedUnitsOrdered7d,attributedUnitsOrdered14d,attributedUnitsOrdered30d,attributedSales1d,attributedSales7d,attributedSales14d,attributedSales30d,attributedSales1dSameSKU,attributedSales7dSameSKU,attributedSales14dSameSKU,attributedSales30dSameSKU,attributedUnitsOrdered1dSameSKU,attributedUnitsOrdered7dSameSKU,attributedUnitsOrdered14dSameSKU,attributedUnitsOrdered30dSameSKU
......@@ -9,6 +9,8 @@ EVENT_RDB_STORAGE_USERNAME=root
EVENT_RDB_STORAGE_PASSWORD=#7kfnymAM$Y9-Ntf
ZOOKEEPER_SERVER=172.31.255.120:2181
NAME_SPACE=data-center
JOB_NAME_AD_PRODUCT=base-sync-finance-amazon-ad-product
JOB_CRON_AD_PRODUCT=0 1 0/5 * * ? *
SHARDING_TOTAL_COUNT=3
\ No newline at end of file
JOB_NAME_AD_PRODUCT_GENERATE=base-amazon-ad-product-generate
JOB_CRON_AD_PRODUCT_GENERATE=0 1 12/1 * * ? *
JOB_NAME_AD_PRODUCT_DOWNLOAD=base-amazon-ad-product-download
JOB_CRON_AD_PRODUCT_DOWNLOAD=0 1 0/1 * * ? *
SHARDING_TOTAL_COUNT=2
\ No newline at end of file
import com.bailuntec.domain.entity.DcBaseCompanyAccount;
import com.bailuntec.domain.entity.JobAccountLog;
import com.bailuntec.domain.entity.JobPointLog;
import com.bailuntec.domain.example.DcBaseCompanyAccountExample;
import com.bailuntec.domain.example.JobAccountLogExample;
import com.bailuntec.job.AmazonAdProductJob;
import com.bailuntec.mapper.DcBaseCompanyAccountMapper;
import com.bailuntec.mapper.JobAccountLogMapper;
import com.bailuntec.domain.entity.JobAmazonAdLog;
import com.bailuntec.domain.example.JobAmazonAdLogExample;
import com.bailuntec.mapper.JobAmazonAdLogMapper;
import com.bailuntec.utils.SessionUtil;
import com.dangdang.ddframe.job.api.ShardingContext;
import com.dangdang.ddframe.job.executor.ShardingContexts;
import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.Test;
import java.time.LocalDate;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.format.DateTimeFormatter;
import java.util.HashMap;
import java.util.List;
@Slf4j
public class AmazonAdProductTest {
@Test
public void test() {
AmazonAdProductJob amazonAdProductJob = new AmazonAdProductJob();
ShardingContexts shardingContexts = new ShardingContexts(null,"base-sync-finance-amazon-ad-product",1,null,new HashMap<>());
ShardingContext shardingContext = new ShardingContext(shardingContexts,0);
JobPointLog jobPointLog = new JobPointLog("base-sync-finance-amazon-ad-product", 1, 100, 0, 1,
LocalDateTime.of(2019, 7, 1, 0, 0),
LocalDateTime.of(2019, 7, 2, 0, 0));
amazonAdProductJob.executeJob(shardingContext, jobPointLog);
}
@Test
public void test1() {
AmazonAdProductJob amazonAdProductJob = new AmazonAdProductJob();
JobAccountLogMapper mapper = SessionUtil.getSession().getMapper(JobAccountLogMapper.class);
JobAccountLog dcBaseCompanyAccount = mapper.selectOneByExample(JobAccountLogExample.newAndCreateCriteria().andAccountIdEqualTo(572).example());
dcBaseCompanyAccount.setStartTime( LocalDateTime.of(2019, 5, 19, 0, 0));
amazonAdProductJob.callAmazonAdApi(dcBaseCompanyAccount);
public void test() throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, IllegalAccessException, InstantiationException {
Class clazz = Class.forName("com.bailuntec.job.AmazonAdGenerateReportIdJob");
Method generateReportId = clazz.getDeclaredMethod("generateReportId", JobAccountLog.class);
generateReportId.setAccessible(true);
JobAccountLog jobAccountLog = new JobAccountLog();
jobAccountLog.setStartTime(LocalDateTime.of(2019, 5, 31, 0, 0));
jobAccountLog.setEndTime(LocalDateTime.of(2019, 6, 1, 0, 0));
jobAccountLog.setCompanyId(1);
jobAccountLog.setAccountId(572);
jobAccountLog.setIntervalTime(1);
jobAccountLog.setJobName("base-amazon-ad-product-generate");
generateReportId.invoke(clazz.newInstance(), jobAccountLog);
}
@Test
public void test2() {
AmazonAdProductJob amazonAdProductJob = new AmazonAdProductJob();
JobAccountLogMapper mapper = SessionUtil.getSession().getMapper(JobAccountLogMapper.class);
JobAccountLog dcBaseCompanyAccount = mapper.selectOneByExample(JobAccountLogExample.newAndCreateCriteria().andAccountIdEqualTo(572).example());
dcBaseCompanyAccount.setStartTime(LocalDateTime.of(2019, 5, 30, 10, 0));
dcBaseCompanyAccount.setEndTime(LocalDateTime.of(2019, 5, 30, 11, 0));
while (dcBaseCompanyAccount.getStartTime().isBefore(LocalDateTime.now().plusDays(1L))) {
amazonAdProductJob.callAmazonAdApi(dcBaseCompanyAccount);
log.warn("TEST----" +dcBaseCompanyAccount.getStartTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")) );
public void test2() throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, IllegalAccessException, InstantiationException {
Class clazz = Class.forName("com.bailuntec.job.AmazonAdDownloadReportJob");
Method generateReportId = clazz.getDeclaredMethod("downloadReport", JobAmazonAdLog.class);
int pageSize = 10;
generateReportId.setAccessible(true);
try {
JobAmazonAdLogMapper mapper = SessionUtil.getSession().getMapper(JobAmazonAdLogMapper.class);
List<JobAmazonAdLog> jobAmazonAdLogList = mapper.selectByExample(JobAmazonAdLogExample.newAndCreateCriteria().andStatusEqualTo(false).andBjModifiedLessThan(LocalDateTime.now().minusMinutes(15)).example().orderBy("id").limit(0 * pageSize, pageSize));
if (jobAmazonAdLogList != null && !jobAmazonAdLogList.isEmpty()) {
for (JobAmazonAdLog jobAmazonAdLog : jobAmazonAdLogList) {
generateReportId.invoke(clazz.newInstance(), jobAmazonAdLog);
}
}
} catch (Exception e) {
e.printStackTrace();
} finally {
SessionUtil.closeSession();
}
}
}
package com.bailuntec.domain.entity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.time.LocalDate;
import java.time.LocalDateTime;
@Data
@NoArgsConstructor
@AllArgsConstructor
public class JobAmazonAdLog {
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column job_amazon_ad_log.id
*
* @mbg.generated
*/
private Integer id;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column job_amazon_ad_log.account_id
*
* @mbg.generated
*/
private Integer accountId;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column job_amazon_ad_log.report_id
*
* @mbg.generated
*/
private String reportId;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column job_amazon_ad_log.report_date
*
* @mbg.generated
*/
private LocalDate reportDate;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column job_amazon_ad_log.status
*
* @mbg.generated
*/
private Boolean status;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column job_amazon_ad_log.bj_create
*
* @mbg.generated
*/
private LocalDateTime bjCreate;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column job_amazon_ad_log.bj_modified
*
* @mbg.generated
*/
private LocalDateTime bjModified;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column job_amazon_ad_log.site_en
*
* @mbg.generated
*/
private String siteEn;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column job_amazon_ad_log.company_id
*
* @mbg.generated
*/
private Integer companyId;
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table job_amazon_ad_log
*
* @mbg.generated
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", accountId=").append(accountId);
sb.append(", reportId=").append(reportId);
sb.append(", reportDate=").append(reportDate);
sb.append(", status=").append(status);
sb.append(", bjCreate=").append(bjCreate);
sb.append(", bjModified=").append(bjModified);
sb.append(", siteEn=").append(siteEn);
sb.append(", companyId=").append(companyId);
sb.append("]");
return sb.toString();
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table job_amazon_ad_log
*
* @mbg.generated
*/
@Override
public boolean equals(Object that) {
if (this == that) {
return true;
}
if (that == null) {
return false;
}
if (getClass() != that.getClass()) {
return false;
}
JobAmazonAdLog other = (JobAmazonAdLog) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getAccountId() == null ? other.getAccountId() == null : this.getAccountId().equals(other.getAccountId()))
&& (this.getReportId() == null ? other.getReportId() == null : this.getReportId().equals(other.getReportId()))
&& (this.getReportDate() == null ? other.getReportDate() == null : this.getReportDate().equals(other.getReportDate()))
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
&& (this.getBjCreate() == null ? other.getBjCreate() == null : this.getBjCreate().equals(other.getBjCreate()))
&& (this.getBjModified() == null ? other.getBjModified() == null : this.getBjModified().equals(other.getBjModified()))
&& (this.getSiteEn() == null ? other.getSiteEn() == null : this.getSiteEn().equals(other.getSiteEn()))
&& (this.getCompanyId() == null ? other.getCompanyId() == null : this.getCompanyId().equals(other.getCompanyId()));
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table job_amazon_ad_log
*
* @mbg.generated
*/
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getAccountId() == null) ? 0 : getAccountId().hashCode());
result = prime * result + ((getReportId() == null) ? 0 : getReportId().hashCode());
result = prime * result + ((getReportDate() == null) ? 0 : getReportDate().hashCode());
result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
result = prime * result + ((getBjCreate() == null) ? 0 : getBjCreate().hashCode());
result = prime * result + ((getBjModified() == null) ? 0 : getBjModified().hashCode());
result = prime * result + ((getSiteEn() == null) ? 0 : getSiteEn().hashCode());
result = prime * result + ((getCompanyId() == null) ? 0 : getCompanyId().hashCode());
return result;
}
}
\ No newline at end of file
package com.bailuntec.mapper;
import com.bailuntec.domain.entity.JobAmazonAdLog;
import com.bailuntec.domain.example.JobAmazonAdLogExample;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface JobAmazonAdLogMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table job_amazon_ad_log
*
* @mbg.generated
*/
long countByExample(JobAmazonAdLogExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table job_amazon_ad_log
*
* @mbg.generated
*/
int deleteByExample(JobAmazonAdLogExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table job_amazon_ad_log
*
* @mbg.generated
*/
int deleteByPrimaryKey(Integer id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table job_amazon_ad_log
*
* @mbg.generated
*/
int insert(JobAmazonAdLog record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table job_amazon_ad_log
*
* @mbg.generated
*/
int insertSelective(JobAmazonAdLog record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table job_amazon_ad_log
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
JobAmazonAdLog selectOneByExample(JobAmazonAdLogExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table job_amazon_ad_log
*
* @mbg.generated
*/
List<JobAmazonAdLog> selectByExample(JobAmazonAdLogExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table job_amazon_ad_log
*
* @mbg.generated
*/
JobAmazonAdLog selectByPrimaryKey(Integer id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table job_amazon_ad_log
*
* @mbg.generated
*/
int updateByExampleSelective(@Param("record") JobAmazonAdLog record, @Param("example") JobAmazonAdLogExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table job_amazon_ad_log
*
* @mbg.generated
*/
int updateByExample(@Param("record") JobAmazonAdLog record, @Param("example") JobAmazonAdLogExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table job_amazon_ad_log
*
* @mbg.generated
*/
int updateByPrimaryKeySelective(JobAmazonAdLog record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table job_amazon_ad_log
*
* @mbg.generated
*/
int updateByPrimaryKey(JobAmazonAdLog record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table job_amazon_ad_log
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
int upsert(JobAmazonAdLog record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table job_amazon_ad_log
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
int upsertSelective(JobAmazonAdLog record);
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment