From 9eb61cbf0da06bb41c4f8f3e9a53ae48b77cdb5e Mon Sep 17 00:00:00 2001
From: 你好啊 <1536384743@qq.com>
Date: 星期五, 09 八月 2024 12:20:33 +0800
Subject: [PATCH] 测试

---
 north-glass-erp/src/main/resources/mapper/mm/MaterialInventory.xml |   82 +++++++++++++++++++++++++++++++++++++++++
 1 files changed, 82 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 dc5c9b6..b1b74f6 100644
--- a/north-glass-erp/src/main/resources/mapper/mm/MaterialInventory.xml
+++ b/north-glass-erp/src/main/resources/mapper/mm/MaterialInventory.xml
@@ -768,4 +768,86 @@
     </update>
 
 
+    <select id="getSelectSurplusMaterialsDate" >
+        select *
+        from mm.surplus_materials
+        <where>
+                and date(create_time)>=#{startDate} and date(create_time) &lt;= #{endDate} and quantity>0
+            <if test="surplusMaterials.width != null and surplusMaterials.width != ''">
+                and width regexp #{surplusMaterials.width}
+            </if>
+            <if test="surplusMaterials.height != null and surplusMaterials.height != ''">
+                and height regexp #{surplusMaterials.height}
+            </if>
+            <if test="surplusMaterials.thickness != null and surplusMaterials.thickness != ''">
+                and thickness regexp #{surplusMaterials.thickness}
+            </if>
+            <if test="surplusMaterials.quantity != null and surplusMaterials.quantity != ''">
+                and quantity regexp #{surplusMaterials.quantity}
+            </if>
+            <if test="surplusMaterials.colour != null and surplusMaterials.colour != ''">
+                and colour regexp #{surplusMaterials.colour}
+            </if>
+            <if test="surplusMaterials.remarks != null and surplusMaterials.remarks != ''">
+                and remarks regexp #{surplusMaterials.remarks}
+            </if>
+        </where>
+        limit #{offset},#{pageSize};
+    </select>
+
+    <select id="getSelectSurplusMaterialsDatePageTotal" >
+        select CEILING(count(id)/#{pageSize}) as 'pageTotal',
+        count(id) as 'total'
+        from mm.surplus_materials
+        <where>
+            and date(create_time)>=#{startDate} and date(create_time) &lt;= #{endDate} and quantity>0
+            <if test="surplusMaterials.width != null and surplusMaterials.width != ''">
+                and width regexp #{surplusMaterials.width}
+            </if>
+            <if test="surplusMaterials.height != null and surplusMaterials.height != ''">
+                and height regexp #{surplusMaterials.height}
+            </if>
+            <if test="surplusMaterials.thickness != null and surplusMaterials.thickness != ''">
+                and thickness regexp #{surplusMaterials.thickness}
+            </if>
+            <if test="surplusMaterials.quantity != null and surplusMaterials.quantity != ''">
+                and quantity regexp #{surplusMaterials.quantity}
+            </if>
+            <if test="surplusMaterials.colour != null and surplusMaterials.colour != ''">
+                and colour regexp #{surplusMaterials.colour}
+            </if>
+            <if test="surplusMaterials.remarks != null and surplusMaterials.remarks != ''">
+                and remarks regexp #{surplusMaterials.remarks}
+            </if>
+        </where>
+    </select>
+
+    <select id="selectSurplusMaterialsCount" >
+        select *
+        from mm.surplus_materials
+        where width=#{surplusMaterials.width} and height=#{surplusMaterials.height}
+          and thickness=#{surplusMaterials.thickness} and colour=#{surplusMaterials.colour} limit 0,1
+    </select>
+
+
+    <insert id="insertSurplusMaterials">
+        insert into mm.surplus_materials (width,height,thickness,quantity,colour,create_time)
+        values (#{surplusMaterials.width},#{surplusMaterials.height},#{surplusMaterials.thickness},#{surplusMaterials.quantity},#{surplusMaterials.colour},now())
+    </insert>
+
+    <insert id="insertSurplusMaterialsLog">
+        insert into mm.surplus_materials_log (width,height,thickness,quantity,colour,type,creator,create_time)
+        values (#{surplusMaterials.width},#{surplusMaterials.height},#{surplusMaterials.thickness},
+                #{surplusMaterials.quantity},#{surplusMaterials.colour},#{type},#{creator},now())
+    </insert>
+
+    <update id="updateSurplusMaterialsOutQuantity">
+        update mm.surplus_materials set quantity=quantity-#{surplusMaterials.quantity} where id=#{surplusMaterials.id}
+    </update>
+
+    <update id="updateSurplusMaterialsIntQuantity">
+        update mm.surplus_materials set quantity=quantity+#{surplusMaterials.quantity} where id=#{surplusMaterials.id}
+    </update>
+
+
 </mapper>
\ No newline at end of file

--
Gitblit v1.8.0