From 328f9b1f7a046378ef5d8f2b8337770fff372cc7 Mon Sep 17 00:00:00 2001
From: wu <731351411@qq.com>
Date: 星期六, 26 十月 2024 19:12:07 +0800
Subject: [PATCH] 更新测试后代码

---
 springboot-vue3/src/main/java/com/example/springboot/mapper/HomeMapper.java |   41 +++++++++++++++++++++++++++++++++--------
 1 files changed, 33 insertions(+), 8 deletions(-)

diff --git a/springboot-vue3/src/main/java/com/example/springboot/mapper/HomeMapper.java b/springboot-vue3/src/main/java/com/example/springboot/mapper/HomeMapper.java
index 18573ed..f95c880 100644
--- a/springboot-vue3/src/main/java/com/example/springboot/mapper/HomeMapper.java
+++ b/springboot-vue3/src/main/java/com/example/springboot/mapper/HomeMapper.java
@@ -3,7 +3,7 @@
 import org.apache.ibatis.annotations.*;
 
 import com.example.springboot.entity.CarPosition;
-import com.example.springboot.entity.FlowCard;
+import com.example.springboot.entity.Flowcard;
 import com.example.springboot.entity.GlassInfo;
 import com.example.springboot.entity.StorageCage;
 import com.example.springboot.entity.StorageTask;
@@ -246,7 +246,7 @@
   void updateStroageCageByCell(Integer cell, Integer num);
 
   // 璁$畻鏍煎瓙鍐呭墿浣欏搴�
-  @Update("update storage_cage set width=5000-(glasswidth+100)*number where cell=#{cell}")
+  @Update("update storage_cage set width=5000-if(glasswidth is null,0,glasswidth+300)*number where cell=#{cell}")
   void UpdateStroageCageWidthByCell(Integer cell);
 
   // 鏍规嵁浠诲姟绫诲瀷鑾峰彇浠诲姟
@@ -262,7 +262,7 @@
   StorageCage SelectStorageByCell(String cell);
 
   // 鎵嬪姩瀹屾垚浠诲姟
-  @Select("update storage_task set task_state=1 where id=1429")
+  @Select("update storage_task set task_state=1 where id=#{id}")
   void FinishTask(Integer id);
 
   @Select("select gi.* from glassinfo gi inner join flowcard fc on gi.flowcard=fc.flowcard where fc.state!=2 and position(#{width} in gi.width) and position(#{height} in gi.height) and position(#{thickness} in gi.thickness) and position(#{films} in gi.films) group by gi.id")
@@ -272,10 +272,13 @@
   void StorageCageAddGlass(String cell, GlassInfo glassInfo);
 
   @Select("select * from flowcard where state!=2")
-  List<FlowCard> SelectOrderTask();
+  List<Flowcard> SelectOrderTask();
 
-  @Select("select gi.*,sum(sc.number) as cageno from glassinfo gi left join storage_cage sc on gi.glasstype=sc.glasstype where gi.flowcard=#{flowcard} group by gi.id order by gi.mateid,gi.tier")
+  // @Select("select gi.*,sum(sc.number) as cageno from glassinfo gi left join storage_cage sc on gi.glasstype=sc.glasstype where gi.flowcard=#{flowcard} group by gi.id order by gi.mateid,gi.tier")
+  // List<GlassInfo> SelectOrderView(String flowcard);
+  @Select("select gi.id, gi.glasstype, gi.mateid, gi.glassid, gi.tier, gi.films, gi.width, gi.height, gi.thickness, gi.number, gi.finishnumber, gi.sumtier, gi.measurenumber,sum(sc.number) as cageno from glassinfo gi left join storage_cage sc on gi.glasstype=sc.glasstype where gi.flowcard=#{flowcard} group by gi.id order by gi.mateid,gi.tier")
   List<GlassInfo> SelectOrderView(String flowcard);
+
 
   @Update("update flowcard set state=#{state},line=#{line} where flowcard=#{flowcard}")
   void ClaimTasks(String flowcard, int state, int line);
@@ -283,8 +286,21 @@
   @Update("update flowcard set method=#{method} where flowcard=#{flowcard}")
   void ModeChange(String flowcard, int method);
 
-  @Update("update queue set glassid=concat(#P{flowcard},'-',#{tier}),flowcard=#{flowcard},glasswidth=#{width},glassheight=#{height},glasstype=#{glasstype},thickness=#{thickness},state=1 where state<=0")
-  void UpdateQueue(String flowcard, double width, double height, Integer glasstype, Double thickness);
+  
+  @Update("update flowcard set orderstate=#{orderstate} where flowcard=#{flowcard}")
+  void StartChange(String flowcard,int orderstate);
+
+  @Select("select orderstate from flowcard  where flowcard=#{flowcard} limit 1")
+  int selectStartChange(String flowcard);
+
+  @Delete("DELETE from flowcard  where flowcard=#{flowcard}")
+  int deleteFlowcard(String flowcard);
+
+  @Delete("DELETE from glassinfo  where flowcard=#{flowcard}")
+  int deleteGlassinfo(String flowcard);
+
+  @Update("update queue set glassid=concat(#{flowcard},'-',#{tier}),flowcard=#{flowcard},glasswidth=#{width},glassheight=#{height},glasstype=#{glasstype},thickness=#{thickness},state=1 where state<=0")
+  void UpdateQueue(String flowcard, double width, double height, Integer glasstype, Double thickness, Integer tier);
 
   @Update("update glassinfo set finishnumber=ifnull(finishnumber,0)+1 where flowcard=#{flowcard} and mateid=#{mateid} and tier=#{geTier}")
   void AddGlassNo(String flowcard, Integer mateid, Integer geTier);
@@ -299,9 +315,12 @@
   // 鏈�澶х幓鐠冪被鍨�
   @Select("select max(glasstype)+1 from glassinfo")
   Integer SelectMaxType();
+    // 鏈�澶х幓鐠冪被鍨�
+    @Select("select glasstype from glassinfo where CONCAT(width,'_',height,'_',thickness,'_',films)=#{key} limit 1")
+    Integer SelectMaxTypes(String key);
 
   // 鏌ヨ鍏ㄩ儴鐜荤拑绫诲瀷
-  @Select("select CONCAT(IFNULL(width,''),'_',IFNULL(height,''),'_',IFNULL(thickness,''),'_',IFNULL(films,'')) as type,glasstype from glassinfo GROUP BY width,height,thickness,films")
+  @Select("select CONCAT(IFNULL(width,''),'_',IFNULL(height,''),'_',IFNULL(thickness,''),'_',IFNULL(films,'')) as type,glasstype from glassinfo GROUP BY width,height,thickness,films,glasstype")
   List<Map> SelectType();
 
   // 鏌ヨ鎬诲眰鏁�
@@ -316,4 +335,10 @@
   @Insert("INSERT INTO flowcard(`flowcard`, `totaltier`, `number`, `line`, `state`, `method`, `starttime`) "
                     +" select #{flowcard}, 0, #{number}, 0, 0, 0, now() where 0=( select count(*) from flowcard where flowcard=#{flowcard});")
   void InsertFlowcard(String flowcard, Integer number);
+
+    @Delete("Delete from queue where glassid=#{glassId}")
+    void DeletequeueByGlassid(String glassId);
+
+    @Select("select count(*) from flowcard where line=#{line} and state=1 and flowcard!=#{flowcard}")
+    int SelectTaskCount(String flowcard,Integer line);
 }

--
Gitblit v1.8.0