Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cloud-platform
Project
Project
Details
Activity
Releases
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
youjj
cloud-platform
Commits
cf8431cf
Commit
cf8431cf
authored
Nov 29, 2019
by
libin
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'order_received_statistics' into dev
parents
0b989985
1fc7799a
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
108 additions
and
18 deletions
+108
-18
CompanyPerformanceFindDTO.java
...fc/platform/order/pojo/dto/CompanyPerformanceFindDTO.java
+2
-0
CompanyPerformanceBiz.java
...va/com/xxfc/platform/order/biz/CompanyPerformanceBiz.java
+1
-15
OrderReceivedStatisticsBiz.java
...m/xxfc/platform/order/biz/OrderReceivedStatisticsBiz.java
+18
-3
OrderReceivedStatisticsMapper.java
.../platform/order/mapper/OrderReceivedStatisticsMapper.java
+4
-0
OrderReceivedStatisticsMapper.xml
...c/main/resources/mapper/OrderReceivedStatisticsMapper.xml
+83
-0
No files found.
xx-order/xx-order-api/src/main/java/com/xxfc/platform/order/pojo/dto/CompanyPerformanceFindDTO.java
View file @
cf8431cf
...
@@ -32,6 +32,8 @@ public class CompanyPerformanceFindDTO extends PageParam {
...
@@ -32,6 +32,8 @@ public class CompanyPerformanceFindDTO extends PageParam {
private
String
companyName
;
private
String
companyName
;
private
Integer
companyId
;
private
Integer
companyId
;
private
String
groupFiled
;
private
long
startIndex
;
private
long
startIndex
;
private
long
endInex
;
private
long
endInex
;
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/CompanyPerformanceBiz.java
View file @
cf8431cf
...
@@ -208,21 +208,7 @@ public class CompanyPerformanceBiz {
...
@@ -208,21 +208,7 @@ public class CompanyPerformanceBiz {
pageDataVO
.
setData
(
companyPerformanceBos
);
pageDataVO
.
setData
(
companyPerformanceBos
);
if
(
companyPerformanceFindDTO
.
getPage
()
==
1
)
{
if
(
companyPerformanceFindDTO
.
getPage
()
==
1
)
{
Example
example
=
new
Example
(
OrderReceivedStatistics
.
class
);
int
totalCount
=
orderReceivedStatisticsBiz
.
selectCountByCondition
(
companyPerformanceFindDTO
);
Example
.
Criteria
criteria
=
example
.
createCriteria
();
if
(
Objects
.
nonNull
(
companyPerformanceFindDTO
.
getCompanyId
()))
{
criteria
.
andEqualTo
(
"companyId"
,
companyPerformanceFindDTO
.
getCompanyId
());
}
if
(
Objects
.
nonNull
(
companyPerformanceFindDTO
.
getStartDate
())
&&
Objects
.
nonNull
(
companyPerformanceFindDTO
.
getEndDate
())){
criteria
.
andBetween
(
"date"
,
companyPerformanceFindDTO
.
getStartDate
(),
companyPerformanceFindDTO
.
getEndDate
());
}
if
(
Objects
.
nonNull
(
companyPerformanceFindDTO
.
getStartDate
())
&&
Objects
.
isNull
(
companyPerformanceFindDTO
.
getEndDate
())){
criteria
.
andGreaterThanOrEqualTo
(
"date"
,
companyPerformanceFindDTO
.
getStartDate
());
}
if
(
Objects
.
isNull
(
companyPerformanceFindDTO
.
getStartDate
())
&&
Objects
.
nonNull
(
companyPerformanceFindDTO
.
getEndDate
())){
criteria
.
andLessThanOrEqualTo
(
"date"
,
companyPerformanceFindDTO
.
getEndDate
());
}
int
totalCount
=
orderReceivedStatisticsBiz
.
selectCountByExample
(
example
);
long
isZero
=
totalCount
%
companyPerformanceFindDTO
.
getLimit
();
long
isZero
=
totalCount
%
companyPerformanceFindDTO
.
getLimit
();
long
totalPage
=
isZero
==
0
?
totalCount
/
companyPerformanceFindDTO
.
getLimit
()
:
totalCount
/
companyPerformanceFindDTO
.
getLimit
()
+
1
;
long
totalPage
=
isZero
==
0
?
totalCount
/
companyPerformanceFindDTO
.
getLimit
()
:
totalCount
/
companyPerformanceFindDTO
.
getLimit
()
+
1
;
pageDataVO
.
setTotalCount
(
Long
.
valueOf
(
totalCount
));
pageDataVO
.
setTotalCount
(
Long
.
valueOf
(
totalCount
));
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/OrderReceivedStatisticsBiz.java
View file @
cf8431cf
...
@@ -70,7 +70,7 @@ public class OrderReceivedStatisticsBiz extends BaseBiz<OrderReceivedStatisticsM
...
@@ -70,7 +70,7 @@ public class OrderReceivedStatisticsBiz extends BaseBiz<OrderReceivedStatisticsM
public
List
<
CompanyPerformanceBo
>
selectCompanyPerformanceWithDay
(
CompanyPerformanceFindDTO
companyPerformanceFindDTO
)
{
public
List
<
CompanyPerformanceBo
>
selectCompanyPerformanceWithDay
(
CompanyPerformanceFindDTO
companyPerformanceFindDTO
)
{
List
<
CompanyPerformanceBo
>
companyPerformanceBos
=
mapper
.
selectCompanyPerformanceWithDay
(
companyPerformanceFindDTO
);
List
<
CompanyPerformanceBo
>
companyPerformanceBos
=
mapper
.
selectCompanyPerformanceWithDay
(
companyPerformanceFindDTO
);
return
CollectionUtils
.
isEmpty
(
companyPerformanceBos
)
?
Collections
.
EMPTY_LIST
:
companyPerformanceBos
;
return
CollectionUtils
.
isEmpty
(
companyPerformanceBos
)
?
Collections
.
EMPTY_LIST
:
companyPerformanceBos
;
}
}
/**
/**
...
@@ -90,8 +90,9 @@ public class OrderReceivedStatisticsBiz extends BaseBiz<OrderReceivedStatisticsM
...
@@ -90,8 +90,9 @@ public class OrderReceivedStatisticsBiz extends BaseBiz<OrderReceivedStatisticsM
public
List
<
CompanyPerformanceBo
>
selectCompanyPerformanceWithMonth
(
CompanyPerformanceFindDTO
companyPerformanceFindDTO
)
{
public
List
<
CompanyPerformanceBo
>
selectCompanyPerformanceWithMonth
(
CompanyPerformanceFindDTO
companyPerformanceFindDTO
)
{
List
<
CompanyPerformanceBo
>
companyPerformanceBos
=
mapper
.
selectCompanyPerformanceWithMonth
(
companyPerformanceFindDTO
);
List
<
CompanyPerformanceBo
>
companyPerformanceBos
=
mapper
.
selectCompanyPerformanceWithMonth
(
companyPerformanceFindDTO
);
return
CollectionUtils
.
isEmpty
(
companyPerformanceBos
)
?
Collections
.
EMPTY_LIST
:
companyPerformanceBos
;
return
CollectionUtils
.
isEmpty
(
companyPerformanceBos
)
?
Collections
.
EMPTY_LIST
:
companyPerformanceBos
;
}
}
/**
/**
* 公司业绩(按周统计)
* 公司业绩(按周统计)
*
*
...
@@ -109,8 +110,9 @@ public class OrderReceivedStatisticsBiz extends BaseBiz<OrderReceivedStatisticsM
...
@@ -109,8 +110,9 @@ public class OrderReceivedStatisticsBiz extends BaseBiz<OrderReceivedStatisticsM
public
List
<
CompanyPerformanceBo
>
selectCompanyPerformanceWithWeek
(
CompanyPerformanceFindDTO
companyPerformanceFindDTO
)
{
public
List
<
CompanyPerformanceBo
>
selectCompanyPerformanceWithWeek
(
CompanyPerformanceFindDTO
companyPerformanceFindDTO
)
{
List
<
CompanyPerformanceBo
>
companyPerformanceBos
=
mapper
.
selectCompanyPerformanceWithWeek
(
companyPerformanceFindDTO
);
List
<
CompanyPerformanceBo
>
companyPerformanceBos
=
mapper
.
selectCompanyPerformanceWithWeek
(
companyPerformanceFindDTO
);
return
CollectionUtils
.
isEmpty
(
companyPerformanceBos
)
?
Collections
.
EMPTY_LIST
:
companyPerformanceBos
;
return
CollectionUtils
.
isEmpty
(
companyPerformanceBos
)
?
Collections
.
EMPTY_LIST
:
companyPerformanceBos
;
}
}
/**
/**
* 订单统计数据导出
* 订单统计数据导出
*
*
...
@@ -406,6 +408,19 @@ public class OrderReceivedStatisticsBiz extends BaseBiz<OrderReceivedStatisticsM
...
@@ -406,6 +408,19 @@ public class OrderReceivedStatisticsBiz extends BaseBiz<OrderReceivedStatisticsM
return
mapper
.
selectOrderReceivedStatisticsList
(
orderReceivedStatisticsFindDTO
);
return
mapper
.
selectOrderReceivedStatisticsList
(
orderReceivedStatisticsFindDTO
);
}
}
public
int
selectCountByCondition
(
CompanyPerformanceFindDTO
companyPerformanceFindDTO
)
{
if
(
companyPerformanceFindDTO
.
getStatisticalWay
()
==
ReceivedStatisticsEnum
.
DAY
.
getWayCode
())
{
return
mapper
.
selectCountByDate
(
companyPerformanceFindDTO
);
}
if
(
companyPerformanceFindDTO
.
getStatisticalWay
()
==
ReceivedStatisticsEnum
.
MONTH
.
getWayCode
())
{
return
mapper
.
selectCountByMonth
(
companyPerformanceFindDTO
);
}
if
(
companyPerformanceFindDTO
.
getStatisticalWay
()
==
ReceivedStatisticsEnum
.
WEEK
.
getWayCode
())
{
return
mapper
.
selectCountByWeekOfYear
(
companyPerformanceFindDTO
);
}
return
0
;
}
/**
/**
* 取两个集合的交集
* 取两个集合的交集
*
*
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/mapper/OrderReceivedStatisticsMapper.java
View file @
cf8431cf
...
@@ -25,4 +25,8 @@ public interface OrderReceivedStatisticsMapper extends Mapper<OrderReceivedStati
...
@@ -25,4 +25,8 @@ public interface OrderReceivedStatisticsMapper extends Mapper<OrderReceivedStati
List
<
CompanyPerformanceBo
>
selectCompanyPerformanceWithMonth
(
CompanyPerformanceFindDTO
companyPerformanceFindDTO
);
List
<
CompanyPerformanceBo
>
selectCompanyPerformanceWithMonth
(
CompanyPerformanceFindDTO
companyPerformanceFindDTO
);
List
<
CompanyPerformanceBo
>
selectCompanyPerformanceWithWeek
(
CompanyPerformanceFindDTO
companyPerformanceFindDTO
);
List
<
CompanyPerformanceBo
>
selectCompanyPerformanceWithWeek
(
CompanyPerformanceFindDTO
companyPerformanceFindDTO
);
int
selectCountByDate
(
CompanyPerformanceFindDTO
companyPerformanceFindDTO
);
int
selectCountByMonth
(
CompanyPerformanceFindDTO
companyPerformanceFindDTO
);
int
selectCountByWeekOfYear
(
CompanyPerformanceFindDTO
companyPerformanceFindDTO
);
}
}
xx-order/xx-order-server/src/main/resources/mapper/OrderReceivedStatisticsMapper.xml
View file @
cf8431cf
...
@@ -309,4 +309,87 @@
...
@@ -309,4 +309,87 @@
<!-- order by ors.rentVehilceAmount desc,ors.memberAmount desc,ors.travelAmount desc,ors.depositAmount desc,ors.noDeductibleAmount desc ,rentDays desc,departureNum desc, arrivalNum desc-->
<!-- order by ors.rentVehilceAmount desc,ors.memberAmount desc,ors.travelAmount desc,ors.depositAmount desc,ors.noDeductibleAmount desc ,rentDays desc,departureNum desc, arrivalNum desc-->
</select>
</select>
<select
id=
"selectCountByDate"
resultType=
"int"
>
select count(*) from (SELECT `date` FROM `order_received_statistics` WHERE `has_pay`=1
<if
test=
"companyName!=null and companyName!=''"
>
AND `company_name` LIKE CONCAT('%',#{companyName},'%')
</if>
<if
test=
"companyId!=null"
>
AND `company_id`=#{companyId}
</if>
<if
test=
"startDate!=null and endDate!=null"
>
AND `date` BETWEEN #{startDate} AND #{endDate}
</if>
<if
test=
"startDate!=null and endDate==null"
>
AND
<![CDATA[
`date` >
= #{startDate}
]]>
</if>
<if
test=
"startDate==null and endDate!=null"
>
AND
<![CDATA[
`date` <= #{startDate}
]]>
</if>
GROUP BY
company_id,
`year`,
`date`
) as `ds`
</select>
<select
id=
"selectCountByMonth"
resultType=
"int"
>
select count(*) from (SELECT `month` FROM `order_received_statistics` WHERE `has_pay`=1
<if
test=
"companyName!=null and companyName!=''"
>
AND `company_name` LIKE CONCAT('%',#{companyName},'%')
</if>
<if
test=
"companyId!=null"
>
AND `company_id`=#{companyId}
</if>
<if
test=
"startDate!=null and endDate!=null"
>
AND `date` BETWEEN #{startDate} AND #{endDate}
</if>
<if
test=
"startDate!=null and endDate==null"
>
AND
<![CDATA[
`date` >
= #{startDate}
]]>
</if>
<if
test=
"startDate==null and endDate!=null"
>
AND
<![CDATA[
`date` <= #{startDate}
]]>
</if>
GROUP BY
company_id,
`year`,
`month`
) as `ds`
</select>
<select
id=
"selectCountByWeekOfYear"
resultType=
"int"
>
select count(*) from (SELECT `week_of_year` FROM `order_received_statistics` WHERE `has_pay`=1
<if
test=
"companyName!=null and companyName!=''"
>
AND `company_name` LIKE CONCAT('%',#{companyName},'%')
</if>
<if
test=
"companyId!=null"
>
AND `company_id`=#{companyId}
</if>
<if
test=
"startDate!=null and endDate!=null"
>
AND `date` BETWEEN #{startDate} AND #{endDate}
</if>
<if
test=
"startDate!=null and endDate==null"
>
AND
<![CDATA[
`date` >
= #{startDate}
]]>
</if>
<if
test=
"startDate==null and endDate!=null"
>
AND
<![CDATA[
`date` <= #{startDate}
]]>
</if>
GROUP BY
company_id,
`year`,
`week_of_year`
) as `ds`
</select>
</mapper>
</mapper>
\ No newline at end of file
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