From 430ab98c6225a276bab44c5eebb304fc6206cb73 Mon Sep 17 00:00:00 2001
From: chenlu <1320612696@qq.com>
Date: 星期三, 25 九月 2024 16:03:48 +0800
Subject: [PATCH] Merge branch 'master' of http://10.153.19.25:10101/r/ERP_override

---
 north-glass-erp/src/main/resources/mapper/mm/MaterialInventory.xml |   64 ++++++++++++++++++++++++++++++++
 1 files changed, 64 insertions(+), 0 deletions(-)

diff --git a/north-glass-erp/src/main/resources/mapper/mm/MaterialInventory.xml b/north-glass-erp/src/main/resources/mapper/mm/MaterialInventory.xml
index b1b74f6..2e46ada 100644
--- a/north-glass-erp/src/main/resources/mapper/mm/MaterialInventory.xml
+++ b/north-glass-erp/src/main/resources/mapper/mm/MaterialInventory.xml
@@ -61,6 +61,7 @@
                 date(mi.create_time)>=#{startDate} and date(mi.create_time) &lt;= #{endDate} and mi.available_quantity>0
 
         </where>
+        order by mi.id desc
         limit #{offset},#{pageSize};
     </select>
 
@@ -105,6 +106,7 @@
             date(ou.create_time)>=#{startDate} and date(ou.create_time) &lt;= #{endDate}
 
         </where>
+        order by ou.id desc
         limit #{offset},#{pageSize};
     </select>
 
@@ -609,6 +611,17 @@
                )
     </insert>
 
+    <insert id="updateMaterialOutbound"  >
+        update mm.material_outbound
+        set material_requisition_personnel=#{materialOutbound.materialRequisitionPersonnel},
+            material_requisition_team=#{materialOutbound.materialRequisitionTeam},
+            order_id=#{materialOutbound.orderId},
+            outbound_type=#{materialOutbound.outboundType},
+            warehouse_manager=#{materialOutbound.warehouseManager},
+            material_requisition_date=#{materialOutbound.materialRequisitionDate}
+        where material_outbound_id = #{number}
+    </insert>
+
     <insert id="insertMaterialOutboundDetail"  useGeneratedKeys="true" >
         insert into mm.material_outbound_detail (material_outbound_id,material_outbound_number,material_code,material_name,use_id,inventory_id,inventory_organization,producer,unit,width,
                                                  height,thickness,outbound_quantity,single_piece_area,inventory_area,date_of_manufacture,remarks)
@@ -849,5 +862,56 @@
         update mm.surplus_materials set quantity=quantity+#{surplusMaterials.quantity} where id=#{surplusMaterials.id}
     </update>
 
+    <select id="getPrintCreateOutbound" >
+        select id,
+               material_outbound_id,
+               material_requisition_personnel,
+               material_requisition_team,
+               order_id,
+               outbound_type,
+               warehouse_manager,
+               date(material_requisition_date) as material_requisition_date,
+               reviewed,
+               date(reviewed_time) as reviewed_time,
+               reviewed_state,
+               date(create_time) as create_time
+        from mm.material_outbound
+        where material_outbound_id = #{materialOutboundId}
+    </select>
+
+    <select id="getPrintCreateOutboundDetail" >
+        select
+            ou.project_no as  projectNo,
+            modd.inventory_id as id,
+            modd.inventory_organization as inventoryOrganization,
+            modd.material_code as materialCode,
+            modd.material_name as materialName,
+            modd.producer,
+            modd.width,
+            modd.height,
+            modd.thickness,
+            modd.unit,
+            modd.outbound_quantity as outboundQuantity,
+            date(modd.date_of_manufacture) as dateOfManufacture,
+            modd.single_piece_area as singlePieceArea,
+            modd.inventory_area as inventoryArea,
+            modd.remarks,
+            ou.use_count as inventoryQuantity,
+            if(mo.reviewed_state!=1,modd.outbound_quantity+ou.not_use_count,ou.not_use_count) as availableQuantity,
+            ms.json,
+            modd.producer
+        from mm.material_outbound_detail modd left join pp.optimize_use ou on modd.use_id=ou.id
+                                              left join mm.material_outbound mo on modd.material_outbound_id=mo.material_outbound_id
+                                              left join mm.material_store ms on modd.material_code=ms.id
+        where modd.material_outbound_id = #{materialOutboundId}
+    </select>
+
+    <select id="getMaterialInventoryById" >
+        select
+            *
+        from mm.material_inventory mi
+        where mi.id = #{id}
+    </select>
+
 
 </mapper>
\ No newline at end of file

--
Gitblit v1.8.0