From 72cf5cdaef3be1e81da7f59d6ed61fe368f44816 Mon Sep 17 00:00:00 2001
From: cloudroam <cloudroam>
Date: 星期三, 08 一月 2025 14:48:46 +0800
Subject: [PATCH] add:物流发货针对散户更改微信发货方式,保存物流单号,未发送之前可更改
---
src/main/resources/mapper/wallet/WalletBillRecordMapper.xml | 105 +++++++++++++++++++++++++++++++++-------------------
1 files changed, 66 insertions(+), 39 deletions(-)
diff --git a/src/main/resources/mapper/wallet/WalletBillRecordMapper.xml b/src/main/resources/mapper/wallet/WalletBillRecordMapper.xml
index a38744c..088d280 100644
--- a/src/main/resources/mapper/wallet/WalletBillRecordMapper.xml
+++ b/src/main/resources/mapper/wallet/WalletBillRecordMapper.xml
@@ -13,6 +13,9 @@
<result column="supplier_id" property="supplierId" />
<result column="wallet_id" property="walletId" />
<result column="type" property="type" />
+
+ <result column="withdraw_type" property="withdrawType" />
+
<result column="type_detail" property="typeDetail" />
<result column="transfer_id" property="transferId" />
<result column="method" property="method" />
@@ -22,53 +25,86 @@
<result column="transfer_detail_id" property="transferDetailId" />
<result column="open_id" property="openId" />
</resultMap>
+ <select id="getPage" resultType="com.mzl.flower.dto.response.wallet.WalletBillRecordVO">
+ select wbr.*, u.nick_name AS approveName
+ from t_wallet_bill_record wbr
+ LEFT JOIN t_user u ON wbr.approve_by = u.id
+ where wbr.DELETED=0
+ <if test="dto.supplierId != null and dto.supplierId != ''">
+ and wbr.supplier_id= #{dto.supplierId}
+ </if>
+ <if test="dto.startDate != null">
+ and DATE_FORMAT(wbr.create_time, '%Y-%m-%d') >= #{dto.startDate}
+ </if>
+ <if test="dto.endDate != null">
+ and DATE_FORMAT(wbr.create_time, '%Y-%m-%d') <= #{dto.endDate}
+ </if>
+ order by wbr.create_time asc
+ </select>
+
+ <select id="getPageByDesc" resultType="com.mzl.flower.dto.response.wallet.WalletBillRecordVO">
+ select wbr.*, u.nick_name AS approveName
+ from t_wallet_bill_record wbr
+ LEFT JOIN t_user u ON wbr.approve_by = u.id
+ where wbr.DELETED=0
+ <if test="dto.supplierId != null and dto.supplierId != ''">
+ and wbr.supplier_id= #{dto.supplierId}
+ </if>
+ <if test="dto.startDate != null">
+ and DATE_FORMAT(wbr.create_time, '%Y-%m-%d') >= #{dto.startDate}
+ </if>
+ <if test="dto.endDate != null">
+ and DATE_FORMAT(wbr.create_time, '%Y-%m-%d') <= #{dto.endDate}
+ </if>
+ order by wbr.create_time desc
+ </select>
<select id="queryPage" resultType="com.mzl.flower.dto.response.wallet.WalletBillRecordVO">
- select t.* ,s.name supplierName from t_wallet_bill_record t
- left join t_supplier_info s on t.supplier_id = s.id
- left join t_order o on t.order_id = o.id
- left join t_wallet_withdraw_record w on t.withdraw_record_id = w.id
- where t.deleted= 0
+-- select t.* ,s.name supplierName ,w.approve_time as approveTime ,u.nick_name AS approveName from t_wallet_bill_record t
+-- left join t_supplier_info s on t.supplier_id = s.id
+-- left join t_wallet_withdraw_record w on t.withdraw_record_id = w.id
+-- LEFT JOIN t_user u ON t.approve_by = u.id
+-- where t.deleted= 0
+ SELECT
+ t.*,
+ (SELECT s.name FROM t_supplier_info s WHERE s.id = t.supplier_id) AS supplierName,
+ (SELECT w.approve_time FROM t_wallet_withdraw_record w WHERE w.id = t.withdraw_record_id) AS approveTime,
+ (SELECT u.nick_name FROM t_user u WHERE u.id = t.approve_by) AS approveName
+ FROM
+ t_wallet_bill_record t
+ WHERE
+ t.deleted = 0
<if test="dto.supplierName != null and dto.supplierName != ''">
- and s.name like concat('%', #{dto.supplierName}, '%')
+ AND (SELECT s.name FROM t_supplier_info s WHERE s.id = t.supplier_id) LIKE CONCAT('%', #{dto.supplierName}, '%')
</if>
<if test="dto.supplierId != null and dto.supplierId != ''">
and t.supplier_id = #{dto.supplierId}
</if>
<if test="dto.type != null and dto.type != ''">
- and t.type = #{type}
+ and t.type = #{dto.type}
</if>
<if test="dto.orderNo != null and dto.orderNo != ''">
- and o.order_no = like concat('%', #{orderNo}, '%')
+ and t.order_no like concat('%', #{dto.orderNo}, '%')
</if>
<if test="dto.createStartDate!=null ">
- <![CDATA[
- AND w.create_time >= #{dto.createStartDate}
- ]]>
+ AND DATE_FORMAT(t.create_time, '%Y-%m-%d') >= #{dto.createStartDate}
</if>
<if test="dto.endEndDate!=null ">
- <![CDATA[
- AND w.create_time <= #{dto.endEndDate}
- ]]>
+ AND DATE_FORMAT(t.create_time, '%Y-%m-%d') <= #{dto.endEndDate}
</if>
<if test="dto.approveStartDate!=null ">
- <![CDATA[
- AND w.approve_time >= #{dto.approveStartDate}
- ]]>
+ AND DATE_FORMAT((SELECT w.approve_time FROM t_wallet_withdraw_record w WHERE w.id = t.withdraw_record_id), '%Y-%m-%d') >= #{dto.approveStartDate}
</if>
<if test="dto.approveEndDate!=null ">
- <![CDATA[
- AND w.approve_time <= #{dto.approveStartDate}
- ]]>
+ AND DATE_FORMAT((SELECT w.approve_time FROM t_wallet_withdraw_record w WHERE w.id = t.withdraw_record_id), '%Y-%m-%d') <= #{dto.approveEndDate}
</if>
-
- order by t.create_time
+ order by t.create_time desc
</select>
<select id="queryWalletBillRecordList" resultType="com.mzl.flower.dto.response.wallet.WalletBillRecordVO">
- select t.* ,s.name supplierName from t_wallet_bill_record t
+ select t.* , s.name supplierName, w.approve_time as approveTime, u.nick_name AS approveName from t_wallet_bill_record t
left join t_supplier_info s on t.supplier_id = s.id
- left join t_order o on t.order_id = o.id
left join t_wallet_withdraw_record w on t.withdraw_record_id = w.id
+ LEFT JOIN t_user u ON t.approve_by = u.id
where t.deleted= 0
<if test="dto.supplierName != null and dto.supplierName != ''">
and s.name like concat('%', #{dto.supplierName}, '%')
@@ -77,32 +113,23 @@
and t.supplier_id = #{dto.supplierId}
</if>
<if test="dto.type != null and dto.type != ''">
- and t.type = #{type}
+ and t.type = #{dto.type}
</if>
<if test="dto.orderNo != null and dto.orderNo != ''">
- and o.order_no = like concat('%', #{orderNo}, '%')
+ and t.order_no like concat('%', #{dto.orderNo}, '%')
</if>
<if test="dto.createStartDate!=null ">
- <![CDATA[
- AND w.create_time >= #{dto.createStartDate}
- ]]>
+ AND DATE_FORMAT(t.create_time, '%Y-%m-%d') >= #{dto.createStartDate}
</if>
<if test="dto.endEndDate!=null ">
- <![CDATA[
- AND w.create_time <= #{dto.endEndDate}
- ]]>
+ AND DATE_FORMAT(t.create_time, '%Y-%m-%d') <= #{dto.endEndDate}
</if>
<if test="dto.approveStartDate!=null ">
- <![CDATA[
- AND w.approve_time >= #{dto.approveStartDate}
- ]]>
+ AND DATE_FORMAT(w.approve_time, '%Y-%m-%d') >= #{dto.approveStartDate}
</if>
<if test="dto.approveEndDate!=null ">
- <![CDATA[
- AND w.approve_time <= #{dto.approveStartDate}
- ]]>
+ AND DATE_FORMAT(w.approve_time, '%Y-%m-%d') <= #{dto.approveEndDate}
</if>
-
order by t.create_time
</select>
</mapper>
--
Gitblit v1.9.3