From 30df2d4293501bcfe255502f5e15f4d3b950cda4 Mon Sep 17 00:00:00 2001
From: 陶杰 <1378534974@qq.com>
Date: 星期二, 10 十二月 2024 15:38:09 +0800
Subject: [PATCH] 1.财务报表-部分统计字段新增
---
src/main/resources/mapper/payment/OrderMapper.xml | 45 +++++++++++++++++++++++++++++++++++++++------
1 files changed, 39 insertions(+), 6 deletions(-)
diff --git a/src/main/resources/mapper/payment/OrderMapper.xml b/src/main/resources/mapper/payment/OrderMapper.xml
index 6bd3e15..c806ff9 100644
--- a/src/main/resources/mapper/payment/OrderMapper.xml
+++ b/src/main/resources/mapper/payment/OrderMapper.xml
@@ -7,6 +7,7 @@
where status_backend = 'SEND' and partner_id is not null
</update>
+
<select id="getPartnerOrderReceive" resultType="com.mzl.flower.entity.payment.Order">
select * from t_order t where status_backend = 'SEND' and partner_id is not null
</select>
@@ -51,7 +52,7 @@
AND q.payment_time >= #{condition.createStartDate}
</if>
<if test="condition.createEndDate != null">
- AND q.payment_time <= #{condition.createEndDate}
+ AND q.payment_time < #{condition.createEndDate}
</if>
<if test="condition.partnerId != null">
AND q.partner_id = #{condition.partnerId}
@@ -93,6 +94,15 @@
<if test="condition.orderNo != null and condition.orderNo != ''">
AND q.order_no LIKE concat('%', #{condition.orderNo},'%')
</if>
+ <if test="condition.province != null and condition.province != ''">
+ AND q.customer_province LIKE concat('%', #{condition.province},'%')
+ </if>
+ <if test="condition.city != null and condition.city != ''">
+ AND q.customer_city LIKE concat('%', #{condition.city},'%')
+ </if>
+ <if test="condition.region != null and condition.region != ''">
+ AND q.customer_region LIKE concat('%', #{condition.region},'%')
+ </if>
<if test="condition.customerAddress != null and condition.customerAddress != ''">
AND q.customer_address LIKE concat('%', #{condition.customerAddress},'%')
</if>
@@ -131,7 +141,7 @@
AND q.payment_time >= #{condition.createStartDate}
</if>
<if test="condition.createEndDate != null">
- AND q.payment_time <= #{condition.createEndDate}
+ AND q.payment_time < #{condition.createEndDate}
</if>
<if test="condition.partnerId != null">
AND q.partner_id = #{condition.partnerId}
@@ -160,6 +170,9 @@
</if>
<if test="condition.warehouseLocationCode != null and condition.warehouseLocationCode != ''">
AND q.warehouse_location_code LIKE concat('%', #{condition.warehouseLocationCode},'%')
+ </if>
+ <if test="condition.createName != null and condition.createName != ''">
+ AND u.nick_name LIKE concat('%', #{condition.createName},'%')
</if>
ORDER BY q.create_time desc, q.payment_time desc
@@ -193,7 +206,7 @@
AND q.payment_time >= #{condition.createStartDate}
</if>
<if test="condition.createEndDate != null">
- AND q.payment_time <= #{condition.createEndDate}
+ AND q.payment_time < #{condition.createEndDate}
</if>
<!-- <if test="condition.createStartDate != null">-->
<!-- AND q.create_time >= #{condition.createStartDate}-->
@@ -331,7 +344,7 @@
AND q.payment_time >= #{condition.startDate}
</if>
<if test="condition.endDate != null">
- AND q.payment_time <= #{condition.endDate}
+ AND q.payment_time < #{condition.endDate}
</if>
<if test="condition.createStartDate != null">
AND q.create_time >= #{condition.createStartDate}
@@ -373,8 +386,8 @@
<select id="getOrderSaleAmount" resultType="java.math.BigDecimal">
SELECT sum(o.payment_amount)
FROM t_order o
- WHERE o.payment_time is not null
- and o.refund_time is null
+ WHERE o.deleted=0
+ and o.status_backend not in ('PENDING','CANCEL','REFUND')
<if test="startTime != null">
and o.create_time > #{startTime}
</if>
@@ -382,4 +395,24 @@
and o.create_time <= #{endTime}
</if>
</select>
+
+<!-- 获取所有的订单数据,以及时间数据-->
+ <select id="selectAllDateList" resultType="com.mzl.flower.entity.payment.Order">
+ SELECT t.id,t.payment_time,
+ CASE
+ WHEN t.payment_time > DATE(t.payment_time) + INTERVAL 17 HOUR THEN DATE(t.payment_time) + INTERVAL 1 DAY
+ ELSE DATE(t.payment_time)
+ END AS payment_date,
+ t.create_time,
+ CASE
+ WHEN t.create_time > DATE(t.create_time) + INTERVAL 17 HOUR THEN DATE(t.create_time) + INTERVAL 1 DAY
+ ELSE DATE(t.create_time)
+ END AS create_date
+ FROM t_order t
+ order by t.create_time desc
+ </select>
+
+ <update id="updatePaymentCreateDate">
+ update t_order set payment_date_sta=#{order.paymentDate}, create_date_sta=#{order.createDate} where id=#{order.id}
+ </update>
</mapper>
\ No newline at end of file
--
Gitblit v1.9.3