From 5d81fcc5768741323a2e343fc01f44e17e68b65b Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期四, 25 六月 2026 14:59:38 +0800
Subject: [PATCH] 1.库存入库新增质检流程 2.销售相关查询返回总合同号 3.采购相关查询返回总合同号
---
src/main/resources/mapper/production/ProductionProductMainMapper.xml | 17 +++++++++++++----
1 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/src/main/resources/mapper/production/ProductionProductMainMapper.xml b/src/main/resources/mapper/production/ProductionProductMainMapper.xml
index 5a78a5b..1b5f92d 100644
--- a/src/main/resources/mapper/production/ProductionProductMainMapper.xml
+++ b/src/main/resources/mapper/production/ProductionProductMainMapper.xml
@@ -31,6 +31,7 @@
pm.model as productModelName,
pm.unit,
po_sales.salesContractNo,
+ po_sales.masterContractNo,
date(ppm.create_time) as schedulingDate,
su.nick_name as schedulingUserName,
po_sales.customerName,
@@ -42,6 +43,7 @@
left join (
select po2.id as orderId,
group_concat(distinct sl2.sales_contract_no order by sl2.sales_contract_no separator ',') as salesContractNo,
+ group_concat(distinct sl2.master_contract_no order by sl2.master_contract_no separator ',') as masterContractNo,
group_concat(distinct sl2.customer_name order by sl2.customer_name separator ',') as customerName
from production_order po2
left join production_plan pp2
@@ -62,6 +64,9 @@
</if>
<if test="c.salesContractNo != null and c.salesContractNo != ''">
and po_sales.salesContractNo like concat('%', #{c.salesContractNo}, '%')
+ </if>
+ <if test="c.masterContractNo != null and c.masterContractNo != ''">
+ and po_sales.masterContractNo like concat('%', #{c.masterContractNo}, '%')
</if>
<if test="c.customerName != null and c.customerName != ''">
and po_sales.customerName like concat('%', #{c.customerName}, '%')
@@ -100,13 +105,17 @@
ifnull(ppo.scrap_qty, 0) as scrapQty,
date(pa.scheduling_date) as schedulingDate,
pa.scheduling_user_name as schedulingUserName,
+ cast(ifnull(ppm.work_hour, 0) as decimal(18,4)) as workHour,
cast(ifnull(pa.work_hours, 0) as decimal(18,4)) as workHours,
cast(
- ifnull(pa.work_hours, 0) * ifnull(pa.finished_num, 0) *
case
- when substring_index(pm.model, '*', -1) regexp '^[0-9]+(\\.[0-9]+)?$'
- then cast(substring_index(pm.model, '*', -1) as decimal(18,4))
- else 1
+ when poro.type = 0 then ifnull(pa.work_hours, 0) * ifnull(ppm.work_hour, 0)
+ else ifnull(pa.work_hours, 0) * ifnull(pa.finished_num, 0) *
+ case
+ when substring_index(pm.model, '*', -1) regexp '^[0-9]+(\\.[0-9]+)?$'
+ then cast(substring_index(pm.model, '*', -1) as decimal(18,4))
+ else 1
+ end
end
as decimal(18,4)
) as wages
--
Gitblit v1.9.3