From 02826fa5829598c2f8efbf4381e4048e5c20e5c7 Mon Sep 17 00:00:00 2001
From: Fancy <Fancy.fx@outlook.com>
Date: 星期一, 26 八月 2024 10:18:05 +0800
Subject: [PATCH] order status
---
pms-parent/pms-global/src/main/resources/mapper/PrOrderItemMapper.xml | 43 +++++++++++++++++++++++++++++++++++++++----
1 files changed, 39 insertions(+), 4 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 0332664..972b95e 100644
--- a/pms-parent/pms-global/src/main/resources/mapper/PrOrderItemMapper.xml
+++ b/pms-parent/pms-global/src/main/resources/mapper/PrOrderItemMapper.xml
@@ -25,10 +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
@@ -63,6 +66,7 @@
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.dy.pmsGlobal.pojoPr.PrOrderItem">
+ <!--@mbg.generated-->
update pr_order_item
<set>
<if test="orderId != null">
@@ -83,4 +87,35 @@
</set>
where id = #{id,jdbcType=BIGINT}
</update>
+ <delete id="deleteLogicById">
+ update pr_order_item set deleted = 1 where id = #{id}
+ </delete>
+ <select id="selectSome" resultMap="BaseResultMap">
+ select
+ <include refid="Base_Column_List" />
+ from pr_order_item p
+ where p.deleted!=1
+ <trim prefix="and " suffixOverrides="and">
+ <if test="orderId != null and orderId != ''">
+ p.order_id = #{orderId,jdbcType=BIGINT} and
+ </if>
+ </trim>
+ order by id desc
+ <trim prefix="limit " >
+ <if test="start != null and count != null">
+ #{start}, #{count}
+ </if>
+ </trim>
+ </select>
+
+ <select id="selectSomeCount" resultType="java.lang.Long">
+ select count(1)
+ from pr_order_item p
+ where p.deleted!=1
+ <trim prefix="and " suffixOverrides="and">
+ <if test="orderId != null and orderId != ''">
+ p.order_id = #{orderId,jdbcType=BIGINT} and
+ </if>
+ </trim>
+ </select>
</mapper>
--
Gitblit v1.8.0