From be64830b020d7cacc429776b0fe5bfab4d893e05 Mon Sep 17 00:00:00 2001
From: ZengTao <2773468879@qq.com>
Date: 星期二, 12 十二月 2023 08:32:31 +0800
Subject: [PATCH] 调整出片队列逻辑

---
 springboot-vue3/src/main/java/com/example/springboot/mapper/SpianMapper.java |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/springboot-vue3/src/main/java/com/example/springboot/mapper/SpianMapper.java b/springboot-vue3/src/main/java/com/example/springboot/mapper/SpianMapper.java
index d64b361..42a458d 100644
--- a/springboot-vue3/src/main/java/com/example/springboot/mapper/SpianMapper.java
+++ b/springboot-vue3/src/main/java/com/example/springboot/mapper/SpianMapper.java
@@ -29,7 +29,7 @@
      @Select("select cage,cell,tier,id,ROUND(id/2)as prcId,width from storage_cage where cage=#{cage1} and cell=#{cell} and state=0 and disabled=0 and width>=#{width} ORDER BY cell asc,tier asc LIMIT 1")
      StorageCage selectCage1(int  cage1,int cell,double width);
      //鍒ゆ柇绗煎瓙鍐呯幓鐠冩暟
-     @Select("select COUNT(tier)as tier from storage_cage where  cage=#{cage} and cell=#{cell} and state=1;")
+     @Select("select COUNT(tier)as tier from storage_cage where  cage=#{cage} and cell=#{cell} and state!=0;")
      int selectsum(int cage,int cell);
      //瀹屾垚杩涚墖涓殑鐜荤拑鐘舵��
      @Update("update storage_cage set state=#{state} where glass_id=#{glassid};")
@@ -54,12 +54,15 @@
      int selectGlassState(int  cage,int cell);
 
      //鍒ゆ柇璇ヨ皟鎷ㄧ殑绗煎瓙
-     @Select("select glass_id,cage,cell,max(state)as shu,ROUND(id/2)as prcid,id from storage_cage where width>=#{width} and cage>#{cage1} and cage<#{cage2} GROUP BY cage,cell HAVING shu=0 order by abs(#{cage} - cage) limit 1;")
+     @Select("select glass_id,cage,cell,max(state)as shu,ROUND(id/2)as prcid,id from storage_cage where width>=#{width} and cage>#{cage1} and cage<#{cage2} GROUP BY cage,cell HAVING shu=0 order by abs(#{cage} - cage),cell desc  limit 1;")
      StorageCage selectGlassCage(int cage,double width,int cage1,int cage2);
 
     //鍒犻櫎绗煎瓙淇℃伅(鍑虹墖)
-    @Update("update storage_cage as a set state=#{state},glass_id=#{glassid},order_id=#{orderid},glasswidth=0 where cage=#{cage} and cell=#{cell} and tier=#{tier};")
-    void UpdataGlassCage(String orderid,String glassid,double width,int cage,int cell,int tier,int state);
+    @Update("update storage_cage as a set state=#{state},glass_id=null,order_id=null,glasswidth=0,a.glassheight=null,a.glasswidthmm=null,a.glassheightmm=null,a.listid=null,a.boxid=null where glass_id=#{glassid} and state=3;")
+    void UpdataGlassCage(String glassid,int state);
+     //鏀瑰彉鐜荤拑鐘舵�佷负鍑虹墖涓�
+    @Update("update storage_cage as a set state=#{state} where glass_id=#{glassid};")        
+    void UpdataGlassCageState(String glassid,int state);
 
     //淇敼绗煎瓙淇℃伅(杩涚墖)
     @Update("update storage_cage set state=#{state},glass_id=#{glassid},order_id=#{orderid},glasswidth=#{width} where id=#{id};")

--
Gitblit v1.8.0