From 9ca97fd558700e7054c5f54192a9db7a1e6b8230 Mon Sep 17 00:00:00 2001
From: xuhy <3313886187@qq.com>
Date: 星期三, 11 九月 2024 16:31:47 +0800
Subject: [PATCH] 完善导出等接口

---
 ruoyi-system/src/main/resources/mapper/system/TOrderSaleMapper.xml |   34 +++++++++++++++++++++++++++++++++-
 1 files changed, 33 insertions(+), 1 deletions(-)

diff --git a/ruoyi-system/src/main/resources/mapper/system/TOrderSaleMapper.xml b/ruoyi-system/src/main/resources/mapper/system/TOrderSaleMapper.xml
index db02481..7c615fa 100644
--- a/ruoyi-system/src/main/resources/mapper/system/TOrderSaleMapper.xml
+++ b/ruoyi-system/src/main/resources/mapper/system/TOrderSaleMapper.xml
@@ -133,7 +133,7 @@
             AND disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()}
         </where>
     </select>
-    <select id="getDataGeneratorMealDetail" resultType="java.util.Map">
+    <select id="getDataGeneratorSaleDetail" resultType="java.util.Map">
         SELECT
        IFNULL(SUM(CASE WHEN payType = 1 THEN payMoney ELSE 0 END),0) AS moneyPay,
        IFNULL(SUM(CASE WHEN payType = 2 THEN payMoney ELSE 0 END),0) AS aliPay,
@@ -177,5 +177,37 @@
         </where>
         ORDER BY orderTime DESC
     </select>
+    <select id="saleGeneratorListExport" resultType="com.ruoyi.system.vo.TDataGeneratorVO">
+        select tdg.id, tdg.userId, tdg.userName, tdg.shopId, tdg.startTime, tdg.endTime, tdg.minMoney, tdg.maxMoney, tdg.status, tdg.createTime,
+        tdg.updateTime, tdg.disabled, tdg.createBy, tdg.updateBy,tdg.orderType,tdg.weiXinPay,tdg.aliPay,tdg.cardPay,tdg.moneyPay,tdg.otherPay,
+        ts.shopName
+        from t_data_generator tdg
+        left join t_shop ts on tdg.shopId = ts.id
+        <where>
+            <if test="query.shopName != null and query.shopName != ''">
+                and ts.shopName like concat('%', #{query.shopName}, '%')
+            </if>
+            <if test="query.userName != null and query.userName != ''">
+                and tdg.shopName like concat('%', #{query.userName}, '%')
+            </if>
+            <if test="query.status != null">
+                and tdg.status = #{query.status}
+            </if>
+            <if test="query.ids != null and query.ids.size()>0">
+                and tdg.id IN
+                <foreach collection="query.ids" item="id" open="(" separator="," close=")">
+                    #{id}
+                </foreach>
+            </if>
+            <if test="query.orderType != null">
+                and tdg.orderType = #{query.orderType}
+            </if>
+            <if test="query.startTime != null and query.startTime != '' and query.endTime != null and query.endTime != ''">
+                AND (tdg.createTime BETWEEN #{query.startTime} AND #{query.endTime})
+            </if>
+            AND tdg.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()}
+            and tdg.orderType = 2
+        </where>
+    </select>
 
 </mapper>

--
Gitblit v1.7.1