forked from wangziqi/ruoyi-vue-pro
feat(education): complete Flyway migration and atomic submit
This commit is contained in:
@@ -40,7 +40,7 @@
|
||||
|
||||
<select id="selectListByCreateTimeBetween"
|
||||
resultType="cn.iocoder.yudao.module.statistics.controller.admin.member.vo.MemberRegisterCountRespVO">
|
||||
SELECT DATE_FORMAT(create_time, '%Y-%m-%d') AS date,
|
||||
SELECT TO_CHAR(create_time, 'YYYY-MM-DD') AS date,
|
||||
count(1) AS count
|
||||
FROM member_user
|
||||
WHERE create_time BETWEEN #{beginTime} AND #{endTime}
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
</select>
|
||||
|
||||
<select id="selectRechargePriceSummary" resultType="java.lang.Integer">
|
||||
SELECT IFNULL(SUM(pay_price), 0)
|
||||
SELECT COALESCE(SUM(pay_price), 0)
|
||||
FROM pay_wallet_recharge
|
||||
WHERE pay_status = #{payStatus}
|
||||
AND deleted = FALSE
|
||||
|
||||
@@ -26,32 +26,32 @@
|
||||
WHERE spu_id = spu.id
|
||||
AND create_time BETWEEN #{beginTime} AND #{endTime}) AS cart_count
|
||||
-- 下单件数
|
||||
, (SELECT IFNULL(SUM(count), 0)
|
||||
, (SELECT COALESCE(SUM(count), 0)
|
||||
FROM trade_order_item
|
||||
WHERE spu_id = spu.id
|
||||
AND create_time BETWEEN #{beginTime} AND #{endTime}) AS order_count
|
||||
-- 支付件数
|
||||
, (SELECT IFNULL(SUM(item.count), 0)
|
||||
, (SELECT COALESCE(SUM(item.count), 0)
|
||||
FROM trade_order_item item
|
||||
JOIN trade_order o ON item.order_id = o.id
|
||||
WHERE spu_id = spu.id
|
||||
AND o.pay_status = TRUE
|
||||
AND item.create_time BETWEEN #{beginTime} AND #{endTime}) AS order_pay_count
|
||||
-- 支付金额
|
||||
, (SELECT IFNULL(SUM(item.pay_price), 0)
|
||||
, (SELECT COALESCE(SUM(item.pay_price), 0)
|
||||
FROM trade_order_item item
|
||||
JOIN trade_order o ON item.order_id = o.id
|
||||
WHERE spu_id = spu.id
|
||||
AND o.pay_status = TRUE
|
||||
AND item.create_time BETWEEN #{beginTime} AND #{endTime}) AS order_pay_price
|
||||
-- 退款件数
|
||||
, (SELECT IFNULL(SUM(count), 0)
|
||||
, (SELECT COALESCE(SUM(count), 0)
|
||||
FROM trade_after_sale
|
||||
WHERE spu_id = spu.id
|
||||
AND refund_time IS NOT NULL
|
||||
AND create_time BETWEEN #{beginTime} AND #{endTime}) AS after_sale_count
|
||||
-- 退款金额
|
||||
, (SELECT IFNULL(SUM(refund_price), 0)
|
||||
, (SELECT COALESCE(SUM(refund_price), 0)
|
||||
FROM trade_after_sale
|
||||
WHERE spu_id = spu.id
|
||||
AND refund_time IS NOT NULL
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
|
||||
<select id="selectListByPayTimeBetweenAndGroupByDay"
|
||||
resultType="cn.iocoder.yudao.module.statistics.controller.admin.trade.vo.TradeOrderTrendRespVO">
|
||||
SELECT DATE_FORMAT(pay_time, '%Y-%m-%d') AS date,
|
||||
SELECT TO_CHAR(pay_time, 'YYYY-MM-DD') AS date,
|
||||
COUNT(1) AS orderPayCount,
|
||||
SUM(pay_price) AS orderPayPrice
|
||||
FROM trade_order
|
||||
@@ -75,7 +75,7 @@
|
||||
|
||||
<select id="selectListByPayTimeBetweenAndGroupByMonth"
|
||||
resultType="cn.iocoder.yudao.module.statistics.controller.admin.trade.vo.TradeOrderTrendRespVO">
|
||||
SELECT DATE_FORMAT(pay_time, '%Y-%m') AS date,
|
||||
SELECT TO_CHAR(pay_time, 'YYYY-MM') AS date,
|
||||
COUNT(1) AS order_pay_count,
|
||||
SUM(pay_price) AS order_pay_price
|
||||
FROM trade_order
|
||||
@@ -95,7 +95,7 @@
|
||||
|
||||
<select id="selectPaySummaryByPayStatusAndPayTimeBetween"
|
||||
resultType="cn.iocoder.yudao.module.statistics.controller.admin.trade.vo.TradeOrderSummaryRespVO">
|
||||
SELECT IFNULL(SUM(pay_price), 0) AS order_pay_price,
|
||||
SELECT COALESCE(SUM(pay_price), 0) AS order_pay_price,
|
||||
COUNT(1) AS order_pay_count
|
||||
FROM trade_order
|
||||
WHERE pay_status = #{payStatus}
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
|
||||
<select id="selectOrderCreateCountSumAndOrderPayPriceSumByTimeBetween"
|
||||
resultType="cn.iocoder.yudao.module.statistics.service.trade.bo.TradeSummaryRespBO">
|
||||
SELECT IFNULL(SUM(order_create_count), 0) AS count,
|
||||
IFNULL(SUM(order_pay_price), 0) AS summary
|
||||
SELECT COALESCE(SUM(order_create_count), 0) AS count,
|
||||
COALESCE(SUM(order_pay_price), 0) AS summary
|
||||
FROM trade_statistics
|
||||
WHERE time BETWEEN #{beginTime} AND #{endTime}
|
||||
AND deleted = FALSE
|
||||
|
||||
Reference in New Issue
Block a user