From d5055b7870d0406f9b00d429cb47d2bfb79b902c Mon Sep 17 00:00:00 2001
From: chenlu <1320612696@qq.com>
Date: 星期三, 10 十二月 2025 11:37:09 +0800
Subject: [PATCH] 补片流程卡添加打印次数
---
north-glass-erp/src/main/resources/mapper/pp/WordOrder.xml | 208 +++++++++++++++++++++++++++++++++------------------
1 files changed, 135 insertions(+), 73 deletions(-)
diff --git a/north-glass-erp/src/main/resources/mapper/pp/WordOrder.xml b/north-glass-erp/src/main/resources/mapper/pp/WordOrder.xml
index 471389d..da82dde 100644
--- a/north-glass-erp/src/main/resources/mapper/pp/WordOrder.xml
+++ b/north-glass-erp/src/main/resources/mapper/pp/WordOrder.xml
@@ -8,58 +8,80 @@
<result column="order_id" property="orderId"/>
<result column="production_id" property="productionId"/>
<result column="splitting_status" property="splittingStatus"/>
+ <result column="founder" property="founder"/>
<result column="create_time" property="createTime"/>
<!--鎺ユ敹鍏朵粬澶栭敭瀹炰綋绫绘暟鎹�-->
- <association property="order" javaType="com.example.erp.entity.sd.Order">
- <result column="batch" property="batch"/>
- </association>
- <association property="orderDetail" javaType="com.example.erp.entity.sd.OrderDetail">
- <result column="product_id" property="productId"/>
- <result column="product_name" property="productName"/>
- <result column="compute_area" property="computeArea"/>
- <result column="quantity" property="quantity"/>
- <result column="compute_gross_area" property="computeGrossArea"/>
- <result column="perimeter" property="perimeter"/>
- <result column="bend_radius" property="bendRadius"/>
- <result column="processing_note" property="processingNote"/>
- </association>
+ <result column="batch" property="order.batch"/>
+ <result column="order_type" property="order.orderType"/>
+ <result column="project" property="order.project"/>
+ <result column="area" property="order.area"/>
+ <result column="creator" property="order.creator"/>
+ <result column="customer_name" property="order.customerName"/>
+ <result column="processing_note" property="order.processingNote"/>
+<!-- <association property="orderDetail" javaType="com.example.erp.entity.sd.OrderDetail">-->
+<!-- <result column="product_id" property="productId"/>-->
+<!-- <result column="product_name" property="productName"/>-->
+<!-- <result column="compute_area" property="computeArea"/>-->
+ <result column="quantity" property="orderDetail.quantity"/>
+<!-- <result column="compute_gross_area" property="computeGrossArea"/>-->
+<!-- <result column="perimeter" property="perimeter"/>-->
+<!-- <result column="bend_radius" property="bendRadius"/>-->
+<!-- <result column="processing_note" property="processingNote"/>-->
+ <result column="gross_area" property="orderDetail.grossArea"/>
- <!--<result column="g_typeId" property="glassTypes.typeId"/>
- <result column="g_type" property="glassTypes.type"/>-->
+<!-- </association>-->
</resultMap>
+
+ <resultMap id="addWordOrderMap" type="com.example.erp.entity.sd.OrderDetail">
+ <result column="order_id" property="orderId"/>
+ <result column="product_id" property="productId"/>
+ <result column="product_name" property="productName"/>
+ <result column="compute_gross_area" property="computeGrossArea"/>
+ <result column="quantity" property="quantity"/>
+ <result column="perimeter" property="perimeter"/>
+ <result column="process" property="orderGlassDetail.process"/>
+ </resultMap>
+
<select id="selectWordOrder" resultMap="wordOrderMap">
select
o.order_id,
- ogd.production_id,
o.batch,
- od.product_name,
- od.compute_area,
- od.quantity,
- od.compute_gross_area,
- od.perimeter,
- od.bend_radius,
- od.processing_note
+ o.project,
+ o.order_type,
+ o.area as gross_area,
+ o.quantity as quantity,
+ o.creator,
+ o.customer_name,
+ o.processing_note
+ from sd.order_detail as od
+ left join `order` as o
+ on o.order_id=od.order_id
+ where o.production_order!=2 and o.order_review=2 and o.create_order>0
- from `order` as o left join order_detail as od on o.order_id=od.order_id
- left join order_glass_detail as ogd on o.order_id=ogd.order_id and ogd.order_number=od.order_number
- where isnull(ogd.production_id) and o.order_review=2 and o.production_order!=2
- <if test="orderGlassDetail.orderId != null and orderGlassDetail.orderId != ''">
- and o.order_id regexp #{orderGlassDetail.orderId}
- </if>
- <if test="orderGlassDetail.productionId != null and orderGlassDetail.productionId != ''">
- and ogd.production_id regexp #{orderGlassDetail.productionId}
- </if>
- <if test="orderGlassDetail.order.batch != null and orderGlassDetail.order.batch != ''">
- and o.batch regexp #{orderGlassDetail.order.batch}
- </if>
- <if test="orderGlassDetail.orderDetail.productName != null and orderGlassDetail.orderDetail.productName!= ''">
- and od.product_name regexp #{orderGlassDetail.orderDetail.productName}
- </if>
+ <if test="orderGlassDetail.orderId != null and orderGlassDetail.orderId != ''">
+ and o.order_id regexp #{orderGlassDetail.orderId}
+ </if>
- <if test="orderGlassDetail.createTime != ''">
- and DATE_FORMAT((ogd.create_time),'%Y-%m-%d') BETWEEN #{ selectTime1 } AND #{ selectTime2 }
- </if>
+ <if test="orderGlassDetail.order.batch != null and orderGlassDetail.order.batch != ''">
+ and o.batch regexp #{orderGlassDetail.order.batch}
+ </if>
+ <if test="orderGlassDetail.order.project != null and orderGlassDetail.order.project!= ''">
+ and o.project regexp #{orderGlassDetail.order.project}
+ </if>
+ <if test="orderGlassDetail.order.orderType != null and orderGlassDetail.order.orderType!= ''">
+ and o.order_type regexp #{orderGlassDetail.order.orderType}
+ </if>
+ <if test="orderGlassDetail.order.customerName != null and orderGlassDetail.order.customerName!= ''">
+ and o.customer_name regexp #{orderGlassDetail.order.customerName}
+ </if>
+ <if test="orderGlassDetail.order.processingNote != null and orderGlassDetail.order.processingNote!= ''">
+ and o.processing_note regexp #{orderGlassDetail.order.processingNote}
+ </if>
+
+ <if test="orderGlassDetail.createTime != ''">
+ and DATE_FORMAT((o.create_time),'%Y-%m-%d') BETWEEN #{ selectTime1 } AND #{ selectTime2 }
+ </if>
group by o.order_id
order by o.id desc
@@ -71,21 +93,28 @@
<select id="selectWordOrderNo" resultMap="wordOrderMap">
select
o.order_id,
+ od.order_number,
ogd.production_id,
+ ogd.founder,
o.batch,
- od.product_name,
- od.compute_area,
- od.quantity,
- od.compute_gross_area,
- od.perimeter,
- od.bend_radius,
- od.processing_note
-
- from `order` as o left join order_detail as od on o.order_id=od.order_id
- left join order_glass_detail as ogd on o.order_id=ogd.order_id and ogd.order_number=od.order_number
+ o.project,
+ o.order_type,
+ (od.gross_area) as gross_area,
+ (od.quantity) as quantity,
+ o.creator,
+ od.id,
+ o.customer_name,
+ o.processing_note
+ from sd.order_glass_detail as ogd
+ left join order_detail as od
+ on od.order_id=ogd.order_id
+ and ogd.order_number=od.order_number
+ left join `order` as o
+ on o.order_id=ogd.order_id
where ogd.production_id IS NOT NULL
+ and o.order_review>0
<if test="orderGlassDetail.orderId != null and orderGlassDetail.orderId != ''">
- and ogd.order_id regexp #{orderGlassDetail.orderId}
+ and o.order_id regexp #{orderGlassDetail.orderId}
</if>
<if test="orderGlassDetail.productionId != null and orderGlassDetail.productionId != ''">
and ogd.production_id regexp #{orderGlassDetail.productionId}
@@ -93,32 +122,42 @@
<if test="orderGlassDetail.order.batch != null and orderGlassDetail.order.batch != ''">
and o.batch regexp #{orderGlassDetail.order.batch}
</if>
- <if test="orderGlassDetail.orderDetail.productName != null and orderGlassDetail.orderDetail.productName!= ''">
- and od.product_name regexp #{orderGlassDetail.orderDetail.productName}
+ <if test="orderGlassDetail.order.project != null and orderGlassDetail.order.project!= ''">
+ and o.project regexp #{orderGlassDetail.order.project}
+ </if>
+ <if test="orderGlassDetail.order.orderType != null and orderGlassDetail.order.orderType!= ''">
+ and o.order_type regexp #{orderGlassDetail.order.orderType}
+ </if>
+ <if test="orderGlassDetail.order.customerName != null and orderGlassDetail.order.customerName!= ''">
+ and o.customer_name regexp #{orderGlassDetail.order.customerName}
+ </if>
+ <if test="orderGlassDetail.order.processingNote != null and orderGlassDetail.order.processingNote!= ''">
+ and o.processing_note regexp #{orderGlassDetail.order.processingNote}
</if>
<if test="orderGlassDetail.createTime != ''">
- and DATE_FORMAT((ogd.create_time),'%Y-%m-%d') BETWEEN #{ selectTime1 } AND #{ selectTime2 }
+ and DATE_FORMAT((o.create_time),'%Y-%m-%d') BETWEEN #{ selectTime1 } AND #{ selectTime2 }
</if>
-
- group by ogd.production_id,ogd.order_number
- order by ogd.id desc
-
-
- ;
+ group by od.id,ogd.order_id,od.order_number
+ order by od.id desc
</select>
- <select id="addWordOrder" >
+ <select id="addWordOrder" resultMap="addWordOrderMap">
select od.order_id,
od.product_id,
od.product_name,
sum( od.quantity) as quantity,
od.compute_gross_area,
- od.perimeter
+ od.perimeter,
+ ogd.process
from sd.order_detail as od
left join sd.order as o
on od.order_id =o.order_id
- where od.order_id = #{orderId} and o.production_order!=2
+ left join (
+ select order_id,order_number,process from
+ sd.order_glass_detail where FIND_IN_SET(order_id,#{orderId}) GROUP BY order_id,order_number
+ ) as ogd on ogd.order_id = o.order_id and ogd.order_number=od.order_number
+ where FIND_IN_SET(od.order_id,#{orderId}) and o.production_order!=2
<if test="orderDetail.orderId != null and orderDetail.orderId != ''">
and od.order_id regexp #{orderDetail.orderId}
</if>
@@ -128,17 +167,17 @@
<if test="orderDetail.productName != null and orderDetail.productName != ''">
and od.product_name regexp #{orderDetail.productName}
</if>
- group by od.order_id, od.product_id, od.product_name
+ group by od.order_id, od.product_id, od.product_name,ogd.process
;
</select>
- <select id="selectOrderNumber" >
- select ifnull(count(ogd.production_id),0)
+ <select id="selectOrderNumber">
+ select ifnull(count(ogd.production_id), 0)
from sd.order_glass_detail as ogd
where ogd.production_id = #{productIdVl}
</select>
- <update id="addOrderWorkMp" >
+ <update id="addOrderWorkMp">
update sd.order_detail as od left join sd.order_glass_detail as ogd
on od.order_id = ogd.order_id and od.order_number = ogd.order_number
@@ -147,11 +186,12 @@
ogd.founder=#{userName}
where od.order_id = #{orderId}
- and od.product_id =#{productId}
+ and od.product_id = #{productId}
and od.product_name = #{productName}
+ and ogd.process = #{process}
</update>
-<!-- 鍒犻櫎宸ュ崟-->
+ <!-- 鍒犻櫎宸ュ崟-->
<update id="deleteOrderWorkMp">
update sd.order_detail as od left join sd.order_glass_detail as ogd
on od.order_id = ogd.order_id and od.order_number = ogd.order_number
@@ -159,7 +199,6 @@
ogd.production_time=null,
ogd.founder=null
where od.order_id = #{orderId}
- and od.product_name = #{productName}
</update>
<select id="selectWorkCount">
@@ -172,10 +211,33 @@
<select id="selectYesWorkCount">
select COUNT(distinct order_number)
from order_glass_detail
- where order_id = #{orderId}
+ where order_id = #{orderId}
</select>
<update id="updateWorkType">
- update sd.order as o set o.production_order=#{state} where o.order_id=#{orderId}
+ update sd.order as o
+ set o.production_order=#{state}
+ where o.order_id = #{orderId}
+ </update>
+ <select id="selectProcessCard">
+ select processing_card from sd.`order` where order_id = #{orderId}
+ </select>
+
+ <update id="updateWorkIdMp">
+ UPDATE sd.order_glass_detail AS ogd
+ JOIN (
+ SELECT order_id, order_number, MAX(production_id) AS production_id
+ FROM sd.order_glass_detail
+ WHERE production_id IS NOT NULL
+ AND FIND_IN_SET(order_id, #{orderId})
+ GROUP BY order_id, order_number
+ ) AS t
+ ON ogd.order_id = t.order_id AND ogd.order_number = t.order_number
+ SET ogd.production_id = t.production_id,
+ ogd.production_time = NOW(),
+ ogd.founder = #{userName}
+ WHERE ogd.production_id IS NULL
+ AND FIND_IN_SET(ogd.order_id, #{orderId})
+
</update>
</mapper>
\ No newline at end of file
--
Gitblit v1.8.0