From 7aad06fedc12f0183734088fa44c929ac6ff42b3 Mon Sep 17 00:00:00 2001
From: yuan <123@>
Date: 星期六, 10 十月 2026 11:54:01 +0800
Subject: [PATCH] feat: 增加多个查询的排序功能以优化数据检索
---
src/main/resources/mapper/production/ProductionProductOutputMapper.xml | 26 +++++++++++++++++++++++++-
1 files changed, 25 insertions(+), 1 deletions(-)
diff --git a/src/main/resources/mapper/production/ProductionProductOutputMapper.xml b/src/main/resources/mapper/production/ProductionProductOutputMapper.xml
index e5d17fc..931154f 100644
--- a/src/main/resources/mapper/production/ProductionProductOutputMapper.xml
+++ b/src/main/resources/mapper/production/ProductionProductOutputMapper.xml
@@ -24,7 +24,7 @@
and ppm.id = #{c.productMainId}
</if>
</where>
- order by ppo.id
+ order by ppo.id DESC
</select>
<delete id="deleteByProductMainIds" parameterType="java.util.List">
@@ -34,4 +34,28 @@
#{id}
</foreach>
</delete>
+ <select id="selectOutputStats" resultType="com.ruoyi.production.dto.ProductionProductOutputDto">
+ SELECT
+ create_time,
+ quantity,
+ scrap_qty
+ FROM
+ production_product_output
+ WHERE
+ create_time >= #{startDate}
+ AND create_time <= #{endDate}
+ </select>
+
+ <select id="selectDailyOutputStats" resultType="java.util.Map">
+ SELECT
+ DATE_FORMAT(create_time, '%Y-%m-%d') as date,
+ SUM(quantity-scrap_qty) as quantity
+ FROM
+ production_product_output
+ WHERE
+ create_time >= #{startDate}
+ AND create_time <= #{endDate}
+ GROUP BY
+ DATE_FORMAT(create_time, '%Y-%m-%d')
+ </select>
</mapper>
--
Gitblit v1.9.3