From 7d7ac69a8af85ab9e67c1dc2c6f52b03d27669e4 Mon Sep 17 00:00:00 2001
From: cloudroam <cloudroam>
Date: 星期四, 26 十二月 2024 08:58:19 +0800
Subject: [PATCH] add:阿里云短信模板获取签名和模板信息
---
src/main/resources/mapper/payment/OrderMapper.xml | 193 +++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 190 insertions(+), 3 deletions(-)
diff --git a/src/main/resources/mapper/payment/OrderMapper.xml b/src/main/resources/mapper/payment/OrderMapper.xml
index 66cd365..08965d0 100644
--- a/src/main/resources/mapper/payment/OrderMapper.xml
+++ b/src/main/resources/mapper/payment/OrderMapper.xml
@@ -68,7 +68,7 @@
and (oi.status = 'reduce' or oi.status = 'abnormal')
)
and q.transfer_id is null
- and q.status in ('COLLECTION', 'SEND')
+ and q.status in ('COLLECTION', 'SEND','RECEIVE')
</if>
<if test="condition.billId != null and condition.billId != ''">
AND q.bill_id = #{condition.billId}
@@ -174,7 +174,7 @@
and (oi.status = 'reduce' or oi.status = 'abnormal')
)
and q.transfer_id is null
- and q.status in ('COLLECTION', 'SEND')
+ and q.status in ('COLLECTION', 'SEND','RECEIVE')
</if>
<if test="condition.billId != null and condition.billId != ''">
AND q.bill_id = #{condition.billId}
@@ -191,6 +191,33 @@
</if>
<if test="condition.createName != null and condition.createName != ''">
AND u.nick_name LIKE concat('%', #{condition.createName},'%')
+ </if>
+
+ <if test="condition.abnormalOrderStatus != null and condition.abnormalOrderStatus != '' and condition.abnormalOrderStatus == 'UN_PROCESSED'">
+ AND q.id in (
+ select oi.order_id
+ from t_order_item oi
+ left join t_order o
+ on oi.order_id=o.id
+ where oi.status in ('abnormal','reduce','lack','back')
+ and o.transfer_id is null
+ and o.status in ('COLLECTION','SEND','RECEIVE')
+ )
+ </if>
+
+ <if test="condition.abnormalOrderStatus != null and condition.abnormalOrderStatus != '' and condition.abnormalOrderStatus == 'PROCESSED'">
+ AND q.id in (
+ select order_id from t_order_item oi where oi.status in ('abnormal','reduce','lack','back')
+ )
+ and q.id not in(
+ select oi.order_id
+ from t_order_item oi
+ left join t_order o
+ on oi.order_id=o.id
+ where oi.status in ('abnormal','reduce','lack','back')
+ and o.transfer_id is null
+ and o.status in ('COLLECTION','SEND','RECEIVE')
+ )
</if>
ORDER BY q.create_time desc, q.payment_time desc
@@ -383,7 +410,7 @@
and (oi.status = 'reduce' or oi.status = 'abnormal')
)
and q.transfer_id is null
- and q.status in ('COLLECTION', 'SEND')
+ and q.status in ('COLLECTION', 'SEND','RECEIVE')
</if>
<if test="condition.billId != null and condition.billId != ''">
AND q.bill_id = #{condition.billId}
@@ -429,6 +456,166 @@
FROM t_order t
order by t.create_time desc
</select>
+ <select id="getAbnormalOrderStatusCount"
+ resultType="com.mzl.flower.dto.response.payment.OrderStatusCountDTO">
+ SELECT 'UN_PROCESSED' as value, count(1) orderCount
+ FROM t_order q
+ left join t_user u on q.create_by = u.id
+ WHERE q.deleted = 0
+ <include refid="getAbnormalOrderStatusCount_condition"></include>
+
+ AND q.id in (
+ select oi.order_id
+ from t_order_item oi
+ left join t_order o
+ on oi.order_id=o.id
+ where oi.status in ('abnormal','reduce','lack','back')
+ and o.transfer_id is null
+ and o.status in ('COLLECTION','SEND','RECEIVE')
+ )
+
+ union
+
+ SELECT 'PROCESSED' as value, count(1) orderCount
+ FROM t_order q
+ left join t_user u on q.create_by = u.id
+ WHERE q.deleted = 0
+ <include refid="getAbnormalOrderStatusCount_condition"></include>
+ AND q.id in (
+ select order_id from t_order_item oi where oi.status in ('abnormal','reduce','lack','back')
+ )
+ and q.id not in(
+ select oi.order_id
+ from t_order_item oi
+ left join t_order o
+ on oi.order_id=o.id
+ where oi.status in ('abnormal','reduce','lack','back')
+ and o.transfer_id is null
+ and o.status in ('COLLECTION','SEND','RECEIVE')
+ )
+
+ </select>
+
+ <select id="getAbnormalOrderStatusCount2"
+ resultType="com.mzl.flower.dto.response.payment.OrderStatusCountDTO">
+ SELECT 'UN_PROCESSED' as value, count(1) orderCount
+ FROM t_order q
+ left join t_user u on q.create_by = u.id
+ WHERE q.deleted = 0
+ <include refid="getAbnormalOrderStatusCount_condition"></include>
+
+ AND exists(
+ select 1 from t_order_item oi
+ where oi.order_id = q.id
+ and oi.status in ('abnormal','reduce','lack','back')
+ )
+ and q.transfer_id is null
+ and q.status in ('COLLECTION', 'SEND','RECEIVE')
+
+ union
+
+ SELECT 'PROCESSED' as value, count(1) orderCount
+ FROM t_order q
+ left join t_user u on q.create_by = u.id
+ WHERE q.deleted = 0
+ <include refid="getAbnormalOrderStatusCount_condition"></include>
+ AND exists(
+ select 1 from t_order_item oi
+ where oi.order_id = q.id
+ and oi.status in ('abnormal','reduce','lack','back')
+ )
+ AND not exists(
+ select 1 from t_order_item oi
+ where oi.order_id = q.id
+ and oi.status in ('abnormal','reduce','lack','back')
+ and q.transfer_id is null
+ and q.status in ('COLLECTION', 'SEND','RECEIVE')
+ )
+
+ </select>
+
+ <sql id="getAbnormalOrderStatusCount_condition">
+ <if test="condition.orderNo != null and condition.orderNo != ''">
+ AND q.order_no LIKE concat('%', #{condition.orderNo},'%')
+ </if>
+ <if test="condition.customerAddress != null and condition.customerAddress != ''">
+ AND q.customer_address LIKE concat('%', #{condition.customerAddress},'%')
+ </if>
+ <if test="condition.customer != null and condition.customer != ''">
+ AND (q.customer LIKE concat('%', #{condition.customer},'%')
+ or q.customer_tel LIKE concat('%', #{condition.customer},'%')
+ )
+ </if>
+ <if test="condition.createBy != null and condition.createBy != ''">
+ AND q.create_by = #{condition.createBy}
+ </if>
+ <if test="condition.status != null and condition.status != ''">
+ AND q.status = #{condition.status}
+ </if>
+ <if test="condition.statusBackend != null and condition.statusBackend != ''">
+ AND q.status_backend = #{condition.statusBackend}
+ </if>
+ <!-- <if test="condition.startDate != null">-->
+ <!-- AND q.payment_time >= #{condition.startDate}-->
+ <!-- </if>-->
+ <!-- <if test="condition.endDate != null">-->
+ <!-- AND q.payment_time <= #{condition.endDate}-->
+ <!-- </if>-->
+ <!-- <if test="condition.createStartDate != null">-->
+ <!-- AND q.create_time >= #{condition.createStartDate}-->
+ <!-- </if>-->
+ <!-- <if test="condition.createEndDate != null">-->
+ <!-- AND q.create_time <= #{condition.createEndDate}-->
+ <!-- </if>-->
+ <if test="condition.createStartDate != null">
+ AND q.payment_time >= #{condition.createStartDate}
+ </if>
+ <if test="condition.createEndDate != null">
+ AND q.payment_time < #{condition.createEndDate}
+ </if>
+ <if test="condition.partnerId != null">
+ AND q.partner_id = #{condition.partnerId}
+ </if>
+ <if test="condition.partnerName != null and condition.partnerName != ''">
+ AND q.partner_name LIKE concat('%', #{condition.partnerName},'%')
+ </if>
+<!-- <if test="condition.levelDown != null and condition.levelDown != ''">-->
+<!-- AND exists(-->
+<!-- select 1 from t_order_item oi-->
+<!-- where oi.order_id = q.id-->
+<!-- and (oi.status = 'reduce' or oi.status = 'abnormal')-->
+<!-- )-->
+<!-- and q.transfer_id is null-->
+<!-- and q.status in ('COLLECTION', 'SEND','RECEIVE')-->
+<!-- </if>-->
+ <if test="condition.billId != null and condition.billId != ''">
+ AND q.bill_id = #{condition.billId}
+ </if>
+ <if test="condition.flowerName != null and condition.flowerName != ''">
+ AND exists(
+ select 1 from t_order_item oi
+ where oi.order_id = q.id
+ and oi.flower_name LIKE concat('%', #{condition.flowerName},'%')
+ )
+ </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>
+ <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>
+ </sql>
+
<update id="updatePaymentCreateDate">
update t_order set payment_date_sta=#{order.paymentDate}, create_date_sta=#{order.createDate} where id=#{order.id}
--
Gitblit v1.9.3