|
@@ -152,14 +152,16 @@
|
|
AND vto.tenant_id = #{tenantId}
|
|
AND vto.tenant_id = #{tenantId}
|
|
</if>
|
|
</if>
|
|
<if test="refundStartTime != null or refundEndTime != null">
|
|
<if test="refundStartTime != null or refundEndTime != null">
|
|
- AND (SELECT COUNT(*)
|
|
|
|
- FROM top_old_order_refund tor
|
|
|
|
|
|
+ AND (
|
|
|
|
+ SELECT COUNT(*)
|
|
|
|
+ FROM
|
|
|
|
+ (SELECT order_sn,pay_check_time AS refund_time,`status` FROM top_old_order_refund UNION ALL SELECT order_sn,refund_time,`status` AS refund_time FROM order_goods_refund ) tor
|
|
WHERE vto.order_sn = tor.order_sn AND tor.`status` = 1
|
|
WHERE vto.order_sn = tor.order_sn AND tor.`status` = 1
|
|
<if test="refundStartTime != null and refundStartTime != ''">
|
|
<if test="refundStartTime != null and refundStartTime != ''">
|
|
- AND tor.pay_check_time >= #{refundStartTime}
|
|
|
|
|
|
+ AND tor.refund_time >= #{refundStartTime}
|
|
</if>
|
|
</if>
|
|
<if test="refundEndTime != null and refundEndTime != ''">
|
|
<if test="refundEndTime != null and refundEndTime != ''">
|
|
- AND tor.pay_check_time <= #{refundEndTime}
|
|
|
|
|
|
+ AND tor.refund_time <= #{refundEndTime}
|
|
</if>
|
|
</if>
|
|
) > 0
|
|
) > 0
|
|
</if>
|
|
</if>
|
|
@@ -339,13 +341,13 @@
|
|
</if>
|
|
</if>
|
|
<if test="refundStartTime != null or refundEndTime != null">
|
|
<if test="refundStartTime != null or refundEndTime != null">
|
|
AND (SELECT COUNT(*)
|
|
AND (SELECT COUNT(*)
|
|
- FROM top_old_order_refund tor
|
|
|
|
|
|
+ FROM order_goods_refund tor
|
|
WHERE o.order_sn = tor.order_sn AND tor.`status` = 1
|
|
WHERE o.order_sn = tor.order_sn AND tor.`status` = 1
|
|
<if test="refundStartTime != null and refundStartTime != ''">
|
|
<if test="refundStartTime != null and refundStartTime != ''">
|
|
- AND tor.pay_check_time >= #{refundStartTime}
|
|
|
|
|
|
+ AND tor.refund_time >= #{refundStartTime}
|
|
</if>
|
|
</if>
|
|
<if test="refundEndTime != null and refundEndTime != ''">
|
|
<if test="refundEndTime != null and refundEndTime != ''">
|
|
- AND tor.pay_check_time <= #{refundEndTime}
|
|
|
|
|
|
+ AND tor.refund_time <= #{refundEndTime}
|
|
</if>
|
|
</if>
|
|
) > 0
|
|
) > 0
|
|
</if>
|
|
</if>
|
|
@@ -709,7 +711,7 @@
|
|
FROM
|
|
FROM
|
|
(
|
|
(
|
|
SELECT
|
|
SELECT
|
|
- SUM( too.order_received - too.order_refunded ) AS money,
|
|
|
|
|
|
+ SUM( too.order_price ) AS money,
|
|
too.old_customer_id AS customer_id,
|
|
too.old_customer_id AS customer_id,
|
|
(
|
|
(
|
|
SELECT
|
|
SELECT
|
|
@@ -799,7 +801,7 @@
|
|
SELECT
|
|
SELECT
|
|
(
|
|
(
|
|
SELECT
|
|
SELECT
|
|
- SUM( too.order_received - too.order_refunded ) AS money
|
|
|
|
|
|
+ SUM( too.order_price ) AS money
|
|
FROM
|
|
FROM
|
|
top_old_order too
|
|
top_old_order too
|
|
WHERE
|
|
WHERE
|
|
@@ -963,7 +965,7 @@
|
|
SELECT
|
|
SELECT
|
|
((
|
|
((
|
|
SELECT
|
|
SELECT
|
|
- IFNULL(SUM( too.order_received - too.order_refunded ),0) AS money
|
|
|
|
|
|
+ IFNULL(SUM( too.order_price),0) AS money
|
|
FROM
|
|
FROM
|
|
top_old_order too
|
|
top_old_order too
|
|
WHERE
|
|
WHERE
|
|
@@ -1164,7 +1166,7 @@
|
|
SELECT
|
|
SELECT
|
|
1 AS orderType,
|
|
1 AS orderType,
|
|
COUNT(too.order_id) AS orderNum,
|
|
COUNT(too.order_id) AS orderNum,
|
|
- SUM( too.order_received - too.order_refunded ) AS money,
|
|
|
|
|
|
+ SUM( too.order_price ) AS money,
|
|
too.old_customer_id AS customer_id,
|
|
too.old_customer_id AS customer_id,
|
|
(
|
|
(
|
|
SELECT
|
|
SELECT
|
|
@@ -1263,7 +1265,7 @@
|
|
(
|
|
(
|
|
SELECT
|
|
SELECT
|
|
tenant_id,
|
|
tenant_id,
|
|
- SUM( order_received - order_refunded ) money2
|
|
|
|
|
|
+ SUM( order_price ) money2
|
|
<if test="tenantId != null and tenantId != ''">
|
|
<if test="tenantId != null and tenantId != ''">
|
|
, create_sys_user_id,any_value(create_username) as create_username
|
|
, create_sys_user_id,any_value(create_username) as create_username
|
|
</if>
|
|
</if>
|
|
@@ -1339,7 +1341,7 @@
|
|
<select id="getSingleTenantStatistics" parameterType="com.zhongzheng.modules.top.order.bo.TopOrderStatisticsBo"
|
|
<select id="getSingleTenantStatistics" parameterType="com.zhongzheng.modules.top.order.bo.TopOrderStatisticsBo"
|
|
resultType="java.math.BigDecimal">
|
|
resultType="java.math.BigDecimal">
|
|
SELECT
|
|
SELECT
|
|
- (IFNULL(SUM( vo.order_received - vo.order_refunded ),0)+(
|
|
|
|
|
|
+ (IFNULL(SUM( vo.order_price ),0)+(
|
|
SELECT
|
|
SELECT
|
|
IFNULL(SUM( og.goods_received ),0)
|
|
IFNULL(SUM( og.goods_received ),0)
|
|
FROM
|
|
FROM
|
|
@@ -1694,7 +1696,7 @@
|
|
resultType="java.math.BigDecimal">
|
|
resultType="java.math.BigDecimal">
|
|
|
|
|
|
SELECT
|
|
SELECT
|
|
- IFNULL(SUM( too.order_received - too.order_refunded ),0)+ (
|
|
|
|
|
|
+ IFNULL(SUM( too.order_price ),0)+ (
|
|
SELECT
|
|
SELECT
|
|
IFNULL(SUM( og.goods_received ),0) AS money
|
|
IFNULL(SUM( og.goods_received ),0) AS money
|
|
FROM
|
|
FROM
|
|
@@ -1791,7 +1793,7 @@
|
|
(
|
|
(
|
|
SELECT
|
|
SELECT
|
|
ouu.business_name,
|
|
ouu.business_name,
|
|
- IFNULL( SUM( oo.order_received - oo.order_refunded ), 0 ) money
|
|
|
|
|
|
+ IFNULL( SUM( oo.order_price ), 0 ) money
|
|
FROM
|
|
FROM
|
|
(
|
|
(
|
|
SELECT
|
|
SELECT
|
|
@@ -2062,7 +2064,7 @@
|
|
(
|
|
(
|
|
SELECT
|
|
SELECT
|
|
ouu.business_name,
|
|
ouu.business_name,
|
|
- IFNULL( SUM( oo.order_received - oo.order_refunded ), 0 ) money
|
|
|
|
|
|
+ IFNULL( SUM( oo.order_price ), 0 ) money
|
|
FROM
|
|
FROM
|
|
(
|
|
(
|
|
SELECT
|
|
SELECT
|
|
@@ -2167,7 +2169,7 @@
|
|
SELECT
|
|
SELECT
|
|
tenant_id,
|
|
tenant_id,
|
|
1 AS order_type,
|
|
1 AS order_type,
|
|
- SUM( order_received - order_refunded ) money2,
|
|
|
|
|
|
+ SUM( order_price ) money2,
|
|
COUNT( * ) order_num2
|
|
COUNT( * ) order_num2
|
|
<if test="tenantId != null and tenantId != ''">
|
|
<if test="tenantId != null and tenantId != ''">
|
|
, create_sys_user_id,any_value(create_username) as create_username
|
|
, create_sys_user_id,any_value(create_username) as create_username
|
|
@@ -2295,7 +2297,7 @@
|
|
(
|
|
(
|
|
SELECT
|
|
SELECT
|
|
ouu.business_name,
|
|
ouu.business_name,
|
|
- IFNULL( SUM( oo.order_received - oo.order_refunded ), 0 ) money,
|
|
|
|
|
|
+ IFNULL( SUM( oo.order_price ), 0 ) money,
|
|
1 AS order_type,
|
|
1 AS order_type,
|
|
COUNT( * ) order_num
|
|
COUNT( * ) order_num
|
|
FROM
|
|
FROM
|