Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dc-java
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
huluobin
dc-java
Commits
8322a5c4
Commit
8322a5c4
authored
Sep 03, 2020
by
huluobin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
daliy sales
parent
bad61c50
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
241 additions
and
34 deletions
+241
-34
DcDailySales.java
...c/main/java/com/bailuntec/domain/entity/DcDailySales.java
+27
-3
DcDailySalesExample.java
...ava/com/bailuntec/domain/example/DcDailySalesExample.java
+122
-1
DcDailySalesMapper.xml
...src/main/java/com/bailuntec/mapper/DcDailySalesMapper.xml
+89
-29
init.properties
data-common/src/main/resources/init.properties
+1
-1
CalculateSalesJob.java
...es/src/main/java/com/bailuntec/job/CalculateSalesJob.java
+2
-0
No files found.
data-common/src/main/java/com/bailuntec/domain/entity/DcDailySales.java
View file @
8322a5c4
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
DcDailySales
{
...
...
@@ -74,6 +73,15 @@ public class DcDailySales {
/**
*
* 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
*
* @mbg.generated
...
...
@@ -198,6 +206,15 @@ public class DcDailySales {
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 corresponds to the database table dc_daily_sales
*
...
...
@@ -216,6 +233,7 @@ public class DcDailySales {
sb
.
append
(
", warehouseCode="
).
append
(
warehouseCode
);
sb
.
append
(
", bailunCategoryId="
).
append
(
bailunCategoryId
);
sb
.
append
(
", onedayTotalSales="
).
append
(
onedayTotalSales
);
sb
.
append
(
", onedayTotalSalesAmount="
).
append
(
onedayTotalSalesAmount
);
sb
.
append
(
", threedayTotalSales="
).
append
(
threedayTotalSales
);
sb
.
append
(
", sevendayTotalSales="
).
append
(
sevendayTotalSales
);
sb
.
append
(
", fourteendayTotalSales="
).
append
(
fourteendayTotalSales
);
...
...
@@ -230,6 +248,7 @@ public class DcDailySales {
sb
.
append
(
", globalCompanyCode="
).
append
(
globalCompanyCode
);
sb
.
append
(
", globalCompanyName="
).
append
(
globalCompanyName
);
sb
.
append
(
", recordDate="
).
append
(
recordDate
);
sb
.
append
(
", companyId="
).
append
(
companyId
);
sb
.
append
(
"]"
);
return
sb
.
toString
();
}
...
...
@@ -259,6 +278,7 @@ public class DcDailySales {
&&
(
this
.
getWarehouseCode
()
==
null
?
other
.
getWarehouseCode
()
==
null
:
this
.
getWarehouseCode
().
equals
(
other
.
getWarehouseCode
()))
&&
(
this
.
getBailunCategoryId
()
==
null
?
other
.
getBailunCategoryId
()
==
null
:
this
.
getBailunCategoryId
().
equals
(
other
.
getBailunCategoryId
()))
&&
(
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
.
getSevendayTotalSales
()
==
null
?
other
.
getSevendayTotalSales
()
==
null
:
this
.
getSevendayTotalSales
().
equals
(
other
.
getSevendayTotalSales
()))
&&
(
this
.
getFourteendayTotalSales
()
==
null
?
other
.
getFourteendayTotalSales
()
==
null
:
this
.
getFourteendayTotalSales
().
equals
(
other
.
getFourteendayTotalSales
()))
...
...
@@ -272,7 +292,8 @@ public class DcDailySales {
&&
(
this
.
getGlobalCompanyId
()
==
null
?
other
.
getGlobalCompanyId
()
==
null
:
this
.
getGlobalCompanyId
().
equals
(
other
.
getGlobalCompanyId
()))
&&
(
this
.
getGlobalCompanyCode
()
==
null
?
other
.
getGlobalCompanyCode
()
==
null
:
this
.
getGlobalCompanyCode
().
equals
(
other
.
getGlobalCompanyCode
()))
&&
(
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 {
result
=
prime
*
result
+
((
getWarehouseCode
()
==
null
)
?
0
:
getWarehouseCode
().
hashCode
());
result
=
prime
*
result
+
((
getBailunCategoryId
()
==
null
)
?
0
:
getBailunCategoryId
().
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
+
((
getSevendayTotalSales
()
==
null
)
?
0
:
getSevendayTotalSales
().
hashCode
());
result
=
prime
*
result
+
((
getFourteendayTotalSales
()
==
null
)
?
0
:
getFourteendayTotalSales
().
hashCode
());
...
...
@@ -306,6 +328,7 @@ public class DcDailySales {
result
=
prime
*
result
+
((
getGlobalCompanyCode
()
==
null
)
?
0
:
getGlobalCompanyCode
().
hashCode
());
result
=
prime
*
result
+
((
getGlobalCompanyName
()
==
null
)
?
0
:
getGlobalCompanyName
().
hashCode
());
result
=
prime
*
result
+
((
getRecordDate
()
==
null
)
?
0
:
getRecordDate
().
hashCode
());
result
=
prime
*
result
+
((
getCompanyId
()
==
null
)
?
0
:
getCompanyId
().
hashCode
());
return
result
;
}
}
\ No newline at end of file
data-common/src/main/java/com/bailuntec/domain/example/DcDailySalesExample.java
View file @
8322a5c4
...
...
@@ -832,6 +832,66 @@ public class DcDailySalesExample {
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
()
{
addCriterion
(
"threeday_total_sales is null"
);
return
(
Criteria
)
this
;
...
...
@@ -1691,6 +1751,66 @@ public class DcDailySalesExample {
addCriterion
(
"record_date not between"
,
value1
,
value2
,
"recordDate"
);
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 {
* @mbg.generated
* @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
data-common/src/main/java/com/bailuntec/mapper/DcDailySalesMapper.xml
View file @
8322a5c4
...
...
@@ -13,6 +13,7 @@
<result
column=
"warehouse_code"
jdbcType=
"VARCHAR"
property=
"warehouseCode"
/>
<result
column=
"bailun_category_id"
jdbcType=
"INTEGER"
property=
"bailunCategoryId"
/>
<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=
"sevenday_total_sales"
jdbcType=
"INTEGER"
property=
"sevendayTotalSales"
/>
<result
column=
"fourteenday_total_sales"
jdbcType=
"INTEGER"
property=
"fourteendayTotalSales"
/>
...
...
@@ -27,6 +28,7 @@
<result
column=
"global_company_code"
jdbcType=
"VARCHAR"
property=
"globalCompanyCode"
/>
<result
column=
"global_company_name"
jdbcType=
"VARCHAR"
property=
"globalCompanyName"
/>
<result
column=
"record_date"
jdbcType=
"DATE"
property=
"recordDate"
/>
<result
column=
"company_id"
jdbcType=
"INTEGER"
property=
"companyId"
/>
</resultMap>
<sql
id=
"Example_Where_Clause"
>
<!--
...
...
@@ -102,10 +104,10 @@
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,
oneday_total_sales,
threeday_total_sales, sevenday_total_sales, fourte
enday_total_sales,
thirtyday_total_sales, threeday_average_sales, sevenday_average_sales, fourte
enday_average_sales,
thirtyday_average_sales, gmt_create, gmt_modified, global_company_id, global_company_code
,
global_company_
name, record_date
oneday_total_sales,
oneday_total_sales_amount, threeday_total_sales, sev
enday_total_sales,
fourteenday_total_sales, thirtyday_total_sales, threeday_average_sales, sev
enday_average_sales,
fourteenday_average_sales, thirtyday_average_sales, gmt_create, gmt_modified, global_company_id
,
global_company_
code, global_company_name, record_date, company_id
</sql>
<select
id=
"selectByExample"
parameterType=
"com.bailuntec.domain.example.DcDailySalesExample"
resultMap=
"BaseResultMap"
>
...
...
@@ -169,23 +171,24 @@
-->
insert into dc_daily_sales (id, bailun_sku, bailun_sku_title_cn,
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,
threeday_average_sales, sevenday_average_sales,
fourteenday_average_sales, thirtyday_average_sales,
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},
#{warehouseName,jdbcType=VARCHAR}, #{warehouseCode,jdbcType=VARCHAR}, #{bailunCategoryId,jdbcType=INTEGER},
#{onedayTotalSales,jdbcType=INTEGER}, #{
threedayTotalSales,jdbcType=INTEGER
},
#{sevendayTotalSales,jdbcType=INTEGER},
#{onedayTotalSales,jdbcType=INTEGER}, #{
onedayTotalSalesAmount,jdbcType=DECIMAL
},
#{
threedayTotalSales,jdbcType=INTEGER}, #{
sevendayTotalSales,jdbcType=INTEGER},
#{fourteendayTotalSales,jdbcType=INTEGER}, #{thirtydayTotalSales,jdbcType=INTEGER},
#{threedayAverageSales,jdbcType=INTEGER}, #{sevendayAverageSales,jdbcType=DECIMAL},
#{fourteendayAverageSales,jdbcType=DECIMAL}, #{thirtydayAverageSales,jdbcType=DECIMAL},
#{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
id=
"insertSelective"
parameterType=
"com.bailuntec.domain.entity.DcDailySales"
>
<!--
...
...
@@ -215,6 +218,9 @@
<if
test=
"onedayTotalSales != null"
>
oneday_total_sales,
</if>
<if
test=
"onedayTotalSalesAmount != null"
>
oneday_total_sales_amount,
</if>
<if
test=
"threedayTotalSales != null"
>
threeday_total_sales,
</if>
...
...
@@ -257,6 +263,9 @@
<if
test=
"recordDate != null"
>
record_date,
</if>
<if
test=
"companyId != null"
>
company_id,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"id != null"
>
...
...
@@ -280,6 +289,9 @@
<if
test=
"onedayTotalSales != null"
>
#{onedayTotalSales,jdbcType=INTEGER},
</if>
<if
test=
"onedayTotalSalesAmount != null"
>
#{onedayTotalSalesAmount,jdbcType=DECIMAL},
</if>
<if
test=
"threedayTotalSales != null"
>
#{threedayTotalSales,jdbcType=INTEGER},
</if>
...
...
@@ -322,6 +334,9 @@
<if
test=
"recordDate != null"
>
#{recordDate,jdbcType=DATE},
</if>
<if
test=
"companyId != null"
>
#{companyId,jdbcType=INTEGER},
</if>
</trim>
</insert>
<select
id=
"countByExample"
parameterType=
"com.bailuntec.domain.example.DcDailySalesExample"
...
...
@@ -363,6 +378,9 @@
<if
test=
"record.onedayTotalSales != null"
>
oneday_total_sales = #{record.onedayTotalSales,jdbcType=INTEGER},
</if>
<if
test=
"record.onedayTotalSalesAmount != null"
>
oneday_total_sales_amount = #{record.onedayTotalSalesAmount,jdbcType=DECIMAL},
</if>
<if
test=
"record.threedayTotalSales != null"
>
threeday_total_sales = #{record.threedayTotalSales,jdbcType=INTEGER},
</if>
...
...
@@ -405,6 +423,9 @@
<if
test=
"record.recordDate != null"
>
record_date = #{record.recordDate,jdbcType=DATE},
</if>
<if
test=
"record.companyId != null"
>
company_id = #{record.companyId,jdbcType=INTEGER},
</if>
</set>
<if
test=
"_parameter != null"
>
<include
refid=
"Update_By_Example_Where_Clause"
/>
...
...
@@ -423,6 +444,7 @@
warehouse_code = #{record.warehouseCode,jdbcType=VARCHAR},
bailun_category_id = #{record.bailunCategoryId,jdbcType=INTEGER},
oneday_total_sales = #{record.onedayTotalSales,jdbcType=INTEGER},
oneday_total_sales_amount = #{record.onedayTotalSalesAmount,jdbcType=DECIMAL},
threeday_total_sales = #{record.threedayTotalSales,jdbcType=INTEGER},
sevenday_total_sales = #{record.sevendayTotalSales,jdbcType=INTEGER},
fourteenday_total_sales = #{record.fourteendayTotalSales,jdbcType=INTEGER},
...
...
@@ -436,7 +458,8 @@
global_company_id = #{record.globalCompanyId,jdbcType=INTEGER},
global_company_code = #{record.globalCompanyCode,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"
>
<include
refid=
"Update_By_Example_Where_Clause"
/>
</if>
...
...
@@ -466,6 +489,9 @@
<if
test=
"onedayTotalSales != null"
>
oneday_total_sales = #{onedayTotalSales,jdbcType=INTEGER},
</if>
<if
test=
"onedayTotalSalesAmount != null"
>
oneday_total_sales_amount = #{onedayTotalSalesAmount,jdbcType=DECIMAL},
</if>
<if
test=
"threedayTotalSales != null"
>
threeday_total_sales = #{threedayTotalSales,jdbcType=INTEGER},
</if>
...
...
@@ -508,6 +534,9 @@
<if
test=
"recordDate != null"
>
record_date = #{recordDate,jdbcType=DATE},
</if>
<if
test=
"companyId != null"
>
company_id = #{companyId,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
...
...
@@ -523,6 +552,7 @@
warehouse_code = #{warehouseCode,jdbcType=VARCHAR},
bailun_category_id = #{bailunCategoryId,jdbcType=INTEGER},
oneday_total_sales = #{onedayTotalSales,jdbcType=INTEGER},
oneday_total_sales_amount = #{onedayTotalSalesAmount,jdbcType=DECIMAL},
threeday_total_sales = #{threedayTotalSales,jdbcType=INTEGER},
sevenday_total_sales = #{sevendayTotalSales,jdbcType=INTEGER},
fourteenday_total_sales = #{fourteendayTotalSales,jdbcType=INTEGER},
...
...
@@ -536,7 +566,8 @@
global_company_id = #{globalCompanyId,jdbcType=INTEGER},
global_company_code = #{globalCompanyCode,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}
</update>
<insert
id=
"upsertSelective"
parameterType=
"com.bailuntec.domain.entity.DcDailySales"
>
...
...
@@ -568,6 +599,9 @@
<if
test=
"onedayTotalSales != null"
>
oneday_total_sales,
</if>
<if
test=
"onedayTotalSalesAmount != null"
>
oneday_total_sales_amount,
</if>
<if
test=
"threedayTotalSales != null"
>
threeday_total_sales,
</if>
...
...
@@ -610,6 +644,9 @@
<if
test=
"recordDate != null"
>
record_date,
</if>
<if
test=
"companyId != null"
>
company_id,
</if>
</trim>
values
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
...
...
@@ -634,6 +671,9 @@
<if
test=
"onedayTotalSales != null"
>
#{onedayTotalSales,jdbcType=INTEGER},
</if>
<if
test=
"onedayTotalSalesAmount != null"
>
#{onedayTotalSalesAmount,jdbcType=DECIMAL},
</if>
<if
test=
"threedayTotalSales != null"
>
#{threedayTotalSales,jdbcType=INTEGER},
</if>
...
...
@@ -676,6 +716,9 @@
<if
test=
"recordDate != null"
>
#{recordDate,jdbcType=DATE},
</if>
<if
test=
"companyId != null"
>
#{companyId,jdbcType=INTEGER},
</if>
</trim>
on duplicate key update
<trim
suffixOverrides=
","
>
...
...
@@ -700,6 +743,9 @@
<if
test=
"onedayTotalSales != null"
>
oneday_total_sales = #{onedayTotalSales,jdbcType=INTEGER},
</if>
<if
test=
"onedayTotalSalesAmount != null"
>
oneday_total_sales_amount = #{onedayTotalSalesAmount,jdbcType=DECIMAL},
</if>
<if
test=
"threedayTotalSales != null"
>
threeday_total_sales = #{threedayTotalSales,jdbcType=INTEGER},
</if>
...
...
@@ -742,6 +788,9 @@
<if
test=
"recordDate != null"
>
record_date = #{recordDate,jdbcType=DATE},
</if>
<if
test=
"companyId != null"
>
company_id = #{companyId,jdbcType=INTEGER},
</if>
</trim>
</insert>
<insert
id=
"upsert"
parameterType=
"com.bailuntec.domain.entity.DcDailySales"
>
...
...
@@ -752,21 +801,21 @@
-->
insert into dc_daily_sales
(id, bailun_sku, bailun_sku_title_cn, warehouse_name, warehouse_code, bailun_category_id,
oneday_total_sales,
threeday_total_sales, sevenday_total_sales, fourte
enday_total_sales,
thirtyday_total_sales, threeday_average_sales, sevenday_average_sales, fourte
enday_average_sales,
thirtyday_average_sales, gmt_create, gmt_modified, global_company_id, global_company_code
,
global_company_
name, record_date
)
oneday_total_sales,
oneday_total_sales_amount, threeday_total_sales, sev
enday_total_sales,
fourteenday_total_sales, thirtyday_total_sales, threeday_average_sales, sev
enday_average_sales,
fourteenday_average_sales, thirtyday_average_sales, gmt_create, gmt_modified, global_company_id
,
global_company_
code, global_company_name, record_date, company_id
)
values
(#{id,jdbcType=INTEGER}, #{bailunSku,jdbcType=VARCHAR}, #{bailunSkuTitleCn,jdbcType=VARCHAR},
#{warehouseName,jdbcType=VARCHAR}, #{warehouseCode,jdbcType=VARCHAR}, #{bailunCategoryId,jdbcType=INTEGER},
#{onedayTotalSales,jdbcType=INTEGER}, #{
threedayTotalSales,jdbcType=INTEGER
},
#{sevendayTotalSales,jdbcType=INTEGER},
#{onedayTotalSales,jdbcType=INTEGER}, #{
onedayTotalSalesAmount,jdbcType=DECIMAL
},
#{
threedayTotalSales,jdbcType=INTEGER}, #{
sevendayTotalSales,jdbcType=INTEGER},
#{fourteendayTotalSales,jdbcType=INTEGER}, #{thirtydayTotalSales,jdbcType=INTEGER},
#{threedayAverageSales,jdbcType=INTEGER}, #{sevendayAverageSales,jdbcType=DECIMAL},
#{fourteendayAverageSales,jdbcType=DECIMAL}, #{thirtydayAverageSales,jdbcType=DECIMAL},
#{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
id = #{id,jdbcType=INTEGER},
bailun_sku = #{bailunSku,jdbcType=VARCHAR},
...
...
@@ -775,6 +824,7 @@
warehouse_code = #{warehouseCode,jdbcType=VARCHAR},
bailun_category_id = #{bailunCategoryId,jdbcType=INTEGER},
oneday_total_sales = #{onedayTotalSales,jdbcType=INTEGER},
oneday_total_sales_amount = #{onedayTotalSalesAmount,jdbcType=DECIMAL},
threeday_total_sales = #{threedayTotalSales,jdbcType=INTEGER},
sevenday_total_sales = #{sevendayTotalSales,jdbcType=INTEGER},
fourteenday_total_sales = #{fourteendayTotalSales,jdbcType=INTEGER},
...
...
@@ -788,7 +838,8 @@
global_company_id = #{globalCompanyId,jdbcType=INTEGER},
global_company_code = #{globalCompanyCode,jdbcType=VARCHAR},
global_company_name = #{globalCompanyName,jdbcType=VARCHAR},
record_date = #{recordDate,jdbcType=DATE}
record_date = #{recordDate,jdbcType=DATE},
company_id = #{companyId,jdbcType=INTEGER}
</insert>
<select
id=
"selectOneByExample"
parameterType=
"com.bailuntec.domain.example.DcDailySalesExample"
resultMap=
"BaseResultMap"
>
...
...
@@ -816,6 +867,7 @@
`bailun_sku_title_cn`,
`bailun_category_id`,
`oneday_total_sales`,
`oneday_total_sales_amount`,
`threeday_total_sales`,
`sevenday_total_sales`,
`fourteenday_total_sales`,
...
...
@@ -831,6 +883,7 @@
bailun_sku_title_cn,
bailun_category_id,
oneday_sales,
oneday_sales_amount,
threeday_sales,
sevenday_sales,
fourteenday_sales,
...
...
@@ -847,25 +900,32 @@
bailun_sku_title_cn,
bailun_category_id,
sum(CASE
WHEN (paid_time >= DATE_SUB(CURDATE(), INTERVAL 1 DAY)) THEN bailun_sku_quantity_ordered
WHEN (paid_time
>
= DATE_SUB(CURDATE(), INTERVAL 1 DAY))
THEN bailun_sku_quantity_ordered
ELSE 0 END) AS 'oneday_sales',
sum(CASE
WHEN (paid_time >= DATE_SUB(CURDATE(), INTERVAL 3 DAY)) THEN bailun_sku_quantity_ordered
WHEN (paid_time
>
= 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
>
= DATE_SUB(CURDATE(), INTERVAL 3 DAY))
THEN bailun_sku_quantity_ordered
ELSE 0 END) AS 'threeday_sales',
sum(CASE
WHEN (paid_time >= DATE_SUB(CURDATE(), INTERVAL 7 DAY)) THEN bailun_sku_quantity_ordered
WHEN (paid_time
>
= DATE_SUB(CURDATE(), INTERVAL 7 DAY))
THEN bailun_sku_quantity_ordered
ELSE 0 END) AS 'sevenday_sales',
sum(CASE
WHEN (paid_time
>
= DATE_SUB(CURDATE(), INTERVAL 14 DAY))
WHEN (paid_time
>
= DATE_SUB(CURDATE(), INTERVAL 14 DAY))
THEN bailun_sku_quantity_ordered
ELSE 0 END) AS 'fourteenday_sales',
sum(CASE
WHEN (paid_time
>
= DATE_SUB(CURDATE(), INTERVAL 30 DAY))
WHEN (paid_time
>
= DATE_SUB(CURDATE(), INTERVAL 30 DAY))
THEN bailun_sku_quantity_ordered
ELSE 0 END) AS 'thirtyday_sales'
FROM `dc_base_oms_sku`
WHERE paid_time
>
= DATE_SUB(CURDATE(), INTERVAL 30 DAY)
AND paid_time
&
l
t;
CURDATE()
WHERE paid_time
>
= DATE_SUB(CURDATE(), INTERVAL 30 DAY)
AND paid_time
&
g
t;
CURDATE()
AND bailun_order_status != 'Canceled'
AND has_delete = 0
AND has_scalp = 0
...
...
data-common/src/main/resources/init.properties
View file @
8322a5c4
table-name
=
dc_
base_finance_amazon_ad_product
table-name
=
dc_
daily_sales
data-mid/mid-calculate-sales/src/main/java/com/bailuntec/job/CalculateSalesJob.java
View file @
8322a5c4
package
com
.
bailuntec
.
job
;
import
com.bailuntec.mapper.DcDailySalesMapper
;
import
com.bailuntec.utils.SessionUtil
;
import
com.dangdang.ddframe.job.api.ShardingContext
;
import
com.dangdang.ddframe.job.api.simple.SimpleJob
;
...
...
@@ -11,6 +12,7 @@ public class CalculateSalesJob implements SimpleJob {
try
{
DcDailySalesMapper
mapper
=
SessionUtil
.
getSession
().
getMapper
(
DcDailySalesMapper
.
class
);
mapper
.
calculateSales
();
SessionUtil
.
getSession
().
commit
();
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment