From 60e741a676ff88385fdf08ed8f506beb979fde54 Mon Sep 17 00:00:00 2001
From: buhuazhen <hua100783@gmail.com>
Date: 星期三, 08 四月 2026 15:51:14 +0800
Subject: [PATCH] feat(production): 新增报工主表实体及实现报工主表相关服务逻辑
---
src/main/resources/mapper/production/ProductionProductMainMapper.xml | 14 +++++++++++---
1 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/src/main/resources/mapper/production/ProductionProductMainMapper.xml b/src/main/resources/mapper/production/ProductionProductMainMapper.xml
index a122e90..13be81d 100644
--- a/src/main/resources/mapper/production/ProductionProductMainMapper.xml
+++ b/src/main/resources/mapper/production/ProductionProductMainMapper.xml
@@ -48,6 +48,9 @@
<if test="c.status != null and c.status != ''">
and ppm.status = #{c.status}
</if>
+ <if test="c.auditStatus != null">
+ and ppm.audit_status = #{c.auditStatus}
+ </if>
</where>
order by ppm.id
@@ -71,7 +74,13 @@
slpa.process,
ppo.quantity,
slpa.work_hours,
- slpa.work_hours * slpa.finished_num AS wages
+ slpa.work_hours * slpa.finished_num AS wages,
+ ppm.device_name,
+ ppm.device_id,
+ IFNULL(
+ TIMESTAMPDIFF(MINUTE, ppm.start_time, ppm.end_time),
+ 0
+ ) AS work_minutes
FROM
production_product_main ppm
LEFT JOIN sales_ledger_production_accounting slpa ON slpa.product_main_id = ppm.id
@@ -82,7 +91,7 @@
LEFT JOIN product_model pm ON po.product_model_id = pm.id
LEFT JOIN product p ON p.id = pm.product_id
LEFT JOIN sales_ledger sl ON po.sales_ledger_id = sl.id
- <where>
+ where ppm.audit_status = 1
<if test="ew.schedulingUserName != null and ew.schedulingUserName !=''">
and slpa.scheduling_user_name = #{ew.schedulingUserName}
</if>
@@ -94,7 +103,6 @@
and slpa.scheduling_date >= #{ew.entryDateStart}
and slpa.scheduling_date < date_add(#{ew.entryDateEnd}, INTERVAL 1 DAY)
</if>
- </where>
</select>
<select id="listMain" resultType="java.lang.Long">
SELECT ppm.id FROM production_product_main ppm
--
Gitblit v1.9.3