From dce5f099e76ecfa92ad708a3d5565a67844ceda2 Mon Sep 17 00:00:00 2001
From: 廖井涛 <2265517004@qq.com>
Date: 星期二, 25 二月 2025 12:34:28 +0800
Subject: [PATCH] Merge branch 'master' of http://bore.pub:10439/r/ERP_override
---
north-glass-erp/src/main/resources/mapper/pp/ReportingWork.xml | 46 +++++++++++++++++++++++++++++-----------------
1 files changed, 29 insertions(+), 17 deletions(-)
diff --git a/north-glass-erp/src/main/resources/mapper/pp/ReportingWork.xml b/north-glass-erp/src/main/resources/mapper/pp/ReportingWork.xml
index 720263d..cf7f56e 100644
--- a/north-glass-erp/src/main/resources/mapper/pp/ReportingWork.xml
+++ b/north-glass-erp/src/main/resources/mapper/pp/ReportingWork.xml
@@ -91,6 +91,7 @@
where fc.process_id = #{processIdStr}
and POSITION(fc.technology_number in #{technologyStr})
and if(#{reportType}=1,o.order_type!='鏍峰搧璁㈠崟',o.order_id!='')
+ and o.create_order>0
GROUP BY fc.process_id
</select>
@@ -179,6 +180,7 @@
AND POSITION(fc.technology_number in #{technologyStr})
AND odpd.process = #{process}
and if(#{reportType}=1,o.order_type!='鏍峰搧璁㈠崟',o.order_id!='')
+ and o.create_order>0
group by fc.order_number,
ogd.technology_number
order by fc.order_number
@@ -213,7 +215,7 @@
LEFT JOIN sd.order_glass_detail AS ogd
ON od.order_id = ogd.order_id
AND od.order_number = ogd.order_number
- <if test="process == '澶硅兌' or (process == '鎵撹兌鍜岀矘妗�' and previousProcess=='澶硅兌')">
+ <if test="process == '澶硅兌' or (process == '鎵撹兌鍜岀矘妗�')">
AND ogd.`group` = (select `group`
from sd.order_glass_detail
where order_id = ogd.order_id
@@ -255,7 +257,7 @@
WHERE
fc.process_id = #{processIdStr}
- <if test="process != '涓┖' and process != '澶硅兌' and process != '鍖呰' and process != '鎵撹兌鍜岀矘妗�' ">
+ <if test="laminating != 'laminating'">
AND POSITION(fc.technology_number in #{technologyStr})
</if>
AND odpd.process = #{process}
@@ -343,11 +345,11 @@
</select>
<select id="selectGlassProcessNum" resultType="java.lang.Integer">
select
- if((d.reporting_work_num_count+ifnull(c.reworkNumSum,0)-b.reporting_work_num_count-b.broken_num)< 0,
+ ifnull(if((d.reporting_work_num_count+ifnull(c.reworkNumSum,0)-b.reporting_work_num_count-b.broken_num)< 0,
0,
(d.reporting_work_num_count+ifnull(c.reworkNumSum,0)-b.reporting_work_num_count-b.broken_num)
- )
- from flow_card as a
+ ),0)
+ from pp.flow_card as a
left join sd.order_process_detail as b
on
b.order_number = a.order_number
@@ -362,9 +364,9 @@
rw.process_id,rw.order_sort,rw.technology_number,
rwk.this_process
from
- rework as rw
+ pp.rework as rw
LEFT JOIN
- reporting_work as rwk
+ pp.reporting_work as rwk
on rw.reporting_work_id =rwk.reporting_work_id
where rwk.this_process=#{thisProcess}
and rw.review_status=1
@@ -430,11 +432,11 @@
ifnull(g.completed_quantity,0) as nextQuantitySum, -- 鍚庡伐搴忓凡瀹屾垚
if((f.completed_quantity
-ifnull(g.completed_quantity,0))
- >=
+ >
a.completed_quantity,
0,
- (a.completed_quantity-f.completed_quantity
- +ifnull(g.completed_quantity,0))
+ (f.completed_quantity
+ -ifnull(g.completed_quantity,0))
) as minQuantity -- 淇敼鏈�灏忔暟
</if>
<if test="nextProcess == null or nextProcess == ''"> -- 鏈�鍚庝竴閬撳伐搴�
@@ -533,7 +535,8 @@
on rwd.reporting_work_id = rw.reporting_work_id and rwd.order_number = ogd.order_number and
rwd.technology_number = ogd.technology_number
where rw.reviewed_state != 2
- and rw.reporting_work_time between #{selectTime1} and #{selectTime2}
+ and rw.reporting_work_time >= #{selectTime1}
+ AND rw.reporting_work_time < #{selectTime2}
and position(#{orderId} in rw.order_id)
and rw.reviewed_state!=-1
and o.create_order>0
@@ -576,7 +579,8 @@
on rwd.reporting_work_id = rw.reporting_work_id and rwd.order_number = ogd.order_number and
rwd.technology_number = ogd.technology_number
where rw.reviewed_state != 2
- and rw.reporting_work_time between #{selectTime1} and #{selectTime2} and position(#{orderId} in rw.order_id)
+ and rw.reporting_work_time >= #{selectTime1}
+ AND rw.reporting_work_time < #{selectTime2} and position(#{orderId} in rw.order_id)
and rw.reviewed_state!=-1
and o.create_order>0
<if test="reportingWork.reportingWorkId != null and reportingWork.reportingWorkId != ''">
@@ -705,7 +709,7 @@
left join damage_details as dd on dd.reporting_work_id=rw.reporting_work_id
where rw.reviewed_state != 2
- and rw.reporting_work_time between #{selectTime1} and #{selectTime2}
+ and DATE_FORMAT((rw.reporting_work_time), '%Y-%m-%d') between #{selectTime1} and #{selectTime2}
and position(#{processId} in rw.process_id)
and position(#{state} in dd.quality_ins_status)
and rw.reviewed_state!=-1
@@ -735,7 +739,7 @@
left join damage_details as dd on dd.reporting_work_id=rw.reporting_work_id
where rw.reviewed_state != 2
- and rw.reporting_work_time between #{selectTime1} and #{selectTime2}
+ and DATE_FORMAT((rw.reporting_work_time), '%Y-%m-%d') between #{selectTime1} and #{selectTime2}
and position(#{processId} in rw.process_id)
and position(#{state} in dd.quality_ins_status)
and rw.reviewed_state!=-1
@@ -943,7 +947,7 @@
LEFT JOIN sd.order_glass_detail AS ogd
ON od.order_id = ogd.order_id
AND od.order_number = ogd.order_number
- <if test="process == '澶硅兌' or (process == '鎵撹兌鍜岀矘妗�' and previousProcess=='澶硅兌')">
+ <if test="process == '澶硅兌' or (process == '鎵撹兌鍜岀矘妗�')">
AND ogd.`group` = (select `group`
from sd.order_glass_detail
where order_id = ogd.order_id
@@ -987,17 +991,25 @@
from reporting_work as a
left join reporting_work_detail as b on a.reporting_work_id = b.reporting_work_id
where this_process=#{previousProcess} and reviewed_state=0 and process_id= #{processIdStr}
- and POSITION(b.technology_number in #{technologyStr})
+
GROUP BY a.reporting_work_id,b.order_number,b.technology_number
) as rws
on rws.process_id = fc.process_id and rws.order_number=fc.order_number and rws.technology_number=fc.technology_number
WHERE
fc.process_id = #{processIdStr}
- <if test="process != '涓┖' and process != '澶硅兌' and process != '鍖呰' and process != '鎵撹兌鍜岀矘妗�' ">
+ <if test="laminating != 'laminating' ">
AND POSITION(fc.technology_number in #{technologyStr})
</if>
AND odpd.process = #{process}
and rws.reviewed_state=0
order by fc.order_number
</select>
+
+ <select id="getProcessLaminating">
+ select IFNULL(nickname,'') from sd.basic_data where basic_category='process' and basic_name=#{process}
+ </select>
+
+ <select id="selectOrderid">
+ select order_id from pp.flow_card where process_id=#{processIdStr} group by order_id
+ </select>
</mapper>
\ No newline at end of file
--
Gitblit v1.8.0