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
70762c8b
Commit
70762c8b
authored
Sep 30, 2019
by
hanfeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改订单统计
parent
1575d73b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
40 deletions
+44
-40
DailyMembersOrderStatisticsMapper.xml
...in/resources/mapper/DailyMembersOrderStatisticsMapper.xml
+44
-40
No files found.
xx-order/xx-order-server/src/main/resources/mapper/DailyMembersOrderStatisticsMapper.xml
View file @
70762c8b
...
...
@@ -41,48 +41,52 @@
<select
id=
"getMemberOrderStatistics"
parameterType=
"com.xxfc.platform.order.pojo.OrderQuery"
resultMap=
"order"
>
SELECT
<if
test=
"type==2"
>
DATE_FORMAT(date( FROM_UNIXTIME( a.account_time / 1000 ) ),'%Y-%v') AS period,
</if>
<if
test=
"type==3"
>
DATE_FORMAT(date( FROM_UNIXTIME( a.account_time / 1000 ) ),'%Y-%m') AS period,
</if>
date( FROM_UNIXTIME( a.account_time / 1000 ) ) AS period,
count( a.id ) AS number,
SUM( a.account_amount ) AS amount,
d.member_level AS level
FROM
order_account a
LEFT JOIN base_order b ON a.order_id = b.id
LEFT JOIN order_member_detail d ON d.order_id = b.id
WHERE
a.account_status = 1
AND a.account_type = 101
AND b.type = 3
<if
test=
"startTime != null"
>
AND a.crt_time
>
= #{startTime}
</if>
<if
test=
"endTime != null"
>
AND a.crt_time
<
= #{endTime}
</if>
GROUP BY
<if
test=
"type==2"
>
DATE_FORMAT(date( FROM_UNIXTIME( a.account_time / 1000 ) ),'%Y-%v'),
</if>
<if
test=
"type==3"
>
DATE_FORMAT(date( FROM_UNIXTIME( a.account_time / 1000 ) ),'%Y-%m'),
</if>
SELECT
<if
test=
"type==2"
>
DATE_FORMAT(date( FROM_UNIXTIME( a.account_time / 1000 ) ),'%Y-%v') AS period,
</if>
<if
test=
"type==3"
>
DATE_FORMAT(date( FROM_UNIXTIME( a.account_time / 1000 ) ),'%Y-%m') AS period,
</if>
<if
test=
"type==1"
>
date( FROM_UNIXTIME( a.account_time / 1000 ) ) AS period,
</if>
count( a.id ) AS number,
SUM( a.account_amount ) AS amount,
d.member_level AS level
FROM
order_account a
LEFT JOIN base_order b ON a.order_id = b.id
LEFT JOIN order_member_detail d ON d.order_id = b.id
WHERE
a.account_status = 1
AND a.account_type = 101
AND b.type = 3
<if
test=
"startTime != null"
>
AND a.crt_time
>
= #{startTime}
</if>
<if
test=
"endTime != null"
>
AND a.crt_time
<
= #{endTime}
</if>
GROUP BY
<if
test=
"type==2"
>
DATE_FORMAT(date( FROM_UNIXTIME( a.account_time / 1000 ) ),'%Y-%v'),
</if>
<if
test=
"type==3"
>
DATE_FORMAT(date( FROM_UNIXTIME( a.account_time / 1000 ) ),'%Y-%m'),
</if>
date( FROM_UNIXTIME( a.account_time / 1000 ) ),
d.member_level
<if
test=
"type==1"
>
date( FROM_UNIXTIME( a.account_time / 1000 ) ),
</if>
d.member_level
</select>
<resultMap
id=
"order"
type=
"com.xxfc.platform.order.entity.MembersOrder"
>
<result
column=
"period"
property=
"period"
></result>
<collection
property=
"members"
ofType=
"com.xxfc.platform.order.pojo.Member"
>
<result
column=
"number"
property=
"number"
></result>
<result
column=
"amount"
property=
"amount"
></result>
<result
column=
"level"
property=
"level"
></result>
</collection>
<result
column=
"period"
property=
"period"
></result>
<collection
property=
"members"
ofType=
"com.xxfc.platform.order.pojo.Member"
>
<result
column=
"number"
property=
"number"
></result>
<result
column=
"amount"
property=
"amount"
></result>
<result
column=
"level"
property=
"level"
></result>
</collection>
</resultMap>
</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