|
@@ -9,4 +9,39 @@
|
|
|
文档可见:https://www.zhongxing.cn/MyBatis/x-plugins/
|
|
|
-->
|
|
|
|
|
|
+ <select id="ptTopUpWithUserTopUpList"
|
|
|
+ resultType="cn.newfeifan.mall.module.distri.controller.admin.consumptiontopuplog.vo.TopUpRespVO">
|
|
|
+ SELECT
|
|
|
+ DATE(combined.date) AS date,
|
|
|
+ SUM(combined.conut) AS consumptionPoints
|
|
|
+ FROM (
|
|
|
+ SELECT
|
|
|
+ DATE(create_time) AS date,
|
|
|
+ sum(consumption_points) AS conut
|
|
|
+ FROM distri_consumption_top_up_log GROUP BY date(create_time)
|
|
|
+ UNION ALL
|
|
|
+ SELECT
|
|
|
+ DATE(create_time) AS create_time,
|
|
|
+ sum(top_up_consumption_points) AS conut
|
|
|
+ FROM distri_user_top_up_consumption_points_order GROUP BY date(create_time)
|
|
|
+ ) AS combined
|
|
|
+ GROUP BY DATE(combined.date)
|
|
|
+ HAVING SUM(combined.conut) > 0
|
|
|
+ ORDER BY date
|
|
|
+
|
|
|
+ </select>
|
|
|
+ <select id="getTotalConsumptionPoints" resultType="java.lang.Long">
|
|
|
+ SELECT
|
|
|
+ SUM(consumption_points) total
|
|
|
+ FROM
|
|
|
+ (SELECT
|
|
|
+ consumption_points
|
|
|
+ FROM
|
|
|
+ distri_consumption_top_up_log
|
|
|
+ UNION ALL
|
|
|
+ SELECT
|
|
|
+ top_up_consumption_points AS consumption_points
|
|
|
+ FROM
|
|
|
+ distri_user_top_up_consumption_points_order) AS combined;
|
|
|
+ </select>
|
|
|
</mapper>
|