From 814323aa300f65154c299a9f3b1c44aa6cb5e9c6 Mon Sep 17 00:00:00 2001 From: 严智鑫 <test> Date: 星期五, 22 三月 2024 10:59:59 +0800 Subject: [PATCH] Merge branch 'master' of http://10.153.19.25:10101/r/Albania_Mes --- springboot-vue3/src/main/java/com/example/springboot/mapper/HomeMapper.java | 83 +++++++++++++++++++++++++++++++++++++++-- 1 files changed, 79 insertions(+), 4 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 f85627b..f5df5a2 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,6 +3,8 @@ import org.apache.ibatis.annotations.*; import com.example.springboot.entity.CarPosition; +import com.example.springboot.entity.FlowCard; +import com.example.springboot.entity.GlassInfo; import com.example.springboot.entity.StorageCage; import com.example.springboot.entity.StorageTask; import com.example.springboot.entity.alarmmg; @@ -12,12 +14,16 @@ import com.example.springboot.entity.RolePermission; import java.util.List; +import java.util.Map; @Mapper public interface HomeMapper { //鏌ヨ姣忎釜绗煎瓙鐨勪娇鐢ㄦ儏鍐� @Select("select cage,round(100-(21-sum(if(state>0,1,state)))/21*100) as cell,21-sum(if(state>0,1,state)) as state from (select cage,cell,max(state) as state from storage_cage group by cage,cell) as cages group by cage") List<StorageCage> selectAll(); + + @Select("Select cage,sum(case when number=0 or number is null then 1 else 0 end) as cell,100-sum(case when number=0 or number is null then 1 else 0 end)/count(id)*100 as width from storage_cage group by cage") + List<StorageCage> selectAlls(); // 鏌ヨ10-6绗煎唴灞傛牸瀛愮姸鎬� @Select("SELECT cage,state,ifnull(glasswidth/2750*2,0) as glasswidth from storage_cage where cage>5 and tier=2 order by cage desc,cell desc") @@ -85,9 +91,9 @@ @Select("select dianqimima from user where id=1") String SelectPassword(); - //鏍规嵁鐜荤拑id鏌ヨ鐞嗙墖绗间俊鎭� - @Select("select * from storage_cage where glass_id=#{glassid}") - StorageCage SelectGlassInfo(String glassid); + // //鏍规嵁鐜荤拑id鏌ヨ鐞嗙墖绗间俊鎭� + // @Select("select * from storage_cage where glass_id=#{glassid}") + // StorageCage SelectGlassInfo(String glassid); //鏍规嵁鐜荤拑id鏌ヨ鐞嗙墖绗间俊鎭� @Select("select * from storage_cage where glass_id=#{glassid}") @@ -226,6 +232,75 @@ //鑾峰彇閾濇鏈夋病鏈夋鍦ㄥ嚭鐗囩殑鐜荤拑 @Select("select count(*) from out_slice where barcode=#{frameNo} and state=1") Short SelectOutingQueueCount(String frameNo); - + + //鏌ヨ鐞嗙墖绗煎唴淇℃伅 + @Select("select * from storage_cage") + List<StorageCage> SelectStorageCageInfo(); + + //鍒犻櫎鏍煎瓙鍐呯幓鐠冧俊鎭� + @Update("update storage_cage set width=5000,glasswidth=null,glassheight=null,glasswidthmm=null,glassheightmm=null,thickness=null,glasstype=null,number=null where cell=#{cell}") + void DeleteStroageCageByCell(Integer cell); + + //淇敼鏍煎瓙鐜荤拑鏁伴噺 + @Update("update storage_cage set number=ifnull(number,0)+#{num} where cell=#{cell}") + void updateStroageCageByCell(Integer cell, Integer num); + + //璁$畻鏍煎瓙鍐呭墿浣欏搴� + @Update("update storage_cage set width=5000-(glasswidth+100)*number where cell=#{cell}") + void UpdateStroageCageWidthByCell(Integer cell); + + //鏍规嵁浠诲姟绫诲瀷鑾峰彇浠诲姟 + @Select("select * from storage_task where task_type=#{task_type} and task_state=0") + List<StorageTask> SelectStorageTask(int task_type); + + //鏍规嵁id浠诲姟 + @Select("select * from storage_task where id=#{id}") + StorageTask SelectStorageTaskById(int id); + + //鏍规嵁鏍煎瓙鏌ヨ鐜荤拑淇℃伅 + @Select("select * from storage_cage where cell=#{cell}") + StorageCage SelectStorageByCell(String cell); + + //鎵嬪姩瀹屾垚浠诲姟 + @Select("update storage_task set task_state=1 where id=1429") + 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") + List<GlassInfo> SelectGlassInfo(String width,String height,String thickness,String films); + + @Update("update storage_cage set glasstype=#{glassInfo.glasstype},glasswidth=#{glassInfo.width},glassheight=#{glassInfo.height},thickness=#{glassInfo.thickness},films=#{glassInfo.films},number=0 where cell=#{cell}") + void StorageCageAddGlass(String cell, GlassInfo glassInfo); + + @Select("select * from flowcard where state!=2") + 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") + List<GlassInfo> SelectOrderView(String flowcard); + + @Update("update flowcard set state=#{state} where flowcard=#{flowcard}") + void ClaimTasks(String flowcard, int state); + + @Update("update flowcard set method=#{method} where flowcard=#{flowcard}") + void ModeChange(String flowcard, int method); + + @Update("update queue set flowcard=#{flowcard},glasswidth=#{width},glassheight=#{height},glasstype=#{glasstype},state=1 where state<=0") + void UpdateQueue(String flowcard,double width,double height,Integer glasstype); + + @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); + + //娣诲姞鍑虹墖闃熷垪 + @Insert("INSERT INTO glassinfo (`flowcard`, `glasstype`, `mateid`, `glassid`, `tier`, `films`, `width`, `height`, `thickness`, `number`, `finishnumber`, `sumtier`, `measurenumber`)"+ + " VALUES (#{flowcard}, #{glasstype}, #{mateid}, #{glassid}, #{tier}, #{films}, #{width}, #{height}, #{thickness}, #{number}, 0, #{sumtier}, 0)") + void AddGlassinfo(String flowcard, Integer glasstype, Integer mateid, String glassid, Integer tier, String films, Double width, Double height,Double thickness, Integer number, Integer sumtier); + //鏈�澶х幓鐠冪被鍨� + @Select("select max(glasstype)+1 from glassinfo") + Integer SelectMaxType(); + //鏌ヨ鍏ㄩ儴鐜荤拑绫诲瀷 + @Select("select CONCAT(IFNULL(width,''),'_',IFNULL(height,''),'_',IFNULL(thickness,''),'_',IFNULL(films,'')) as type,glasstype from glassinfo GROUP BY width,height,thickness,films") + List<Map> SelectType(); + // 鏌ヨ绗煎唴鐜荤拑淇℃伅 + @Select("select * from storage_cage where cage=#{cage} order by id desc") + List<StorageCage> SelectStorageCageByCage(Integer cage); } -- Gitblit v1.8.0