From b5f260b2364fad1e74a7eb1f5985268056e3a9e7 Mon Sep 17 00:00:00 2001
From: chenhj <1263187585@qq.com>
Date: 星期五, 24 四月 2026 18:24:15 +0800
Subject: [PATCH] Merge branch 'dev_New_pro' of http://114.132.189.42:9002/r/product-inventory-management-after into dev_New_pro

---
 src/main/resources/mapper/production/ProductionOrderMapper.xml |  117 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 117 insertions(+), 0 deletions(-)

diff --git a/src/main/resources/mapper/production/ProductionOrderMapper.xml b/src/main/resources/mapper/production/ProductionOrderMapper.xml
index b2d1cb6..40af51d 100644
--- a/src/main/resources/mapper/production/ProductionOrderMapper.xml
+++ b/src/main/resources/mapper/production/ProductionOrderMapper.xml
@@ -5,6 +5,7 @@
     <!-- 閫氱敤鏌ヨ鏄犲皠缁撴灉 -->
     <resultMap id="BaseResultMap" type="com.ruoyi.production.pojo.ProductionOrder">
         <id column="id" property="id" />
+        <result column="sales_ledger_id" property="salesLedgerId" />
         <result column="production_plan_ids" property="productionPlanIds" />
         <result column="product_model_id" property="productModelId" />
         <result column="nps_no" property="npsNo" />
@@ -15,10 +16,126 @@
         <result column="complete_quantity" property="completeQuantity" />
         <result column="start_time" property="startTime" />
         <result column="end_time" property="endTime" />
+        <result column="sales_ledger_product_id" property="salesLedgerProductId" />
         <result column="create_user" property="createUser" />
         <result column="dept_id" property="deptId" />
+        <result column="plan_complete_time" property="planCompleteTime" />
+        <result column="status" property="status" />
     </resultMap>
 
+    <resultMap id="ProductionOrderVoResultMap" type="com.ruoyi.production.bean.vo.ProductionOrderVo" extends="BaseResultMap">
+        <result column="salesContractNo" property="salesContractNo" />
+        <result column="customerName" property="customerName" />
+        <result column="productName" property="productName" />
+        <result column="model" property="model" />
+        <result column="processRouteCode" property="processRouteCode" />
+    </resultMap>
+
+    <sql id="ProductionOrderVoColumns">
+        po.id,
+        po.sales_ledger_id,
+        po.production_plan_ids,
+        po.product_model_id,
+        po.nps_no,
+        po.create_time,
+        po.update_time,
+        po.technology_routing_id,
+        po.quantity,
+        po.complete_quantity,
+        po.start_time,
+        po.end_time,
+        po.sales_ledger_product_id,
+        po.create_user,
+        po.dept_id,
+        po.plan_complete_time,
+        po.status,
+        sl.sales_contract_no as salesContractNo,
+        sl.customer_name as customerName,
+        p.product_name as productName,
+        pm.model as model,
+        tr.process_route_code as processRouteCode,
+        tb.bom_no as bomNo
+    </sql>
+
+    <sql id="ProductionOrderVoFrom">
+        from production_order po
+                 left join sales_ledger sl on po.sales_ledger_id = sl.id
+                 left join product_model pm on po.product_model_id = pm.id
+                 left join product p on pm.product_id = p.id
+                 left join technology_routing tr on po.technology_routing_id = tr.id
+                 left join technology_bom tb on tb.id = tr.bom_id
+    </sql>
+
+    <sql id="ProductionOrderWhere">
+        <where>
+            <if test="c != null">
+                <if test="c.id != null">
+                    and po.id = #{c.id}
+                </if>
+                <if test="c.salesLedgerId != null">
+                    and po.sales_ledger_id = #{c.salesLedgerId}
+                </if>
+                <if test="c.productModelId != null">
+                    and po.product_model_id = #{c.productModelId}
+                </if>
+                <if test="c.technologyRoutingId != null">
+                    and po.technology_routing_id = #{c.technologyRoutingId}
+                </if>
+                <if test="c.salesLedgerProductId != null">
+                    and po.sales_ledger_product_id = #{c.salesLedgerProductId}
+                </if>
+                <if test="c.status != null">
+                    and po.status = #{c.status}
+                </if>
+                <if test="c.createUser != null">
+                    and po.create_user = #{c.createUser}
+                </if>
+                <if test="c.deptId != null">
+                    and po.dept_id = #{c.deptId}
+                </if>
+                <if test="c.npsNo != null and c.npsNo != ''">
+                    and po.nps_no like concat('%', #{c.npsNo}, '%')
+                </if>
+                <if test="c.productionPlanIds != null and c.productionPlanIds != ''">
+                    and po.production_plan_ids like concat('%', #{c.productionPlanIds}, '%')
+                </if>
+                <if test="c.planCompleteTime != null">
+                    and po.plan_complete_time = #{c.planCompleteTime}
+                </if>
+                <if test="c.startTime != null">
+                    and po.start_time &gt;= #{c.startTime}
+                </if>
+                <if test="c.endTime != null">
+                    and po.end_time &lt;= #{c.endTime}
+                </if>
+            </if>
+        </where>
+    </sql>
+
+    <select id="pageProductionOrder" resultMap="ProductionOrderVoResultMap">
+        select
+        <include refid="ProductionOrderVoColumns" />
+        <include refid="ProductionOrderVoFrom" />
+        <include refid="ProductionOrderWhere" />
+        order by po.id desc
+    </select>
+
+    <select id="listProductionOrder" resultMap="ProductionOrderVoResultMap">
+        select
+        <include refid="ProductionOrderVoColumns" />
+        <include refid="ProductionOrderVoFrom" />
+        <include refid="ProductionOrderWhere" />
+        order by po.id desc
+    </select>
+
+    <select id="getProductionOrderInfo" resultMap="ProductionOrderVoResultMap">
+        select
+        <include refid="ProductionOrderVoColumns" />
+        <include refid="ProductionOrderVoFrom" />
+        where po.id = #{id}
+        limit 1
+    </select>
+
     <select id="selectProgressOrders" resultType="com.ruoyi.home.dto.ProductionProgressOrderDto">
         select po.nps_no,
                sl.sales_contract_no,

--
Gitblit v1.9.3