Commit 67d8e7e6 by huluobin

亚马逊广告

parent 0f93a03e
......@@ -90,7 +90,8 @@ public class AmazonAdDownloadReportJob implements SimpleJob {
.andReportDateEqualTo(jobAmazonAdLog.getReportDate())
.andCampaignIdEqualTo(amazonAdProduct.getCampaignId())
.andAdGroupIdEqualTo(amazonAdProduct.getAdGroupId())
.andSkuEqualTo(amazonAdProduct.getSku())
// .andSkuEqualTo(amazonAdProduct.getSku())
.andTypeEqualTo(jobAmazonAdLog.getType())
.example();
DcBaseFinanceAmazonAdProduct dcBaseFinanceAmazonAdProduct = dcBaseFinanceAmazonAdProductMapper.selectOneByExample(example);
......@@ -104,6 +105,7 @@ public class AmazonAdDownloadReportJob implements SimpleJob {
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());
dcBaseFinanceAmazonAdProduct.setType(jobAmazonAdLog.getType());
if (dcBaseFinanceAmazonAdProduct.getId() == null) {
dcBaseFinanceAmazonAdProductMapper.insertSelective(dcBaseFinanceAmazonAdProduct, null);
......
......@@ -50,7 +50,6 @@ public class AmazonAdGenerateReportIdJob implements SimpleJob {
.forEach(dcBaseCompanyAccount -> {
try {
LocalDateTime reportDate = LocalDateTime.now().minusDays(1).minusHours(12);
// LocalDateTime reportDate = LocalDateTime.of(2020, 8, finalI, 0, 0);
JSONObject jsonObject = new JSONObject();
jsonObject.put("reportDate", reportDate.format(DateTimeFormatter.ofPattern("yyyyMMdd")));
jsonObject.put("metrics", propertiesUtil.getPropertyAsString("METRICS"));
......@@ -91,7 +90,8 @@ public class AmazonAdGenerateReportIdJob implements SimpleJob {
LocalDateTime.now(),
LocalDateTime.now(),
dcBaseCompanyAccount.getSiteEn(),
dcBaseCompanyAccount.getCompanyId());
dcBaseCompanyAccount.getCompanyId(),
1);
}
//如果已经生成了报告 是否设置为需要重新下载?//yes
else {
......@@ -103,6 +103,7 @@ public class AmazonAdGenerateReportIdJob implements SimpleJob {
jobAmazonAdLogMapper.upsert(jobAmazonAdLog);
log.info("生成报告成功,报告日志:{}", JSON.toJSONString(jobAmazonAdLog));
} else {
log.error(JSON.toJSONString(response));
throw new RuntimeException("生成报告失败");
......
......@@ -11,11 +11,11 @@ import okhttp3.Request;
import okhttp3.Response;
import org.junit.jupiter.api.Test;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.*;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.List;
import java.util.Scanner;
import java.util.zip.GZIPInputStream;
/**
......@@ -47,12 +47,27 @@ class AmazonAdDownloadReportJobTest {
.build();
Response response = new OkHttpClient().newCall(request).execute();
// File file = new File("/Users/huluobin/Downloads/adProfile")
GZIPInputStream inputStream = new GZIPInputStream(response.body().byteStream());
Type type = new TypeToken<List<AmazonAdProduct>>() {
}.getType();
List<AmazonAdProduct> amazonAdProductList = new Gson().fromJson(new InputStreamReader(inputStream), type);
log.warn("的Report解析完成");
StringBuilder html= new StringBuilder();
Scanner sc = new Scanner(inputStream);
while (sc.hasNextLine()) {
html.append(sc.nextLine().toString() + "\r\n");
}
System.out.println(html);
// List<AmazonAdProduct> amazonAdProductList = new Gson().fromJson(new InputStreamReader(inputStream), type);
// log.warn("的Report解析完成");
}
}
package com.bailuntec.domain.entity;
import lombok.Data;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import lombok.Data;
@Data
public class DcBaseFinanceAmazonAdProduct {
......@@ -396,6 +395,15 @@ public class DcBaseFinanceAmazonAdProduct {
private BigDecimal exchangeRateUsd;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dc_base_finance_amazon_ad_product.type
*
* @mbg.generated
*/
private Integer type;
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_finance_amazon_ad_product
*
......@@ -450,6 +458,7 @@ public class DcBaseFinanceAmazonAdProduct {
sb.append(", reportType=").append(reportType);
sb.append(", exchangeRate=").append(exchangeRate);
sb.append(", exchangeRateUsd=").append(exchangeRateUsd);
sb.append(", type=").append(type);
sb.append("]");
return sb.toString();
}
......@@ -514,7 +523,8 @@ public class DcBaseFinanceAmazonAdProduct {
&& (this.getReportDate() == null ? other.getReportDate() == null : this.getReportDate().equals(other.getReportDate()))
&& (this.getReportType() == null ? other.getReportType() == null : this.getReportType().equals(other.getReportType()))
&& (this.getExchangeRate() == null ? other.getExchangeRate() == null : this.getExchangeRate().equals(other.getExchangeRate()))
&& (this.getExchangeRateUsd() == null ? other.getExchangeRateUsd() == null : this.getExchangeRateUsd().equals(other.getExchangeRateUsd()));
&& (this.getExchangeRateUsd() == null ? other.getExchangeRateUsd() == null : this.getExchangeRateUsd().equals(other.getExchangeRateUsd()))
&& (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType()));
}
/**
......@@ -570,6 +580,7 @@ public class DcBaseFinanceAmazonAdProduct {
result = prime * result + ((getReportType() == null) ? 0 : getReportType().hashCode());
result = prime * result + ((getExchangeRate() == null) ? 0 : getExchangeRate().hashCode());
result = prime * result + ((getExchangeRateUsd() == null) ? 0 : getExchangeRateUsd().hashCode());
result = prime * result + ((getType() == null) ? 0 : getType().hashCode());
return result;
}
}
\ No newline at end of file
......@@ -8,11 +8,10 @@ import java.time.LocalDate;
import java.time.LocalDateTime;
@Data
@NoArgsConstructor
@AllArgsConstructor
@NoArgsConstructor
public class JobAmazonAdLog {
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column job_amazon_ad_log.id
*
......@@ -21,7 +20,6 @@ public class JobAmazonAdLog {
private Integer id;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column job_amazon_ad_log.account_id
*
......@@ -30,7 +28,6 @@ public class JobAmazonAdLog {
private Integer accountId;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column job_amazon_ad_log.report_id
*
......@@ -39,7 +36,6 @@ public class JobAmazonAdLog {
private String reportId;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column job_amazon_ad_log.report_date
*
......@@ -48,7 +44,6 @@ public class JobAmazonAdLog {
private LocalDate reportDate;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column job_amazon_ad_log.status
*
......@@ -57,7 +52,6 @@ public class JobAmazonAdLog {
private Boolean status;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column job_amazon_ad_log.bj_create
*
......@@ -66,7 +60,6 @@ public class JobAmazonAdLog {
private LocalDateTime bjCreate;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column job_amazon_ad_log.bj_modified
*
......@@ -75,7 +68,6 @@ public class JobAmazonAdLog {
private LocalDateTime bjModified;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column job_amazon_ad_log.site_en
*
......@@ -84,7 +76,6 @@ public class JobAmazonAdLog {
private String siteEn;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column job_amazon_ad_log.company_id
*
......@@ -93,6 +84,14 @@ public class JobAmazonAdLog {
private Integer companyId;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column job_amazon_ad_log.type
*
* @mbg.generated
*/
private Integer type;
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table job_amazon_ad_log
*
......@@ -113,6 +112,7 @@ public class JobAmazonAdLog {
sb.append(", bjModified=").append(bjModified);
sb.append(", siteEn=").append(siteEn);
sb.append(", companyId=").append(companyId);
sb.append(", type=").append(type);
sb.append("]");
return sb.toString();
}
......@@ -136,14 +136,15 @@ public class JobAmazonAdLog {
}
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.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.getType() == null ? other.getType() == null : this.getType().equals(other.getType()));
}
/**
......@@ -165,6 +166,7 @@ public class JobAmazonAdLog {
result = prime * result + ((getBjModified() == null) ? 0 : getBjModified().hashCode());
result = prime * result + ((getSiteEn() == null) ? 0 : getSiteEn().hashCode());
result = prime * result + ((getCompanyId() == null) ? 0 : getCompanyId().hashCode());
result = prime * result + ((getType() == null) ? 0 : getType().hashCode());
return result;
}
}
\ No newline at end of file
}
......@@ -3171,6 +3171,66 @@ public class DcBaseFinanceAmazonAdProductExample {
addCriterion("exchange_rate_usd not between", value1, value2, "exchangeRateUsd");
return (Criteria) this;
}
public Criteria andTypeIsNull() {
addCriterion("type is null");
return (Criteria) this;
}
public Criteria andTypeIsNotNull() {
addCriterion("type is not null");
return (Criteria) this;
}
public Criteria andTypeEqualTo(Integer value) {
addCriterion("type =", value, "type");
return (Criteria) this;
}
public Criteria andTypeNotEqualTo(Integer value) {
addCriterion("type <>", value, "type");
return (Criteria) this;
}
public Criteria andTypeGreaterThan(Integer value) {
addCriterion("type >", value, "type");
return (Criteria) this;
}
public Criteria andTypeGreaterThanOrEqualTo(Integer value) {
addCriterion("type >=", value, "type");
return (Criteria) this;
}
public Criteria andTypeLessThan(Integer value) {
addCriterion("type <", value, "type");
return (Criteria) this;
}
public Criteria andTypeLessThanOrEqualTo(Integer value) {
addCriterion("type <=", value, "type");
return (Criteria) this;
}
public Criteria andTypeIn(List<Integer> values) {
addCriterion("type in", values, "type");
return (Criteria) this;
}
public Criteria andTypeNotIn(List<Integer> values) {
addCriterion("type not in", values, "type");
return (Criteria) this;
}
public Criteria andTypeBetween(Integer value1, Integer value2) {
addCriterion("type between", value1, value2, "type");
return (Criteria) this;
}
public Criteria andTypeNotBetween(Integer value1, Integer value2) {
addCriterion("type not between", value1, value2, "type");
return (Criteria) this;
}
}
/**
......@@ -3402,6 +3462,6 @@ public class DcBaseFinanceAmazonAdProductExample {
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
void example(DcBaseFinanceAmazonAdProductExample example);
void example(com.bailuntec.domain.example.DcBaseFinanceAmazonAdProductExample example);
}
}
\ No newline at end of file
......@@ -930,6 +930,66 @@ public class JobAmazonAdLogExample {
addCriterion("company_id not between", value1, value2, "companyId");
return (Criteria) this;
}
public Criteria andTypeIsNull() {
addCriterion("type is null");
return (Criteria) this;
}
public Criteria andTypeIsNotNull() {
addCriterion("type is not null");
return (Criteria) this;
}
public Criteria andTypeEqualTo(Integer value) {
addCriterion("type =", value, "type");
return (Criteria) this;
}
public Criteria andTypeNotEqualTo(Integer value) {
addCriterion("type <>", value, "type");
return (Criteria) this;
}
public Criteria andTypeGreaterThan(Integer value) {
addCriterion("type >", value, "type");
return (Criteria) this;
}
public Criteria andTypeGreaterThanOrEqualTo(Integer value) {
addCriterion("type >=", value, "type");
return (Criteria) this;
}
public Criteria andTypeLessThan(Integer value) {
addCriterion("type <", value, "type");
return (Criteria) this;
}
public Criteria andTypeLessThanOrEqualTo(Integer value) {
addCriterion("type <=", value, "type");
return (Criteria) this;
}
public Criteria andTypeIn(List<Integer> values) {
addCriterion("type in", values, "type");
return (Criteria) this;
}
public Criteria andTypeNotIn(List<Integer> values) {
addCriterion("type not in", values, "type");
return (Criteria) this;
}
public Criteria andTypeBetween(Integer value1, Integer value2) {
addCriterion("type between", value1, value2, "type");
return (Criteria) this;
}
public Criteria andTypeNotBetween(Integer value1, Integer value2) {
addCriterion("type not between", value1, value2, "type");
return (Criteria) this;
}
}
/**
......@@ -1161,6 +1221,6 @@ public class JobAmazonAdLogExample {
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
void example(JobAmazonAdLogExample example);
void example(com.bailuntec.domain.example.JobAmazonAdLogExample example);
}
}
\ No newline at end of file
......@@ -53,7 +53,7 @@
and (t4.config_id = t5.id or t5.id not in (select config_id
from dc_auto_sales_forecast_product_code_config
where product_code = t1.product_code))
and (t6.warehouse_code = t5.warehouse_code or length(trim(t5.warehouse_code)) = 0)
and (t6.warehouse_code = t5.wareListenerContainerhouse_code or length(trim(t5.warehouse_code)) = 0)
and (t6.hq_type = t5.warehouse_type or length(trim(t5.warehouse_type)) = 0)
and (t2.product_type = t5.category or length(trim(t5.category)) = 0)
and (t6.area_id = t5.warehouse_area_id or length(trim(t5.warehouse_area_id)) = 0)
......@@ -66,7 +66,6 @@
t1.daily_weighted_sales &lt;= t7.sales_upper_limit or
t1.daily_weighted_sales &gt;= t7.sales_lower_limit or t1.daily_weighted_sales is null or
length(trim(t1.daily_weighted_sales)) = 0))
-- where t1.bailun_sku ='sku' and t1.warehouse_code = 'wa'
where t5.id is not null
ORDER BY t5.`level` desc) aaa
GROUP BY bailun_sku, warehouse_code;
......
......@@ -64,6 +64,7 @@
<result column="report_type" jdbcType="VARCHAR" property="reportType"/>
<result column="exchange_rate" jdbcType="DECIMAL" property="exchangeRate"/>
<result column="exchange_rate_usd" jdbcType="DECIMAL" property="exchangeRateUsd"/>
<result column="type" jdbcType="INTEGER" property="type"/>
</resultMap>
<sql id="Example_Where_Clause">
<!--
......@@ -150,7 +151,7 @@
attributed_units_ordered_sevenday_same_sku,
attributed_units_ordered_fourteenday_same_sku, attributed_units_ordered_thirtyday_same_sku,
account_id, company_id, bj_create_time, bj_modify_time, report_date, report_type,
exchange_rate, exchange_rate_usd
exchange_rate, exchange_rate_usd,type
</sql>
<select id="selectByExample" parameterType="com.bailuntec.domain.example.DcBaseFinanceAmazonAdProductExample"
resultMap="BaseResultMap">
......@@ -230,7 +231,7 @@
attributed_units_ordered_thirtyday_same_sku, account_id,
company_id, bj_create_time, bj_modify_time,
report_date, report_type, exchange_rate,
exchange_rate_usd)
exchange_rate_usd,type)
values (#{id,jdbcType=INTEGER}, #{campaignName,jdbcType=VARCHAR}, #{campaignId,jdbcType=VARCHAR},
#{adGroupName,jdbcType=VARCHAR}, #{adGroupId,jdbcType=VARCHAR}, #{impressions,jdbcType=INTEGER},
#{clicks,jdbcType=INTEGER}, #{cost,jdbcType=DECIMAL}, #{currency,jdbcType=VARCHAR},
......@@ -251,7 +252,7 @@
#{attributedUnitsOrderedThirtydaySameSku,jdbcType=VARCHAR}, #{accountId,jdbcType=INTEGER},
#{companyId,jdbcType=INTEGER}, #{bjCreateTime,jdbcType=TIMESTAMP}, #{bjModifyTime,jdbcType=TIMESTAMP},
#{reportDate,jdbcType=DATE}, #{reportType,jdbcType=VARCHAR}, #{exchangeRate,jdbcType=DECIMAL},
#{exchangeRateUsd,jdbcType=DECIMAL})
#{exchangeRateUsd,jdbcType=DECIMAL},#{type,jdbctype=INTEGER})
</insert>
<insert id="insertSelective" parameterType="com.bailuntec.domain.entity.DcBaseFinanceAmazonAdProduct">
<!--
......@@ -396,6 +397,9 @@
<if test="record.exchangeRateUsd != null">
exchange_rate_usd,
</if>
<if test="record.type != null">
type,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="record.id != null">
......@@ -527,6 +531,9 @@
<if test="record.exchangeRateUsd != null">
#{record.exchangeRateUsd,jdbcType=DECIMAL},
</if>
<if test="record.type != null">
#{record.type,jdbcType=INTEGER},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.bailuntec.domain.example.DcBaseFinanceAmazonAdProductExample"
......@@ -690,6 +697,9 @@
<if test="record.exchangeRateUsd != null">
exchange_rate_usd = #{record.exchangeRateUsd,jdbcType=DECIMAL},
</if>
<if test="record.type != null">
type = #{record.type,jdbcType=INTEGER},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause"/>
......@@ -745,7 +755,8 @@
report_date = #{record.reportDate,jdbcType=DATE},
report_type = #{record.reportType,jdbcType=VARCHAR},
exchange_rate = #{record.exchangeRate,jdbcType=DECIMAL},
exchange_rate_usd = #{record.exchangeRateUsd,jdbcType=DECIMAL}
exchange_rate_usd = #{record.exchangeRateUsd,jdbcType=DECIMAL},
type = #{record.type,jdbcType=INTEGER}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause"/>
</if>
......@@ -886,6 +897,9 @@
<if test="exchangeRateUsd != null">
exchange_rate_usd = #{exchangeRateUsd,jdbcType=DECIMAL},
</if>
<if test="type != null">
type = #{type,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
......@@ -936,7 +950,8 @@
report_date = #{reportDate,jdbcType=DATE},
report_type = #{reportType,jdbcType=VARCHAR},
exchange_rate = #{exchangeRate,jdbcType=DECIMAL},
exchange_rate_usd = #{exchangeRateUsd,jdbcType=DECIMAL}
exchange_rate_usd = #{exchangeRateUsd,jdbcType=DECIMAL},
type = #{type,jdbcType=INTEGER}
where id = #{id,jdbcType=INTEGER}
</update>
<insert id="upsertSelective" parameterType="com.bailuntec.domain.entity.DcBaseFinanceAmazonAdProduct">
......@@ -1076,6 +1091,9 @@
<if test="exchangeRateUsd != null">
exchange_rate_usd,
</if>
<if test="type != null">
type,
</if>
</trim>
values
<trim prefix="(" suffix=")" suffixOverrides=",">
......@@ -1208,6 +1226,9 @@
<if test="exchangeRateUsd != null">
#{exchangeRateUsd,jdbcType=DECIMAL},
</if>
<if test="type != null">
#{type,jdbcType=INTEGER},
</if>
</trim>
on duplicate key update
<trim suffixOverrides=",">
......@@ -1343,6 +1364,9 @@
<if test="exchangeRateUsd != null">
exchange_rate_usd = #{exchangeRateUsd,jdbcType=DECIMAL},
</if>
<if test="type != null">
type = #{type,jdbcType=INTEGER},
</if>
</trim>
</insert>
<insert id="upsert" parameterType="com.bailuntec.domain.entity.DcBaseFinanceAmazonAdProduct">
......@@ -1363,7 +1387,7 @@
attributed_sales_thirtyday_same_sku, attributed_units_ordered_oneday_same_sku,
attributed_units_ordered_sevenday_same_sku, attributed_units_ordered_fourteenday_same_sku,
attributed_units_ordered_thirtyday_same_sku, account_id, company_id, bj_create_time,
bj_modify_time, report_date, report_type, exchange_rate, exchange_rate_usd)
bj_modify_time, report_date, report_type, exchange_rate, exchange_rate_usd,type)
values
(#{id,jdbcType=INTEGER}, #{campaignName,jdbcType=VARCHAR}, #{campaignId,jdbcType=VARCHAR},
#{adGroupName,jdbcType=VARCHAR}, #{adGroupId,jdbcType=VARCHAR}, #{impressions,jdbcType=INTEGER},
......@@ -1385,7 +1409,7 @@
#{attributedUnitsOrderedThirtydaySameSku,jdbcType=VARCHAR}, #{accountId,jdbcType=INTEGER},
#{companyId,jdbcType=INTEGER}, #{bjCreateTime,jdbcType=TIMESTAMP}, #{bjModifyTime,jdbcType=TIMESTAMP},
#{reportDate,jdbcType=DATE}, #{reportType,jdbcType=VARCHAR}, #{exchangeRate,jdbcType=DECIMAL},
#{exchangeRateUsd,jdbcType=DECIMAL})
#{exchangeRateUsd,jdbcType=DECIMAL},#{type,jdbcType=INTEGER})
on duplicate key update
id = #{id,jdbcType=INTEGER},
campaign_name = #{campaignName,jdbcType=VARCHAR},
......@@ -1429,7 +1453,8 @@
report_date = #{reportDate,jdbcType=DATE},
report_type = #{reportType,jdbcType=VARCHAR},
exchange_rate = #{exchangeRate,jdbcType=DECIMAL},
exchange_rate_usd = #{exchangeRateUsd,jdbcType=DECIMAL}
exchange_rate_usd = #{exchangeRateUsd,jdbcType=DECIMAL},
type = #{type,jdbcType=INTEGER}
</insert>
<select id="selectOneByExample" parameterType="com.bailuntec.domain.example.DcBaseFinanceAmazonAdProductExample"
resultMap="BaseResultMap">
......@@ -1474,6 +1499,7 @@
ofType="com.bailuntec.domain.dto.DcBaseSkuMappingItemDto" select="selectSkuMapping">
</collection>
</resultMap>
<select id="selectSkuMapping" resultType="com.bailuntec.domain.dto.DcBaseSkuMappingItemDto">
select dc0.*, dc1.unit_price
from dc_base_sku_mapping dc0
......@@ -1482,6 +1508,7 @@
and dc0.site = #{siteEn}
and dc0.has_deleted = 0
</select>
<select id="selectAmazonItem" resultMap="BaseResultMap1">
select dc0.*, dc1.site_en
from dc_base_finance_amazon_ad_product dc0
......
......@@ -148,5 +148,6 @@ public interface DcBaseOmsSkuMapper {
Integer omsSkuSellerCount(@Param("lowerTime") LocalDateTime lowerTime,
@Param("upperTime") LocalDateTime upperTime,
@Param("bailunSku") String bailunSku,
@Param("warehouseCode") String warehouseCode, @Param("dyas") Integer days);
@Param("warehouseCode") String warehouseCode,
@Param("days") Integer days);
}
......@@ -3711,12 +3711,19 @@
</select>
<select id="omsSkuSellerCount" resultType="java.lang.Integer">
select coalesce(sum(bailun_sku_quantity_ordered), 0)
from dc_base_oms_sku
where paid_time &gt;= #{lowerTime}
and paid_time &lt;= #{upperTime}
and bailun_sku = #{bailunSku}
and warehouse_code = #{warehouseCode}
select (select coalesce(sum(bailun_sku_quantity_ordered), 0)
from dc_base_oms_sku
where paid_time &gt;= #{lowerTime}
and paid_time &lt;= #{upperTime}
and bailun_sku = #{bailunSku}
and warehouse_code = #{warehouseCode}
and has_fba_s = 0
and has_delete = 0
and has_scalp = 0
and has_buyer_remark = 0
and has_platsku_remark = 0
and has_innersale = 0
) / #{days}
</select>
......
table-name=dc_base_oms_sku_exception
table-name=dc_base_finance_amazon_ad_product
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