From b277bf442b58ad5084aeedf213be3f7b8b35c259 Mon Sep 17 00:00:00 2001
From: Fancy <Fancy.fx@outlook.com>
Date: 星期二, 20 八月 2024 17:30:16 +0800
Subject: [PATCH] order manage
---
pms-parent/pms-global/src/main/resources/mapper/PrOrderItemMapper.xml | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/pms-parent/pms-global/src/main/resources/mapper/PrOrderItemMapper.xml b/pms-parent/pms-global/src/main/resources/mapper/PrOrderItemMapper.xml
index 7d632da..7d32d8b 100644
--- a/pms-parent/pms-global/src/main/resources/mapper/PrOrderItemMapper.xml
+++ b/pms-parent/pms-global/src/main/resources/mapper/PrOrderItemMapper.xml
@@ -25,11 +25,13 @@
where id = #{id,jdbcType=BIGINT}
</select>
<select id="selectItems" parameterType="java.lang.Long" resultMap="BaseResultMap">
- <!--绠楀嚭瀹屾垚鐜�-->
- select
- <include refid="Base_Column_List" />
- from pr_order_item
- where order_id = #{orderId,jdbcType=BIGINT} and deleted !=1
+ <!--绠楀嚭瀹屾垚鐜� Base_Column_List-->
+ SELECT aa.*, concat(round(((complete_number/number) * 100 ),2), '%') as complete_rate from (
+ select oi.id,oi.order_id,oi.pro_id,oi.number, sum(IFNULL(pap.output_number,0)) as complete_number
+ from (SELECT * from pr_order_item where order_id = #{orderId,jdbcType=BIGINT} and deleted !=1 ) oi
+ LEFT JOIN pr_assembly_plan pap
+ ON oi.order_id = pap.order_id AND oi.pro_id = pap.pro_id
+ GROUP BY oi.id,oi.order_id,oi.pro_id,oi.number) aa
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from pr_order_item
--
Gitblit v1.8.0