From b97e00dae4fa017c8273e41fb0f24cf7c7c69a33 Mon Sep 17 00:00:00 2001
From: chenlu <1320612696@qq.com>
Date: 星期一, 25 十一月 2024 13:28:35 +0800
Subject: [PATCH] 工程打印标签调整
---
north-glass-erp/src/main/resources/mapper/pp/Report.xml | 101 +++++++++++++++++++++++++++++++++++---------------
1 files changed, 71 insertions(+), 30 deletions(-)
diff --git a/north-glass-erp/src/main/resources/mapper/pp/Report.xml b/north-glass-erp/src/main/resources/mapper/pp/Report.xml
index 376afb5..0398c11 100644
--- a/north-glass-erp/src/main/resources/mapper/pp/Report.xml
+++ b/north-glass-erp/src/main/resources/mapper/pp/Report.xml
@@ -151,6 +151,7 @@
<result column="stockArea" property="stockArea"/>
<result column="product_name" property="productName"/>
<result column="bend_radius" property="bendRadius"/>
+ <result column="glassNumber" property="glassNumber"/>
</resultMap>
<!-- 娴佺▼鍗¤繘搴�-->
@@ -168,7 +169,7 @@
ifnull(f.inventory, 0) as inventory,
round(ifnull(f.inventory, 0) * a.area, 2) as inventoryArea,
ifnull(dd.quantity, 0) as shippedQuantity,
- JSON_UNQUOTE(JSON_EXTRACT(a.other_columns, '$.S01')) AS glassNumber
+ ifnull(JSON_UNQUOTE(JSON_EXTRACT(a.other_columns, '$.S01')),'') AS glassNumber
from flow_card as c
left join
sd.order_detail as a
@@ -257,6 +258,12 @@
<if test="crossProcessBreakingDTO.breakageType != null and crossProcessBreakingDTO.breakageType != ''">
and dd.breakage_type regexp #{crossProcessBreakingDTO.breakageType}
</if>
+ <if test="crossProcessBreakingDTO.project != null and crossProcessBreakingDTO.project != ''">
+ and o.project regexp #{crossProcessBreakingDTO.project}
+ </if>
+ <if test="crossProcessBreakingDTO.orderId != null and crossProcessBreakingDTO.orderId != ''">
+ and o.order_id regexp #{crossProcessBreakingDTO.orderId}
+ </if>
GROUP BY dd.id
order by dd.id desc
limit #{offset},#{pageSize}
@@ -279,6 +286,33 @@
and dd.available = 0
and reviewed_state != 2
and rw.this_process != dd.responsible_process
+ <if test="crossProcessBreakingDTO.code != null and crossProcessBreakingDTO.code != ''">
+ and JSON_UNQUOTE( JSON_EXTRACT( od.other_columns, '$.S01' )) regexp #{crossProcessBreakingDTO.code}
+ </if>
+ <if test="crossProcessBreakingDTO.processId != null and crossProcessBreakingDTO.processId != ''">
+ and rw.process_id regexp #{crossProcessBreakingDTO.processId}
+ </if>
+ <if test="crossProcessBreakingDTO.thisProcess != null and crossProcessBreakingDTO.thisProcess != ''">
+ and rw.this_process regexp #{crossProcessBreakingDTO.thisProcess}
+ </if>
+ <if test="crossProcessBreakingDTO.responsibleProcess != null and crossProcessBreakingDTO.responsibleProcess != ''">
+ and dd.responsible_process regexp #{crossProcessBreakingDTO.responsibleProcess}
+ </if>
+ <if test="crossProcessBreakingDTO.responsibleTeam != null and crossProcessBreakingDTO.responsibleTeam != ''">
+ and dd.responsible_team regexp #{crossProcessBreakingDTO.responsibleTeam}
+ </if>
+ <if test="crossProcessBreakingDTO.glassChild != null and crossProcessBreakingDTO.glassChild != ''">
+ and ogd.glass_child regexp #{crossProcessBreakingDTO.glassChild}
+ </if>
+ <if test="crossProcessBreakingDTO.breakageType != null and crossProcessBreakingDTO.breakageType != ''">
+ and dd.breakage_type regexp #{crossProcessBreakingDTO.breakageType}
+ </if>
+ <if test="crossProcessBreakingDTO.project != null and crossProcessBreakingDTO.project != ''">
+ and o.project regexp #{crossProcessBreakingDTO.project}
+ </if>
+ <if test="crossProcessBreakingDTO.orderId != null and crossProcessBreakingDTO.orderId != ''">
+ and o.order_id regexp #{crossProcessBreakingDTO.orderId}
+ </if>
order by dd.id desc
</select>
@@ -289,7 +323,8 @@
o.project,
o.order_id,
o.batch,
- if(od.shape = 1, '鏅舰', if(od.shape = 2, '寮傚舰', '')) as shape,
+ if(od.shape='' || ISNULL(od.shape),'鏅舰',if(od.shape = 1, '鏅舰', if(od.shape = 2, '寮傚舰', ''))) as shape,
+ if(od.shape=2,JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S04')),od.bend_radius) as bend_radius,
ogd.order_number,
ogd.technology_number,
ogd.process,
@@ -302,7 +337,8 @@
(odpds.reporting_work_num_count + ifnull(c.patchNumSum, 0) - odpd.reporting_work_num_count -
odpd.broken_num) / 1000000, 2) as stockArea,
od.product_name,
- od.bend_radius
+ od.bend_radius,
+ ifnull(JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S01')),'') AS glassNumber
from sd.order_detail AS od
LEFT JOIN sd.order_glass_detail AS ogd
@@ -364,6 +400,9 @@
</if>
<if test="workInProgressDTO.technologyNumber != null and workInProgressDTO.technologyNumber != ''">
and ogd.technology_number regexp #{workInProgressDTO.technologyNumber}
+ </if>
+ <if test="workInProgressDTO.glassNumber != null and workInProgressDTO.glassNumber != ''">
+ and ifnull(JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S01')),'') regexp #{workInProgressDTO.glassNumber}
</if>
group by fc.process_id, fc.order_number, fc.technology_number
order by fc.process_id, fc.order_number, fc.technology_number
@@ -451,14 +490,14 @@
ogd.glass_child,
ogd.child_width,
ogd.child_height,
- od.quantity,
+ fc.quantity,
ROUND(ogd.child_width * ogd.child_height / 1000000, 2) as childArea,
- ROUND(ogd.child_width * ogd.child_height * od.quantity / 1000000, 2) as actualArea,
+ ROUND(ogd.child_width * ogd.child_height * fc.quantity / 1000000, 2) as actualArea,
odpd.reporting_work_num as completeNum,
ROUND(ogd.child_width * ogd.child_height * odpd.reporting_work_num / 1000000,
2) as completeArea,
- od.quantity - odpd.reporting_work_num as incompleteNum,
- ROUND(ogd.child_width * ogd.child_height * (od.quantity - odpd.reporting_work_num) / 1000000,
+ fc.quantity - odpd.reporting_work_num as incompleteNum,
+ ROUND(ogd.child_width * ogd.child_height * (fc.quantity - odpd.reporting_work_num) / 1000000,
2) as incompleteArea,
od.product_name
@@ -480,10 +519,10 @@
on o.order_id = od.order_id
where LENGTH(fc.process_id) = 14
and odpd.process = #{selectProcesses}
- and o.create_time between #{selectTime1} and #{selectTime2}
+ and DATE_FORMAT((o.create_time), '%Y-%m-%d') between #{selectTime1} and #{selectTime2}
and position(#{orderId} in od.order_id)
and position(#{inputProject} in o.project)
- and od.quantity > odpd.reporting_work_num
+ and fc.quantity - odpd.reporting_work_num>0
group by fc.process_id, fc.order_number, fc.technology_number
order by fc.process_id, fc.order_number, fc.technology_number
@@ -506,7 +545,7 @@
round( ogd.child_width * ogd.child_height * dd.breakage_quantity / 1000000, 2 ) as area,
IFNULL(dd.responsible_personnel,'') as personnel,
ogd.glass_child,
- JSON_UNQUOTE( JSON_EXTRACT( od.other_columns, '$.S01' )) AS glassNumber
+ ifnull(JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S01')),'') AS glassNumber
FROM
sd.ORDER AS o
LEFT JOIN sd.order_glass_detail AS ogd ON ogd.order_id = o.order_id
@@ -516,7 +555,7 @@
AND dd.technology_number = ogd.technology_number
left join sd.order_detail as od on o.order_id = od.order_id and od.order_number=ogd.order_number
WHERE
- rw.reporting_work_time between #{selectTime1} and #{selectTime2}
+ DATE_FORMAT((rw.reporting_work_time), '%Y-%m-%d') between #{selectTime1} and #{selectTime2}
AND dd.available = 0
AND LENGTH( rw.process_id )= 14
<if test="damageReportDTO.orderId != null and damageReportDTO.orderId != ''">
@@ -569,7 +608,7 @@
AND dd.order_number = ogd.order_number
AND dd.technology_number = ogd.technology_number
WHERE
- rw.reporting_work_time between #{selectTime1} and #{selectTime2}
+ DATE_FORMAT((rw.reporting_work_time), '%Y-%m-%d') between #{selectTime1} and #{selectTime2}
AND dd.available = 0
AND LENGTH( rw.process_id )= 14
<if test="damageReportDTO.orderId != null and damageReportDTO.orderId != ''">
@@ -618,7 +657,7 @@
ogd.child_height as childHeight,
fc.quantity,
round(ogd.child_width * ogd.child_height * fc.quantity / 1000000, 2) as area,
- if(od.shape = 1, '鏅舰', if(od.shape = 2, '寮傚舰', '')) as shape,
+ if(od.shape='' || ISNULL(od.shape),'鏅舰',if(od.shape = 1, '鏅舰', if(od.shape = 2, '寮傚舰', ''))) as shape,
od.remarks
FROM sd.ORDER AS o
LEFT JOIN sd.order_detail AS od ON od.order_id = od.order_id
@@ -664,7 +703,7 @@
AND opd.order_number = fc.order_number
AND opd.technology_number = fc.technology_number
- WHERE o.create_time BETWEEN #{selectTime1} and #{selectTime2}
+ WHERE DATE_FORMAT((o.create_time), '%Y-%m-%d') BETWEEN #{selectTime1} and #{selectTime2}
GROUP BY o.order_id,
fc.order_number,
@@ -695,14 +734,14 @@
AND opd.order_number = fc.order_number
AND opd.technology_number = fc.technology_number
WHERE opd.reporting_work_num > 0
- and o.create_time BETWEEN #{selectTime1} and #{selectTime2}
+ and DATE_FORMAT((o.create_time), '%Y-%m-%d') BETWEEN #{selectTime1} and #{selectTime2}
AND position(#{selectProcesses} IN opd.process)
GROUP BY opd.process, o.order_id
</select>
<select id="productionScheduleMp">
select a.order_number,
- if(a.shape = 1, '鏅舰', if(a.shape = 2, '寮傚舰', '')) as shape,
+ if(od.shape='' || ISNULL(od.shape),'鏅舰',if(od.shape = 1, '鏅舰', if(od.shape = 2, '寮傚舰', ''))) as shape,
a.product_name,
b.child_width,
b.child_height,
@@ -715,7 +754,7 @@
round(ifnull(f.inventory, 0) * a.area, 2) as inventoryArea,
ifnull(dd.quantity, 0) as shippedQuantity,
ifnull(dd.area, 0) as area,
- JSON_UNQUOTE(JSON_EXTRACT(a.other_columns, '$.S01')) AS glassNumber
+ ifnull(JSON_UNQUOTE(JSON_EXTRACT(a.other_columns, '$.S01')),'') AS glassNumber
from flow_card as c
left join
@@ -791,12 +830,12 @@
) as reportWorkQuantityCount
FROM sd.order_process_detail as a
left join sd.`order` as o on o.order_id = a.order_id
- where o.create_time BETWEEN #{selectTime1} and #{selectTime2}
+ where DATE_FORMAT((o.create_time), '%Y-%m-%d') BETWEEN #{selectTime1} and #{selectTime2}
GROUP BY process_id, a.technology_number) as e
on e.process_id = c.process_id
and e.technology_number = c.technology_number
left join sd.delivery_detail as dd on dd.order_id = a.order_id and dd.order_number = a.order_number
- where d.create_time BETWEEN #{selectTime1} and #{selectTime2}
+ where DATE_FORMAT((d.create_time), '%Y-%m-%d') BETWEEN #{selectTime1} and #{selectTime2}
and reportWorkQuantity is not null
GROUP BY a.order_id
ORDER BY a.order_id
@@ -825,18 +864,18 @@
FROM sd.`order` AS a
LEFT JOIN reporting_work AS b ON a.order_id = b.order_id
WHERE b.this_process = '鍒囧壊'
- AND a.create_time BETWEEN #{selectTime1} and #{selectTime2}
+ AND DATE_FORMAT((a.create_time), '%Y-%m-%d') BETWEEN #{selectTime1} and #{selectTime2}
GROUP BY a.order_id) AS orw ON orw.order_id = o.order_id
LEFT JOIN (SELECT a.order_id,
SUM(b.reporting_work_num) AS completionsNum
FROM sd.`order` AS a
LEFT JOIN sd.order_process_detail AS b ON a.order_id = b.order_id
WHERE b.process = '鍖呰'
- AND a.create_time BETWEEN #{selectTime1} and #{selectTime2}
+ AND DATE_FORMAT((a.create_time), '%Y-%m-%d') BETWEEN #{selectTime1} and #{selectTime2}
GROUP BY a.order_id) AS oopd ON oopd.order_id = o.order_id
LEFT JOIN reporting_work AS rw ON rw.order_id = fc.order_id
AND rw.process_id = fc.process_id
- WHERE o.create_time BETWEEN #{selectTime1} and #{selectTime2}
+ WHERE DATE_FORMAT((o.create_time), '%Y-%m-%d') BETWEEN #{selectTime1} and #{selectTime2}
AND fc.create_time IS NOT NULL
GROUP BY o.order_id
</select>
@@ -856,7 +895,7 @@
LEFT JOIN optimize_use AS ou ON modl.use_id = ou.id and ou.raw_stock_code = modl.inventory_id
LEFT JOIN flow_card AS fc ON ou.project_no = fc.project_no
where modl.use_id IS NOT NULL
- and mo.material_requisition_date BETWEEN #{selectTime1} and #{selectTime2}
+ and DATE_FORMAT((mo.material_requisition_date), '%Y-%m-%d') BETWEEN #{selectTime1} and #{selectTime2}
GROUP BY ou.width, ou.height, material_code
</select>
@@ -1022,7 +1061,7 @@
o.project,
o.order_id,
o.batch,
- if(od.shape = 1, '鏅舰', if(od.shape = 2, '寮傚舰', '')) as shape,
+ if(od.shape='' || ISNULL(od.shape),'鏅舰',if(od.shape = 1, '鏅舰', if(od.shape = 2, '寮傚舰', ''))) as shape,
ogd.order_number,
ogd.technology_number,
ogd.process,
@@ -1244,7 +1283,8 @@
left join sd.order_glass_detail as ogd on ogd.order_id=fc.order_id and ogd.order_number=fc.order_number and ogd.technology_number=fc.technology_number
left join sd.order_detail as od on od.order_id=ogd.order_id and od.order_number=ogd.order_number
left join sd.`order` as o on o.order_id=od.order_id
- where o.create_order>0 and rw.reviewed_state>=0 and rwd.completed_quantity>0 and rw.reporting_work_time between #{selectTime1} and #{selectTime2}
+ where o.create_order>0 and rw.reviewed_state>=0 and rwd.completed_quantity>0 and
+ DATE_FORMAT((rw.reporting_work_time), '%Y-%m-%d') between #{selectTime1} and #{selectTime2}
and position(#{selectProcesses} in rw.this_process)
<if test="teamOutputDTO.thisProcess != null and teamOutputDTO.thisProcess != ''">
and rw.this_process regexp #{teamOutputDTO.thisProcess}
@@ -1342,7 +1382,8 @@
left join sd.order_glass_detail as ogd on ogd.order_id=fc.order_id and ogd.order_number=fc.order_number and ogd.technology_number=fc.technology_number
left join sd.order_detail as od on od.order_id=ogd.order_id and od.order_number=ogd.order_number
left join sd.`order` as o on o.order_id=od.order_id
- where o.create_order>0 and rw.reviewed_state>=0 and rwd.completed_quantity>0 and rw.reporting_work_time between #{selectTime1} and #{selectTime2}
+ where o.create_order>0 and rw.reviewed_state>=0 and rwd.completed_quantity>0 and
+ DATE_FORMAT((rw.reporting_work_time), '%Y-%m-%d') between #{selectTime1} and #{selectTime2}
and position(#{selectProcesses} in rw.this_process)
<if test="teamOutputDTO.thisProcess != null and teamOutputDTO.thisProcess != ''">
and rw.this_process regexp #{teamOutputDTO.thisProcess}
@@ -1382,7 +1423,7 @@
o.project,
o.order_id,
o.batch,
- if(od.shape = 1, '鏅舰', if(od.shape = 2, '寮傚舰', '')) as shape,
+ if(od.shape='' || ISNULL(od.shape),'鏅舰',if(od.shape = 1, '鏅舰', if(od.shape = 2, '寮傚舰', ''))) as shape,
sum(od.quantity) as quantity,
sum(odpds.reporting_work_num_count + ifnull(c.patchNumSum, 0) - odpd.reporting_work_num_count -
odpd.broken_num) as stockNum,
@@ -1514,7 +1555,7 @@
o.order_id,
fc.process_id,
o.batch,
- if(od.shape = 1, '鏅舰', if(od.shape = 2, '寮傚舰', '')) as shape,
+ if(od.shape='' || ISNULL(od.shape),'鏅舰',if(od.shape = 1, '鏅舰', if(od.shape = 2, '寮傚舰', ''))) as shape,
sum(od.quantity) as quantity,
sum(odpds.reporting_work_num_count + ifnull(c.patchNumSum, 0) - odpd.reporting_work_num_count -
odpd.broken_num) as stockNum,
@@ -1659,7 +1700,7 @@
GROUP BY order_id, order_number) as ps
left join sd.`order` as o on o.order_id = ps.order_id
where ps.processes = #{processes}
- and ps.scheduled_start_time between #{selectTime1} and #{selectTime2}
+ and DATE_FORMAT((ps.scheduled_start_time), '%Y-%m-%d') between #{selectTime1} and #{selectTime2}
<if test="scheduleProductionScheduleDTO.orderId != null and scheduleProductionScheduleDTO.orderId != ''">
and ps.order_id regexp #{scheduleProductionScheduleDTO.orderId}
</if>
@@ -1685,7 +1726,7 @@
GROUP BY order_id, order_number) as ps
left join sd.`order` as o on o.order_id = ps.order_id
where ps.processes = #{processes}
- and ps.scheduled_start_time between #{selectTime1} and #{selectTime2}
+ and DATE_FORMAT((ps.scheduled_start_time), '%Y-%m-%d') between #{selectTime1} and #{selectTime2}
<if test="scheduleProductionScheduleDTO.orderId != null and scheduleProductionScheduleDTO.orderId != ''">
and ps.order_id regexp #{scheduleProductionScheduleDTO.orderId}
</if>
--
Gitblit v1.8.0