|
@@ -120,4 +120,51 @@
|
|
sum(if(status = 2 and confirm_status = 0,1,0)) as waitReceiptOrder
|
|
sum(if(status = 2 and confirm_status = 0,1,0)) as waitReceiptOrder
|
|
from oms_order
|
|
from oms_order
|
|
</select>
|
|
</select>
|
|
|
|
+
|
|
|
|
+ <select id="selectOrderCountAndAmount" resultType="com.yonge.cooleshow.admin.dto.OrderStatistical">
|
|
|
|
+
|
|
|
|
+ select
|
|
|
|
+ <choose>
|
|
|
|
+ <when test="dateFormat == 'DAY'">
|
|
|
|
+ date_format(create_time,'%Y-%m-%d') as date,
|
|
|
|
+ </when>
|
|
|
|
+ <when test="dateFormat == 'WEEK'">
|
|
|
|
+ YEARWEEK(date_format(create_time,'%Y-%m-%d'),7) as date,
|
|
|
|
+ </when>
|
|
|
|
+ <when test="dateFormat == 'MONTH'">
|
|
|
|
+ date_format(create_time,'%Y-%m') as date,
|
|
|
|
+ </when>
|
|
|
|
+ </choose>
|
|
|
|
+ count(1) as orderNum,
|
|
|
|
+ sum(pay_amount) as orderAmount
|
|
|
|
+ from oms_order
|
|
|
|
+ where status in (1,2,3) and create_time between #{startTime} and #{endTime}
|
|
|
|
+
|
|
|
|
+ group by
|
|
|
|
+
|
|
|
|
+ <choose>
|
|
|
|
+ <when test="dateFormat == 'DAY'">
|
|
|
|
+ date_format(create_time,'%Y-%m-%d')
|
|
|
|
+ </when>
|
|
|
|
+ <when test="dateFormat == 'WEEK'">
|
|
|
|
+ YEARWEEK(date_format(create_time,'%Y-%m-%d'),7)
|
|
|
|
+ </when>
|
|
|
|
+ <when test="dateFormat == 'MONTH'">
|
|
|
|
+ date_format(create_time,'%Y-%m')
|
|
|
|
+ </when>
|
|
|
|
+ </choose>
|
|
|
|
+
|
|
|
|
+ order by
|
|
|
|
+ <choose>
|
|
|
|
+ <when test="dateFormat == 'DAY'">
|
|
|
|
+ date_format(create_time,'%Y-%m-%d')
|
|
|
|
+ </when>
|
|
|
|
+ <when test="dateFormat == 'WEEK'">
|
|
|
|
+ YEARWEEK(date_format(create_time,'%Y-%m-%d'),7)
|
|
|
|
+ </when>
|
|
|
|
+ <when test="dateFormat == 'MONTH'">
|
|
|
|
+ date_format(create_time,'%Y-%m')
|
|
|
|
+ </when>
|
|
|
|
+ </choose>
|
|
|
|
+ </select>
|
|
</mapper>
|
|
</mapper>
|