From ba78a4af86a2916ecec4a92bfef6bc4f5a4e6d8e Mon Sep 17 00:00:00 2001
From: chenlu <1320612696@qq.com>
Date: 星期四, 07 三月 2024 13:44:02 +0800
Subject: [PATCH] 排产删除、审核,修改代码格式
---
north-glass-erp/src/main/resources/mapper/pp/ReportingWork.xml | 117 +++++++++++++++++++++++++++++++++++++++++++++++-----------
1 files changed, 95 insertions(+), 22 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 0df04e9..cb8f1ed 100644
--- a/north-glass-erp/src/main/resources/mapper/pp/ReportingWork.xml
+++ b/north-glass-erp/src/main/resources/mapper/pp/ReportingWork.xml
@@ -43,17 +43,15 @@
</select>
<select id="SelectWorkBasicDeviceMp">
- select *
- from basic_data_produce as a
- where a.basic_category = #{process}
- and a.basic_type = '璁惧'
+ SELECT bdp.id,bdp.basic_type,bdp.basic_name, bd.basic_name as basic_category FROM sd.basic_data as bd left join `basic_data_produce` as bdp
+ on bd.id=bdp.basic_category
+ where bd.basic_category="process" and bdp.basic_type="device" and bd.basic_name = #{process}
</select>
<select id="SelectWorkBasicTeamsMp">
- select *
- from basic_data_produce as a
- where a.basic_category = #{process}
- and a.basic_type = '鐝粍'
+ SELECT bdp.id,bdp.basic_type,bdp.basic_name, bd.basic_name as basic_category FROM sd.basic_data as bd left join `basic_data_produce` as bdp
+ on bd.id=bdp.basic_category
+ where bd.basic_category="process" and bdp.basic_type="teamsgroups" and bd.basic_name = #{process}
</select>
<!-- 鏌ヨ娴佺▼鍗″伐鑹烘祦绋�-->
@@ -82,22 +80,27 @@
ogd.child_width,
ogd.child_height,
od.shape,
- fc.quantity - IFNULL(fc.number_patches,0)-IFNULL(rwd.completed_quantity,0)-IFNULL(rwd.breakage_quantity,0)-IFNULL((rwd.breakage_quantity-rwd.rework_quantity),0)
- as quantity
+ fc.quantity -odpd.reporting_work_num as quantity,
+ odpd.reporting_work_num_count as completed,
+ odpd.broken_num as onceBroken
FROM
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
- LEFT JOIN flow_card AS fc ON fc.order_id = ogd.order_id and fc.production_id=ogd.production_id
- AND fc.order_number = ogd.order_number
- AND fc.technology_number = ogd.technology_number
- left join reporting_work as rw on rw.order_id=fc.order_id and rw.production_id=fc.production_id and rw.process_id=fc.process_id
- left join reporting_work_detail as rwd on rwd.reporting_work_id=rw.reporting_work_id and rwd.order_number=fc.order_number and rwd.technology_number=fc.technology_number
+ LEFT JOIN sd.order_glass_detail AS ogd
+ ON od.order_id = ogd.order_id
+ AND od.order_number = ogd.order_number
+ LEFT JOIN flow_card AS fc
+ ON fc.order_id = ogd.order_id
+ and fc.production_id=ogd.production_id
+ AND fc.order_number = ogd.order_number
+ AND fc.technology_number = ogd.technology_number
+ left join sd.order_process_detail as odpd
+ ON odpd.order_id = fc.order_id
+ AND odpd.order_number = fc.order_number
+ AND odpd.technology_number = fc.technology_number
WHERE
fc.process_id = #{processIdStr}
- AND position(
- fc.technology_number IN #{technologyStr})
-
+ AND fc.technology_number = #{technologyStr}
+ AND odpd.process = #{process}
order by fc.order_number
</select>
@@ -111,7 +114,7 @@
ogd.child_width,
ogd.child_height,
od.shape,
- reportingwork_num -IFNULL(rwd.completed_quantity,0)-IFNULL(rwd.breakage_quantity,0)-IFNULL((rwd.breakage_quantity-rwd.rework_quantity),0) as quantity
+ reporting_work_num -IFNULL(rwd.completed_quantity,0)-IFNULL(rwd.breakage_quantity,0)-IFNULL((rwd.wait_rework_quantity),0) as quantity
FROM 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
@@ -133,8 +136,78 @@
</select>
<select id="SelectProcessMp">
- select * from sd.basic_data where basic_type="product" and basic_category="process"
+ select * from sd.basic_data where basic_type='product' and basic_category='process'
</select>
+ <select id="historyProcessMp">
+ select ifnull(GROUP_CONCAT(distinct rw.this_process),'') from reporting_work as rw where rw.process_id=#{processIdStr}
+ </select>
+
+ <select id="historyDeviceMp">
+ SELECT
+ bdp.id,
+ bdp.basic_type,
+ bdp.basic_name,
+ bd.basic_name AS basic_category
+ FROM
+ sd.basic_data AS bd
+ LEFT JOIN `basic_data_produce` AS bdp ON bd.id = bdp.basic_category
+ WHERE
+ bd.basic_category = 'process'
+ AND bdp.basic_type = 'device'
+ AND POSITION(bd.basic_name in CONCAT(#{historyProcess},#{process}))
+ </select>
+
+ <select id="historyTeamsMp">
+ SELECT
+ bdp.id,
+ bdp.basic_type,
+ bdp.basic_name,
+ bd.basic_name,bd.id AS basic_category,
+ rw.process
+ FROM
+ sd.basic_data AS bd
+ LEFT JOIN `basic_data_produce` AS bdp
+ ON bd.id = bdp.basic_category
+ right join (
+ select distinct process from
+ ( select distinct rw.this_process as process
+ from reporting_work as rw where rw.process_id=#{processIdStr}
+ UNION
+ select #{process}
+ ) as t
+ ) as rw
+ on rw.process=bd.basic_name
+ WHERE
+ bdp.basic_type = 'teamsgroups'
+ </select>
+
+ <select id="SelectHistoryProcessMp">
+ SELECT
+ distinct
+ bd.basic_name AS basic_category
+ FROM
+ sd.basic_data AS bd
+ LEFT JOIN `basic_data_produce` AS bdp ON bd.id = bdp.basic_category
+ WHERE
+ bd.basic_category = 'process'
+ AND bdp.basic_type = 'teamsgroups'
+ AND POSITION(bd.basic_name in CONCAT(#{historyProcess},#{process}))
+ </select>
+
+ <select id="selectBasicNameByType">
+ select * from `basic_data_produce` as a where a.basic_type = #{type}
+ </select>
+
+ <select id="selectMaxReportingWorkId">
+ select
+ ifnull(SUBSTR(max(reporting_work_id) from 9),0)
+ from
+ reporting_work as a
+ where
+ date(a.create_time) = curdate()
+ order by id desc,reporting_work_id desc limit 1
+ </select>
+
</mapper>
\ No newline at end of file
--
Gitblit v1.8.0