Commit 8322a5c4 by huluobin

daliy sales

parent bad61c50
package com.bailuntec.domain.entity; package com.bailuntec.domain.entity;
import lombok.Data;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.time.LocalDate; import java.time.LocalDate;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import lombok.Data;
@Data @Data
public class DcDailySales { public class DcDailySales {
...@@ -74,6 +73,15 @@ public class DcDailySales { ...@@ -74,6 +73,15 @@ public class DcDailySales {
/** /**
* *
* This field was generated by MyBatis Generator. * This field was generated by MyBatis Generator.
* This field corresponds to the database column dc_daily_sales.oneday_total_sales_amount
*
* @mbg.generated
*/
private BigDecimal onedayTotalSalesAmount;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dc_daily_sales.threeday_total_sales * This field corresponds to the database column dc_daily_sales.threeday_total_sales
* *
* @mbg.generated * @mbg.generated
...@@ -198,6 +206,15 @@ public class DcDailySales { ...@@ -198,6 +206,15 @@ public class DcDailySales {
private LocalDate recordDate; private LocalDate recordDate;
/** /**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dc_daily_sales.company_id
*
* @mbg.generated
*/
private Integer companyId;
/**
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_daily_sales * This method corresponds to the database table dc_daily_sales
* *
...@@ -216,6 +233,7 @@ public class DcDailySales { ...@@ -216,6 +233,7 @@ public class DcDailySales {
sb.append(", warehouseCode=").append(warehouseCode); sb.append(", warehouseCode=").append(warehouseCode);
sb.append(", bailunCategoryId=").append(bailunCategoryId); sb.append(", bailunCategoryId=").append(bailunCategoryId);
sb.append(", onedayTotalSales=").append(onedayTotalSales); sb.append(", onedayTotalSales=").append(onedayTotalSales);
sb.append(", onedayTotalSalesAmount=").append(onedayTotalSalesAmount);
sb.append(", threedayTotalSales=").append(threedayTotalSales); sb.append(", threedayTotalSales=").append(threedayTotalSales);
sb.append(", sevendayTotalSales=").append(sevendayTotalSales); sb.append(", sevendayTotalSales=").append(sevendayTotalSales);
sb.append(", fourteendayTotalSales=").append(fourteendayTotalSales); sb.append(", fourteendayTotalSales=").append(fourteendayTotalSales);
...@@ -230,6 +248,7 @@ public class DcDailySales { ...@@ -230,6 +248,7 @@ public class DcDailySales {
sb.append(", globalCompanyCode=").append(globalCompanyCode); sb.append(", globalCompanyCode=").append(globalCompanyCode);
sb.append(", globalCompanyName=").append(globalCompanyName); sb.append(", globalCompanyName=").append(globalCompanyName);
sb.append(", recordDate=").append(recordDate); sb.append(", recordDate=").append(recordDate);
sb.append(", companyId=").append(companyId);
sb.append("]"); sb.append("]");
return sb.toString(); return sb.toString();
} }
...@@ -259,6 +278,7 @@ public class DcDailySales { ...@@ -259,6 +278,7 @@ public class DcDailySales {
&& (this.getWarehouseCode() == null ? other.getWarehouseCode() == null : this.getWarehouseCode().equals(other.getWarehouseCode())) && (this.getWarehouseCode() == null ? other.getWarehouseCode() == null : this.getWarehouseCode().equals(other.getWarehouseCode()))
&& (this.getBailunCategoryId() == null ? other.getBailunCategoryId() == null : this.getBailunCategoryId().equals(other.getBailunCategoryId())) && (this.getBailunCategoryId() == null ? other.getBailunCategoryId() == null : this.getBailunCategoryId().equals(other.getBailunCategoryId()))
&& (this.getOnedayTotalSales() == null ? other.getOnedayTotalSales() == null : this.getOnedayTotalSales().equals(other.getOnedayTotalSales())) && (this.getOnedayTotalSales() == null ? other.getOnedayTotalSales() == null : this.getOnedayTotalSales().equals(other.getOnedayTotalSales()))
&& (this.getOnedayTotalSalesAmount() == null ? other.getOnedayTotalSalesAmount() == null : this.getOnedayTotalSalesAmount().equals(other.getOnedayTotalSalesAmount()))
&& (this.getThreedayTotalSales() == null ? other.getThreedayTotalSales() == null : this.getThreedayTotalSales().equals(other.getThreedayTotalSales())) && (this.getThreedayTotalSales() == null ? other.getThreedayTotalSales() == null : this.getThreedayTotalSales().equals(other.getThreedayTotalSales()))
&& (this.getSevendayTotalSales() == null ? other.getSevendayTotalSales() == null : this.getSevendayTotalSales().equals(other.getSevendayTotalSales())) && (this.getSevendayTotalSales() == null ? other.getSevendayTotalSales() == null : this.getSevendayTotalSales().equals(other.getSevendayTotalSales()))
&& (this.getFourteendayTotalSales() == null ? other.getFourteendayTotalSales() == null : this.getFourteendayTotalSales().equals(other.getFourteendayTotalSales())) && (this.getFourteendayTotalSales() == null ? other.getFourteendayTotalSales() == null : this.getFourteendayTotalSales().equals(other.getFourteendayTotalSales()))
...@@ -272,7 +292,8 @@ public class DcDailySales { ...@@ -272,7 +292,8 @@ public class DcDailySales {
&& (this.getGlobalCompanyId() == null ? other.getGlobalCompanyId() == null : this.getGlobalCompanyId().equals(other.getGlobalCompanyId())) && (this.getGlobalCompanyId() == null ? other.getGlobalCompanyId() == null : this.getGlobalCompanyId().equals(other.getGlobalCompanyId()))
&& (this.getGlobalCompanyCode() == null ? other.getGlobalCompanyCode() == null : this.getGlobalCompanyCode().equals(other.getGlobalCompanyCode())) && (this.getGlobalCompanyCode() == null ? other.getGlobalCompanyCode() == null : this.getGlobalCompanyCode().equals(other.getGlobalCompanyCode()))
&& (this.getGlobalCompanyName() == null ? other.getGlobalCompanyName() == null : this.getGlobalCompanyName().equals(other.getGlobalCompanyName())) && (this.getGlobalCompanyName() == null ? other.getGlobalCompanyName() == null : this.getGlobalCompanyName().equals(other.getGlobalCompanyName()))
&& (this.getRecordDate() == null ? other.getRecordDate() == null : this.getRecordDate().equals(other.getRecordDate())); && (this.getRecordDate() == null ? other.getRecordDate() == null : this.getRecordDate().equals(other.getRecordDate()))
&& (this.getCompanyId() == null ? other.getCompanyId() == null : this.getCompanyId().equals(other.getCompanyId()));
} }
/** /**
...@@ -292,6 +313,7 @@ public class DcDailySales { ...@@ -292,6 +313,7 @@ public class DcDailySales {
result = prime * result + ((getWarehouseCode() == null) ? 0 : getWarehouseCode().hashCode()); result = prime * result + ((getWarehouseCode() == null) ? 0 : getWarehouseCode().hashCode());
result = prime * result + ((getBailunCategoryId() == null) ? 0 : getBailunCategoryId().hashCode()); result = prime * result + ((getBailunCategoryId() == null) ? 0 : getBailunCategoryId().hashCode());
result = prime * result + ((getOnedayTotalSales() == null) ? 0 : getOnedayTotalSales().hashCode()); result = prime * result + ((getOnedayTotalSales() == null) ? 0 : getOnedayTotalSales().hashCode());
result = prime * result + ((getOnedayTotalSalesAmount() == null) ? 0 : getOnedayTotalSalesAmount().hashCode());
result = prime * result + ((getThreedayTotalSales() == null) ? 0 : getThreedayTotalSales().hashCode()); result = prime * result + ((getThreedayTotalSales() == null) ? 0 : getThreedayTotalSales().hashCode());
result = prime * result + ((getSevendayTotalSales() == null) ? 0 : getSevendayTotalSales().hashCode()); result = prime * result + ((getSevendayTotalSales() == null) ? 0 : getSevendayTotalSales().hashCode());
result = prime * result + ((getFourteendayTotalSales() == null) ? 0 : getFourteendayTotalSales().hashCode()); result = prime * result + ((getFourteendayTotalSales() == null) ? 0 : getFourteendayTotalSales().hashCode());
...@@ -306,6 +328,7 @@ public class DcDailySales { ...@@ -306,6 +328,7 @@ public class DcDailySales {
result = prime * result + ((getGlobalCompanyCode() == null) ? 0 : getGlobalCompanyCode().hashCode()); result = prime * result + ((getGlobalCompanyCode() == null) ? 0 : getGlobalCompanyCode().hashCode());
result = prime * result + ((getGlobalCompanyName() == null) ? 0 : getGlobalCompanyName().hashCode()); result = prime * result + ((getGlobalCompanyName() == null) ? 0 : getGlobalCompanyName().hashCode());
result = prime * result + ((getRecordDate() == null) ? 0 : getRecordDate().hashCode()); result = prime * result + ((getRecordDate() == null) ? 0 : getRecordDate().hashCode());
result = prime * result + ((getCompanyId() == null) ? 0 : getCompanyId().hashCode());
return result; return result;
} }
} }
\ No newline at end of file
...@@ -832,6 +832,66 @@ public class DcDailySalesExample { ...@@ -832,6 +832,66 @@ public class DcDailySalesExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andOnedayTotalSalesAmountIsNull() {
addCriterion("oneday_total_sales_amount is null");
return (Criteria) this;
}
public Criteria andOnedayTotalSalesAmountIsNotNull() {
addCriterion("oneday_total_sales_amount is not null");
return (Criteria) this;
}
public Criteria andOnedayTotalSalesAmountEqualTo(BigDecimal value) {
addCriterion("oneday_total_sales_amount =", value, "onedayTotalSalesAmount");
return (Criteria) this;
}
public Criteria andOnedayTotalSalesAmountNotEqualTo(BigDecimal value) {
addCriterion("oneday_total_sales_amount <>", value, "onedayTotalSalesAmount");
return (Criteria) this;
}
public Criteria andOnedayTotalSalesAmountGreaterThan(BigDecimal value) {
addCriterion("oneday_total_sales_amount >", value, "onedayTotalSalesAmount");
return (Criteria) this;
}
public Criteria andOnedayTotalSalesAmountGreaterThanOrEqualTo(BigDecimal value) {
addCriterion("oneday_total_sales_amount >=", value, "onedayTotalSalesAmount");
return (Criteria) this;
}
public Criteria andOnedayTotalSalesAmountLessThan(BigDecimal value) {
addCriterion("oneday_total_sales_amount <", value, "onedayTotalSalesAmount");
return (Criteria) this;
}
public Criteria andOnedayTotalSalesAmountLessThanOrEqualTo(BigDecimal value) {
addCriterion("oneday_total_sales_amount <=", value, "onedayTotalSalesAmount");
return (Criteria) this;
}
public Criteria andOnedayTotalSalesAmountIn(List<BigDecimal> values) {
addCriterion("oneday_total_sales_amount in", values, "onedayTotalSalesAmount");
return (Criteria) this;
}
public Criteria andOnedayTotalSalesAmountNotIn(List<BigDecimal> values) {
addCriterion("oneday_total_sales_amount not in", values, "onedayTotalSalesAmount");
return (Criteria) this;
}
public Criteria andOnedayTotalSalesAmountBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("oneday_total_sales_amount between", value1, value2, "onedayTotalSalesAmount");
return (Criteria) this;
}
public Criteria andOnedayTotalSalesAmountNotBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("oneday_total_sales_amount not between", value1, value2, "onedayTotalSalesAmount");
return (Criteria) this;
}
public Criteria andThreedayTotalSalesIsNull() { public Criteria andThreedayTotalSalesIsNull() {
addCriterion("threeday_total_sales is null"); addCriterion("threeday_total_sales is null");
return (Criteria) this; return (Criteria) this;
...@@ -1691,6 +1751,66 @@ public class DcDailySalesExample { ...@@ -1691,6 +1751,66 @@ public class DcDailySalesExample {
addCriterion("record_date not between", value1, value2, "recordDate"); addCriterion("record_date not between", value1, value2, "recordDate");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andCompanyIdIsNull() {
addCriterion("company_id is null");
return (Criteria) this;
}
public Criteria andCompanyIdIsNotNull() {
addCriterion("company_id is not null");
return (Criteria) this;
}
public Criteria andCompanyIdEqualTo(Integer value) {
addCriterion("company_id =", value, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdNotEqualTo(Integer value) {
addCriterion("company_id <>", value, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdGreaterThan(Integer value) {
addCriterion("company_id >", value, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdGreaterThanOrEqualTo(Integer value) {
addCriterion("company_id >=", value, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdLessThan(Integer value) {
addCriterion("company_id <", value, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdLessThanOrEqualTo(Integer value) {
addCriterion("company_id <=", value, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdIn(List<Integer> values) {
addCriterion("company_id in", values, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdNotIn(List<Integer> values) {
addCriterion("company_id not in", values, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdBetween(Integer value1, Integer value2) {
addCriterion("company_id between", value1, value2, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdNotBetween(Integer value1, Integer value2) {
addCriterion("company_id not between", value1, value2, "companyId");
return (Criteria) this;
}
} }
/** /**
...@@ -1922,6 +2042,6 @@ public class DcDailySalesExample { ...@@ -1922,6 +2042,6 @@ public class DcDailySalesExample {
* @mbg.generated * @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin * @project https://github.com/itfsw/mybatis-generator-plugin
*/ */
void example(DcDailySalesExample example); void example(com.bailuntec.domain.example.DcDailySalesExample example);
} }
} }
\ No newline at end of file
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
<result column="warehouse_code" jdbcType="VARCHAR" property="warehouseCode"/> <result column="warehouse_code" jdbcType="VARCHAR" property="warehouseCode"/>
<result column="bailun_category_id" jdbcType="INTEGER" property="bailunCategoryId"/> <result column="bailun_category_id" jdbcType="INTEGER" property="bailunCategoryId"/>
<result column="oneday_total_sales" jdbcType="INTEGER" property="onedayTotalSales"/> <result column="oneday_total_sales" jdbcType="INTEGER" property="onedayTotalSales"/>
<result column="oneday_total_sales_amount" jdbcType="DECIMAL" property="onedayTotalSalesAmount"/>
<result column="threeday_total_sales" jdbcType="INTEGER" property="threedayTotalSales"/> <result column="threeday_total_sales" jdbcType="INTEGER" property="threedayTotalSales"/>
<result column="sevenday_total_sales" jdbcType="INTEGER" property="sevendayTotalSales"/> <result column="sevenday_total_sales" jdbcType="INTEGER" property="sevendayTotalSales"/>
<result column="fourteenday_total_sales" jdbcType="INTEGER" property="fourteendayTotalSales"/> <result column="fourteenday_total_sales" jdbcType="INTEGER" property="fourteendayTotalSales"/>
...@@ -27,6 +28,7 @@ ...@@ -27,6 +28,7 @@
<result column="global_company_code" jdbcType="VARCHAR" property="globalCompanyCode"/> <result column="global_company_code" jdbcType="VARCHAR" property="globalCompanyCode"/>
<result column="global_company_name" jdbcType="VARCHAR" property="globalCompanyName"/> <result column="global_company_name" jdbcType="VARCHAR" property="globalCompanyName"/>
<result column="record_date" jdbcType="DATE" property="recordDate"/> <result column="record_date" jdbcType="DATE" property="recordDate"/>
<result column="company_id" jdbcType="INTEGER" property="companyId"/>
</resultMap> </resultMap>
<sql id="Example_Where_Clause"> <sql id="Example_Where_Clause">
<!-- <!--
...@@ -102,10 +104,10 @@ ...@@ -102,10 +104,10 @@
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
--> -->
id, bailun_sku, bailun_sku_title_cn, warehouse_name, warehouse_code, bailun_category_id, id, bailun_sku, bailun_sku_title_cn, warehouse_name, warehouse_code, bailun_category_id,
oneday_total_sales, threeday_total_sales, sevenday_total_sales, fourteenday_total_sales, oneday_total_sales, oneday_total_sales_amount, threeday_total_sales, sevenday_total_sales,
thirtyday_total_sales, threeday_average_sales, sevenday_average_sales, fourteenday_average_sales, fourteenday_total_sales, thirtyday_total_sales, threeday_average_sales, sevenday_average_sales,
thirtyday_average_sales, gmt_create, gmt_modified, global_company_id, global_company_code, fourteenday_average_sales, thirtyday_average_sales, gmt_create, gmt_modified, global_company_id,
global_company_name, record_date global_company_code, global_company_name, record_date, company_id
</sql> </sql>
<select id="selectByExample" parameterType="com.bailuntec.domain.example.DcDailySalesExample" <select id="selectByExample" parameterType="com.bailuntec.domain.example.DcDailySalesExample"
resultMap="BaseResultMap"> resultMap="BaseResultMap">
...@@ -169,23 +171,24 @@ ...@@ -169,23 +171,24 @@
--> -->
insert into dc_daily_sales (id, bailun_sku, bailun_sku_title_cn, insert into dc_daily_sales (id, bailun_sku, bailun_sku_title_cn,
warehouse_name, warehouse_code, bailun_category_id, warehouse_name, warehouse_code, bailun_category_id,
oneday_total_sales, threeday_total_sales, sevenday_total_sales, oneday_total_sales, oneday_total_sales_amount,
threeday_total_sales, sevenday_total_sales,
fourteenday_total_sales, thirtyday_total_sales, fourteenday_total_sales, thirtyday_total_sales,
threeday_average_sales, sevenday_average_sales, threeday_average_sales, sevenday_average_sales,
fourteenday_average_sales, thirtyday_average_sales, fourteenday_average_sales, thirtyday_average_sales,
gmt_create, gmt_modified, global_company_id, gmt_create, gmt_modified, global_company_id,
global_company_code, global_company_name, record_date global_company_code, global_company_name, record_date,
) company_id)
values (#{id,jdbcType=INTEGER}, #{bailunSku,jdbcType=VARCHAR}, #{bailunSkuTitleCn,jdbcType=VARCHAR}, values (#{id,jdbcType=INTEGER}, #{bailunSku,jdbcType=VARCHAR}, #{bailunSkuTitleCn,jdbcType=VARCHAR},
#{warehouseName,jdbcType=VARCHAR}, #{warehouseCode,jdbcType=VARCHAR}, #{bailunCategoryId,jdbcType=INTEGER}, #{warehouseName,jdbcType=VARCHAR}, #{warehouseCode,jdbcType=VARCHAR}, #{bailunCategoryId,jdbcType=INTEGER},
#{onedayTotalSales,jdbcType=INTEGER}, #{threedayTotalSales,jdbcType=INTEGER}, #{onedayTotalSales,jdbcType=INTEGER}, #{onedayTotalSalesAmount,jdbcType=DECIMAL},
#{sevendayTotalSales,jdbcType=INTEGER}, #{threedayTotalSales,jdbcType=INTEGER}, #{sevendayTotalSales,jdbcType=INTEGER},
#{fourteendayTotalSales,jdbcType=INTEGER}, #{thirtydayTotalSales,jdbcType=INTEGER}, #{fourteendayTotalSales,jdbcType=INTEGER}, #{thirtydayTotalSales,jdbcType=INTEGER},
#{threedayAverageSales,jdbcType=INTEGER}, #{sevendayAverageSales,jdbcType=DECIMAL}, #{threedayAverageSales,jdbcType=INTEGER}, #{sevendayAverageSales,jdbcType=DECIMAL},
#{fourteendayAverageSales,jdbcType=DECIMAL}, #{thirtydayAverageSales,jdbcType=DECIMAL}, #{fourteendayAverageSales,jdbcType=DECIMAL}, #{thirtydayAverageSales,jdbcType=DECIMAL},
#{gmtCreate,jdbcType=TIMESTAMP}, #{gmtModified,jdbcType=TIMESTAMP}, #{globalCompanyId,jdbcType=INTEGER}, #{gmtCreate,jdbcType=TIMESTAMP}, #{gmtModified,jdbcType=TIMESTAMP}, #{globalCompanyId,jdbcType=INTEGER},
#{globalCompanyCode,jdbcType=VARCHAR}, #{globalCompanyName,jdbcType=VARCHAR}, #{recordDate,jdbcType=DATE} #{globalCompanyCode,jdbcType=VARCHAR}, #{globalCompanyName,jdbcType=VARCHAR}, #{recordDate,jdbcType=DATE},
) #{companyId,jdbcType=INTEGER})
</insert> </insert>
<insert id="insertSelective" parameterType="com.bailuntec.domain.entity.DcDailySales"> <insert id="insertSelective" parameterType="com.bailuntec.domain.entity.DcDailySales">
<!-- <!--
...@@ -215,6 +218,9 @@ ...@@ -215,6 +218,9 @@
<if test="onedayTotalSales != null"> <if test="onedayTotalSales != null">
oneday_total_sales, oneday_total_sales,
</if> </if>
<if test="onedayTotalSalesAmount != null">
oneday_total_sales_amount,
</if>
<if test="threedayTotalSales != null"> <if test="threedayTotalSales != null">
threeday_total_sales, threeday_total_sales,
</if> </if>
...@@ -257,6 +263,9 @@ ...@@ -257,6 +263,9 @@
<if test="recordDate != null"> <if test="recordDate != null">
record_date, record_date,
</if> </if>
<if test="companyId != null">
company_id,
</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null"> <if test="id != null">
...@@ -280,6 +289,9 @@ ...@@ -280,6 +289,9 @@
<if test="onedayTotalSales != null"> <if test="onedayTotalSales != null">
#{onedayTotalSales,jdbcType=INTEGER}, #{onedayTotalSales,jdbcType=INTEGER},
</if> </if>
<if test="onedayTotalSalesAmount != null">
#{onedayTotalSalesAmount,jdbcType=DECIMAL},
</if>
<if test="threedayTotalSales != null"> <if test="threedayTotalSales != null">
#{threedayTotalSales,jdbcType=INTEGER}, #{threedayTotalSales,jdbcType=INTEGER},
</if> </if>
...@@ -322,6 +334,9 @@ ...@@ -322,6 +334,9 @@
<if test="recordDate != null"> <if test="recordDate != null">
#{recordDate,jdbcType=DATE}, #{recordDate,jdbcType=DATE},
</if> </if>
<if test="companyId != null">
#{companyId,jdbcType=INTEGER},
</if>
</trim> </trim>
</insert> </insert>
<select id="countByExample" parameterType="com.bailuntec.domain.example.DcDailySalesExample" <select id="countByExample" parameterType="com.bailuntec.domain.example.DcDailySalesExample"
...@@ -363,6 +378,9 @@ ...@@ -363,6 +378,9 @@
<if test="record.onedayTotalSales != null"> <if test="record.onedayTotalSales != null">
oneday_total_sales = #{record.onedayTotalSales,jdbcType=INTEGER}, oneday_total_sales = #{record.onedayTotalSales,jdbcType=INTEGER},
</if> </if>
<if test="record.onedayTotalSalesAmount != null">
oneday_total_sales_amount = #{record.onedayTotalSalesAmount,jdbcType=DECIMAL},
</if>
<if test="record.threedayTotalSales != null"> <if test="record.threedayTotalSales != null">
threeday_total_sales = #{record.threedayTotalSales,jdbcType=INTEGER}, threeday_total_sales = #{record.threedayTotalSales,jdbcType=INTEGER},
</if> </if>
...@@ -405,6 +423,9 @@ ...@@ -405,6 +423,9 @@
<if test="record.recordDate != null"> <if test="record.recordDate != null">
record_date = #{record.recordDate,jdbcType=DATE}, record_date = #{record.recordDate,jdbcType=DATE},
</if> </if>
<if test="record.companyId != null">
company_id = #{record.companyId,jdbcType=INTEGER},
</if>
</set> </set>
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause"/> <include refid="Update_By_Example_Where_Clause"/>
...@@ -423,6 +444,7 @@ ...@@ -423,6 +444,7 @@
warehouse_code = #{record.warehouseCode,jdbcType=VARCHAR}, warehouse_code = #{record.warehouseCode,jdbcType=VARCHAR},
bailun_category_id = #{record.bailunCategoryId,jdbcType=INTEGER}, bailun_category_id = #{record.bailunCategoryId,jdbcType=INTEGER},
oneday_total_sales = #{record.onedayTotalSales,jdbcType=INTEGER}, oneday_total_sales = #{record.onedayTotalSales,jdbcType=INTEGER},
oneday_total_sales_amount = #{record.onedayTotalSalesAmount,jdbcType=DECIMAL},
threeday_total_sales = #{record.threedayTotalSales,jdbcType=INTEGER}, threeday_total_sales = #{record.threedayTotalSales,jdbcType=INTEGER},
sevenday_total_sales = #{record.sevendayTotalSales,jdbcType=INTEGER}, sevenday_total_sales = #{record.sevendayTotalSales,jdbcType=INTEGER},
fourteenday_total_sales = #{record.fourteendayTotalSales,jdbcType=INTEGER}, fourteenday_total_sales = #{record.fourteendayTotalSales,jdbcType=INTEGER},
...@@ -436,7 +458,8 @@ ...@@ -436,7 +458,8 @@
global_company_id = #{record.globalCompanyId,jdbcType=INTEGER}, global_company_id = #{record.globalCompanyId,jdbcType=INTEGER},
global_company_code = #{record.globalCompanyCode,jdbcType=VARCHAR}, global_company_code = #{record.globalCompanyCode,jdbcType=VARCHAR},
global_company_name = #{record.globalCompanyName,jdbcType=VARCHAR}, global_company_name = #{record.globalCompanyName,jdbcType=VARCHAR},
record_date = #{record.recordDate,jdbcType=DATE} record_date = #{record.recordDate,jdbcType=DATE},
company_id = #{record.companyId,jdbcType=INTEGER}
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause"/> <include refid="Update_By_Example_Where_Clause"/>
</if> </if>
...@@ -466,6 +489,9 @@ ...@@ -466,6 +489,9 @@
<if test="onedayTotalSales != null"> <if test="onedayTotalSales != null">
oneday_total_sales = #{onedayTotalSales,jdbcType=INTEGER}, oneday_total_sales = #{onedayTotalSales,jdbcType=INTEGER},
</if> </if>
<if test="onedayTotalSalesAmount != null">
oneday_total_sales_amount = #{onedayTotalSalesAmount,jdbcType=DECIMAL},
</if>
<if test="threedayTotalSales != null"> <if test="threedayTotalSales != null">
threeday_total_sales = #{threedayTotalSales,jdbcType=INTEGER}, threeday_total_sales = #{threedayTotalSales,jdbcType=INTEGER},
</if> </if>
...@@ -508,6 +534,9 @@ ...@@ -508,6 +534,9 @@
<if test="recordDate != null"> <if test="recordDate != null">
record_date = #{recordDate,jdbcType=DATE}, record_date = #{recordDate,jdbcType=DATE},
</if> </if>
<if test="companyId != null">
company_id = #{companyId,jdbcType=INTEGER},
</if>
</set> </set>
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
</update> </update>
...@@ -523,6 +552,7 @@ ...@@ -523,6 +552,7 @@
warehouse_code = #{warehouseCode,jdbcType=VARCHAR}, warehouse_code = #{warehouseCode,jdbcType=VARCHAR},
bailun_category_id = #{bailunCategoryId,jdbcType=INTEGER}, bailun_category_id = #{bailunCategoryId,jdbcType=INTEGER},
oneday_total_sales = #{onedayTotalSales,jdbcType=INTEGER}, oneday_total_sales = #{onedayTotalSales,jdbcType=INTEGER},
oneday_total_sales_amount = #{onedayTotalSalesAmount,jdbcType=DECIMAL},
threeday_total_sales = #{threedayTotalSales,jdbcType=INTEGER}, threeday_total_sales = #{threedayTotalSales,jdbcType=INTEGER},
sevenday_total_sales = #{sevendayTotalSales,jdbcType=INTEGER}, sevenday_total_sales = #{sevendayTotalSales,jdbcType=INTEGER},
fourteenday_total_sales = #{fourteendayTotalSales,jdbcType=INTEGER}, fourteenday_total_sales = #{fourteendayTotalSales,jdbcType=INTEGER},
...@@ -536,7 +566,8 @@ ...@@ -536,7 +566,8 @@
global_company_id = #{globalCompanyId,jdbcType=INTEGER}, global_company_id = #{globalCompanyId,jdbcType=INTEGER},
global_company_code = #{globalCompanyCode,jdbcType=VARCHAR}, global_company_code = #{globalCompanyCode,jdbcType=VARCHAR},
global_company_name = #{globalCompanyName,jdbcType=VARCHAR}, global_company_name = #{globalCompanyName,jdbcType=VARCHAR},
record_date = #{recordDate,jdbcType=DATE} record_date = #{recordDate,jdbcType=DATE},
company_id = #{companyId,jdbcType=INTEGER}
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
</update> </update>
<insert id="upsertSelective" parameterType="com.bailuntec.domain.entity.DcDailySales"> <insert id="upsertSelective" parameterType="com.bailuntec.domain.entity.DcDailySales">
...@@ -568,6 +599,9 @@ ...@@ -568,6 +599,9 @@
<if test="onedayTotalSales != null"> <if test="onedayTotalSales != null">
oneday_total_sales, oneday_total_sales,
</if> </if>
<if test="onedayTotalSalesAmount != null">
oneday_total_sales_amount,
</if>
<if test="threedayTotalSales != null"> <if test="threedayTotalSales != null">
threeday_total_sales, threeday_total_sales,
</if> </if>
...@@ -610,6 +644,9 @@ ...@@ -610,6 +644,9 @@
<if test="recordDate != null"> <if test="recordDate != null">
record_date, record_date,
</if> </if>
<if test="companyId != null">
company_id,
</if>
</trim> </trim>
values values
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
...@@ -634,6 +671,9 @@ ...@@ -634,6 +671,9 @@
<if test="onedayTotalSales != null"> <if test="onedayTotalSales != null">
#{onedayTotalSales,jdbcType=INTEGER}, #{onedayTotalSales,jdbcType=INTEGER},
</if> </if>
<if test="onedayTotalSalesAmount != null">
#{onedayTotalSalesAmount,jdbcType=DECIMAL},
</if>
<if test="threedayTotalSales != null"> <if test="threedayTotalSales != null">
#{threedayTotalSales,jdbcType=INTEGER}, #{threedayTotalSales,jdbcType=INTEGER},
</if> </if>
...@@ -676,6 +716,9 @@ ...@@ -676,6 +716,9 @@
<if test="recordDate != null"> <if test="recordDate != null">
#{recordDate,jdbcType=DATE}, #{recordDate,jdbcType=DATE},
</if> </if>
<if test="companyId != null">
#{companyId,jdbcType=INTEGER},
</if>
</trim> </trim>
on duplicate key update on duplicate key update
<trim suffixOverrides=","> <trim suffixOverrides=",">
...@@ -700,6 +743,9 @@ ...@@ -700,6 +743,9 @@
<if test="onedayTotalSales != null"> <if test="onedayTotalSales != null">
oneday_total_sales = #{onedayTotalSales,jdbcType=INTEGER}, oneday_total_sales = #{onedayTotalSales,jdbcType=INTEGER},
</if> </if>
<if test="onedayTotalSalesAmount != null">
oneday_total_sales_amount = #{onedayTotalSalesAmount,jdbcType=DECIMAL},
</if>
<if test="threedayTotalSales != null"> <if test="threedayTotalSales != null">
threeday_total_sales = #{threedayTotalSales,jdbcType=INTEGER}, threeday_total_sales = #{threedayTotalSales,jdbcType=INTEGER},
</if> </if>
...@@ -742,6 +788,9 @@ ...@@ -742,6 +788,9 @@
<if test="recordDate != null"> <if test="recordDate != null">
record_date = #{recordDate,jdbcType=DATE}, record_date = #{recordDate,jdbcType=DATE},
</if> </if>
<if test="companyId != null">
company_id = #{companyId,jdbcType=INTEGER},
</if>
</trim> </trim>
</insert> </insert>
<insert id="upsert" parameterType="com.bailuntec.domain.entity.DcDailySales"> <insert id="upsert" parameterType="com.bailuntec.domain.entity.DcDailySales">
...@@ -752,21 +801,21 @@ ...@@ -752,21 +801,21 @@
--> -->
insert into dc_daily_sales insert into dc_daily_sales
(id, bailun_sku, bailun_sku_title_cn, warehouse_name, warehouse_code, bailun_category_id, (id, bailun_sku, bailun_sku_title_cn, warehouse_name, warehouse_code, bailun_category_id,
oneday_total_sales, threeday_total_sales, sevenday_total_sales, fourteenday_total_sales, oneday_total_sales, oneday_total_sales_amount, threeday_total_sales, sevenday_total_sales,
thirtyday_total_sales, threeday_average_sales, sevenday_average_sales, fourteenday_average_sales, fourteenday_total_sales, thirtyday_total_sales, threeday_average_sales, sevenday_average_sales,
thirtyday_average_sales, gmt_create, gmt_modified, global_company_id, global_company_code, fourteenday_average_sales, thirtyday_average_sales, gmt_create, gmt_modified, global_company_id,
global_company_name, record_date) global_company_code, global_company_name, record_date, company_id)
values values
(#{id,jdbcType=INTEGER}, #{bailunSku,jdbcType=VARCHAR}, #{bailunSkuTitleCn,jdbcType=VARCHAR}, (#{id,jdbcType=INTEGER}, #{bailunSku,jdbcType=VARCHAR}, #{bailunSkuTitleCn,jdbcType=VARCHAR},
#{warehouseName,jdbcType=VARCHAR}, #{warehouseCode,jdbcType=VARCHAR}, #{bailunCategoryId,jdbcType=INTEGER}, #{warehouseName,jdbcType=VARCHAR}, #{warehouseCode,jdbcType=VARCHAR}, #{bailunCategoryId,jdbcType=INTEGER},
#{onedayTotalSales,jdbcType=INTEGER}, #{threedayTotalSales,jdbcType=INTEGER}, #{onedayTotalSales,jdbcType=INTEGER}, #{onedayTotalSalesAmount,jdbcType=DECIMAL},
#{sevendayTotalSales,jdbcType=INTEGER}, #{threedayTotalSales,jdbcType=INTEGER}, #{sevendayTotalSales,jdbcType=INTEGER},
#{fourteendayTotalSales,jdbcType=INTEGER}, #{thirtydayTotalSales,jdbcType=INTEGER}, #{fourteendayTotalSales,jdbcType=INTEGER}, #{thirtydayTotalSales,jdbcType=INTEGER},
#{threedayAverageSales,jdbcType=INTEGER}, #{sevendayAverageSales,jdbcType=DECIMAL}, #{threedayAverageSales,jdbcType=INTEGER}, #{sevendayAverageSales,jdbcType=DECIMAL},
#{fourteendayAverageSales,jdbcType=DECIMAL}, #{thirtydayAverageSales,jdbcType=DECIMAL}, #{fourteendayAverageSales,jdbcType=DECIMAL}, #{thirtydayAverageSales,jdbcType=DECIMAL},
#{gmtCreate,jdbcType=TIMESTAMP}, #{gmtModified,jdbcType=TIMESTAMP}, #{globalCompanyId,jdbcType=INTEGER}, #{gmtCreate,jdbcType=TIMESTAMP}, #{gmtModified,jdbcType=TIMESTAMP}, #{globalCompanyId,jdbcType=INTEGER},
#{globalCompanyCode,jdbcType=VARCHAR}, #{globalCompanyName,jdbcType=VARCHAR}, #{recordDate,jdbcType=DATE} #{globalCompanyCode,jdbcType=VARCHAR}, #{globalCompanyName,jdbcType=VARCHAR}, #{recordDate,jdbcType=DATE},
) #{companyId,jdbcType=INTEGER})
on duplicate key update on duplicate key update
id = #{id,jdbcType=INTEGER}, id = #{id,jdbcType=INTEGER},
bailun_sku = #{bailunSku,jdbcType=VARCHAR}, bailun_sku = #{bailunSku,jdbcType=VARCHAR},
...@@ -775,6 +824,7 @@ ...@@ -775,6 +824,7 @@
warehouse_code = #{warehouseCode,jdbcType=VARCHAR}, warehouse_code = #{warehouseCode,jdbcType=VARCHAR},
bailun_category_id = #{bailunCategoryId,jdbcType=INTEGER}, bailun_category_id = #{bailunCategoryId,jdbcType=INTEGER},
oneday_total_sales = #{onedayTotalSales,jdbcType=INTEGER}, oneday_total_sales = #{onedayTotalSales,jdbcType=INTEGER},
oneday_total_sales_amount = #{onedayTotalSalesAmount,jdbcType=DECIMAL},
threeday_total_sales = #{threedayTotalSales,jdbcType=INTEGER}, threeday_total_sales = #{threedayTotalSales,jdbcType=INTEGER},
sevenday_total_sales = #{sevendayTotalSales,jdbcType=INTEGER}, sevenday_total_sales = #{sevendayTotalSales,jdbcType=INTEGER},
fourteenday_total_sales = #{fourteendayTotalSales,jdbcType=INTEGER}, fourteenday_total_sales = #{fourteendayTotalSales,jdbcType=INTEGER},
...@@ -788,7 +838,8 @@ ...@@ -788,7 +838,8 @@
global_company_id = #{globalCompanyId,jdbcType=INTEGER}, global_company_id = #{globalCompanyId,jdbcType=INTEGER},
global_company_code = #{globalCompanyCode,jdbcType=VARCHAR}, global_company_code = #{globalCompanyCode,jdbcType=VARCHAR},
global_company_name = #{globalCompanyName,jdbcType=VARCHAR}, global_company_name = #{globalCompanyName,jdbcType=VARCHAR},
record_date = #{recordDate,jdbcType=DATE} record_date = #{recordDate,jdbcType=DATE},
company_id = #{companyId,jdbcType=INTEGER}
</insert> </insert>
<select id="selectOneByExample" parameterType="com.bailuntec.domain.example.DcDailySalesExample" <select id="selectOneByExample" parameterType="com.bailuntec.domain.example.DcDailySalesExample"
resultMap="BaseResultMap"> resultMap="BaseResultMap">
...@@ -816,6 +867,7 @@ ...@@ -816,6 +867,7 @@
`bailun_sku_title_cn`, `bailun_sku_title_cn`,
`bailun_category_id`, `bailun_category_id`,
`oneday_total_sales`, `oneday_total_sales`,
`oneday_total_sales_amount`,
`threeday_total_sales`, `threeday_total_sales`,
`sevenday_total_sales`, `sevenday_total_sales`,
`fourteenday_total_sales`, `fourteenday_total_sales`,
...@@ -831,6 +883,7 @@ ...@@ -831,6 +883,7 @@
bailun_sku_title_cn, bailun_sku_title_cn,
bailun_category_id, bailun_category_id,
oneday_sales, oneday_sales,
oneday_sales_amount,
threeday_sales, threeday_sales,
sevenday_sales, sevenday_sales,
fourteenday_sales, fourteenday_sales,
...@@ -847,25 +900,32 @@ ...@@ -847,25 +900,32 @@
bailun_sku_title_cn, bailun_sku_title_cn,
bailun_category_id, bailun_category_id,
sum(CASE sum(CASE
WHEN (paid_time >= DATE_SUB(CURDATE(), INTERVAL 1 DAY)) THEN bailun_sku_quantity_ordered WHEN (paid_time &gt;= DATE_SUB(CURDATE(), INTERVAL 1 DAY))
THEN bailun_sku_quantity_ordered
ELSE 0 END) AS 'oneday_sales', ELSE 0 END) AS 'oneday_sales',
sum(CASE sum(CASE
WHEN (paid_time >= DATE_SUB(CURDATE(), INTERVAL 3 DAY)) THEN bailun_sku_quantity_ordered WHEN (paid_time &gt;= DATE_SUB(CURDATE(), INTERVAL 1 DAY))
THEN amount_sales * bailun_sku_quantity_ordered * seller_order_exchange_rate
ELSE 0 END) AS 'oneday_sales_amount',
sum(CASE
WHEN (paid_time &gt;= DATE_SUB(CURDATE(), INTERVAL 3 DAY))
THEN bailun_sku_quantity_ordered
ELSE 0 END) AS 'threeday_sales', ELSE 0 END) AS 'threeday_sales',
sum(CASE sum(CASE
WHEN (paid_time >= DATE_SUB(CURDATE(), INTERVAL 7 DAY)) THEN bailun_sku_quantity_ordered WHEN (paid_time &gt;= DATE_SUB(CURDATE(), INTERVAL 7 DAY))
THEN bailun_sku_quantity_ordered
ELSE 0 END) AS 'sevenday_sales', ELSE 0 END) AS 'sevenday_sales',
sum(CASE sum(CASE
WHEN (paid_time >= DATE_SUB(CURDATE(), INTERVAL 14 DAY)) WHEN (paid_time &gt;= DATE_SUB(CURDATE(), INTERVAL 14 DAY))
THEN bailun_sku_quantity_ordered THEN bailun_sku_quantity_ordered
ELSE 0 END) AS 'fourteenday_sales', ELSE 0 END) AS 'fourteenday_sales',
sum(CASE sum(CASE
WHEN (paid_time >= DATE_SUB(CURDATE(), INTERVAL 30 DAY)) WHEN (paid_time &gt;= DATE_SUB(CURDATE(), INTERVAL 30 DAY))
THEN bailun_sku_quantity_ordered THEN bailun_sku_quantity_ordered
ELSE 0 END) AS 'thirtyday_sales' ELSE 0 END) AS 'thirtyday_sales'
FROM `dc_base_oms_sku` FROM `dc_base_oms_sku`
WHERE paid_time >= DATE_SUB(CURDATE(), INTERVAL 30 DAY) WHERE paid_time &gt;= DATE_SUB(CURDATE(), INTERVAL 30 DAY)
AND paid_time &lt; CURDATE() AND paid_time &gt; CURDATE()
AND bailun_order_status != 'Canceled' AND bailun_order_status != 'Canceled'
AND has_delete = 0 AND has_delete = 0
AND has_scalp = 0 AND has_scalp = 0
......
table-name=dc_base_finance_amazon_ad_product table-name=dc_daily_sales
package com.bailuntec.job; package com.bailuntec.job;
import com.bailuntec.mapper.DcDailySalesMapper; import com.bailuntec.mapper.DcDailySalesMapper;
import com.bailuntec.utils.SessionUtil; import com.bailuntec.utils.SessionUtil;
import com.dangdang.ddframe.job.api.ShardingContext; import com.dangdang.ddframe.job.api.ShardingContext;
import com.dangdang.ddframe.job.api.simple.SimpleJob; import com.dangdang.ddframe.job.api.simple.SimpleJob;
...@@ -11,6 +12,7 @@ public class CalculateSalesJob implements SimpleJob { ...@@ -11,6 +12,7 @@ public class CalculateSalesJob implements SimpleJob {
try { try {
DcDailySalesMapper mapper = SessionUtil.getSession().getMapper(DcDailySalesMapper.class); DcDailySalesMapper mapper = SessionUtil.getSession().getMapper(DcDailySalesMapper.class);
mapper.calculateSales(); mapper.calculateSales();
SessionUtil.getSession().commit(); SessionUtil.getSession().commit();
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
......
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