From 147e949e6ed8bb2c6cd68bd2fcc518405fd38d34 Mon Sep 17 00:00:00 2001 From: 严智鑫 <test> Date: 星期六, 11 五月 2024 08:42:39 +0800 Subject: [PATCH] 拉取最新代码 --- springboot-vue3/src/main/java/com/example/springboot/mapper/AlbaniaMapper.java | 84 +++++++++++++++++++++++++++--------------- 1 files changed, 54 insertions(+), 30 deletions(-) diff --git a/springboot-vue3/src/main/java/com/example/springboot/mapper/AlbaniaMapper.java b/springboot-vue3/src/main/java/com/example/springboot/mapper/AlbaniaMapper.java index e33d0bb..ac95341 100644 --- a/springboot-vue3/src/main/java/com/example/springboot/mapper/AlbaniaMapper.java +++ b/springboot-vue3/src/main/java/com/example/springboot/mapper/AlbaniaMapper.java @@ -1,44 +1,68 @@ package com.example.springboot.mapper; +import org.apache.ibatis.annotations.Delete; +import org.apache.ibatis.annotations.Insert; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Update; import org.springframework.stereotype.Repository; +import com.example.springboot.entity.GlassInfo; import com.example.springboot.entity.StorageCage; -import com.example.springboot.entity.north_glass_buffer1; @Mapper @Repository public interface AlbaniaMapper { - // 鑾峰彇鍒ゆ柇璇ユ牸瀛愭槸鍚﹂渶瑕佹妸澶栫墖鎺ㄥ叆鍐呯墖浣嶇疆 - @Select("select state from storage_cage where cage=#{cage} and cell=#{cell} and tier=1;") - int selectcell(int cage, int cell); - // 鍒ゆ柇璇ョ瀛愭槸鍚︽湁鍚堥�傚搴︾┖鏍� - @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!=0 and state!=3;") - int selectsum(int cage, int cell); - - // 瀹屾垚鍑虹墖涓殑鐜荤拑鐘舵�� - @Update("update storage_cage set state=#{state} where glass_id=#{glassid} and state=3;") - void UpdateCageOver(String glassid, int state); - // 瀹屾垚杩涚墖涓殑鐜荤拑鐘舵�� - @Update("update storage_cage set state=#{state} where glass_id=#{glassid} and state=2;") - void UpdateCageadd(String glassid, int state); - //鏌ヨ鏄惁鏈夎绫诲瀷鐨勪换鍔¤繕鏈畬鎴� - // 鍒ゆ柇鍑虹墖涓�1鏃讹紝鏄惁鍙洿鎺ュ嚭鐗� - @Select("select COUNT(state) from storage_cage where state=#{state}") - int SelectCageState(int state); - // 鑾峰彇鐜荤拑淇℃伅 - @Select("select *,ordernumber ,glasslength_mm as glasslengthmm,glassheight_mm as glassheightmm,barcode,listnumber,boxnumber,glasslength,glassheight,FrameBarcode from north_glass_buffer1 where barcode=#{glassid}") - north_glass_buffer1 selectGlass(String glassid); //鍒ゆ柇绗煎唴鏄惁鏈夊悎閫傜殑绫诲瀷绌烘牸 - @Select("select id from storage_cage where glasstype=#{glasstype} and width>=#{width}+#{widths} and state=0 order by id limit 1") - int SelectCage(int glasstype,int width,int widths); + @Select("select id from storage_cage where glasstype=#{glasstype} and width>=#{width}+#{widths} and state=0 and disabled=0 order by id limit 1") + StorageCage SelectCage(int glasstype,Double width,int widths); //鍒ゆ柇绗煎唴娌℃湁鐜荤拑鐨勭┖鏍� - @Select("select id from storage_cage where state=0 and number=0 order by id limit 1") - int SelectNewCell(); - + @Select("select id from storage_cage where number=0 and cage>#{cage} and cage<#{cage2} and disabled=0 order by id limit 1") + StorageCage SelectNewCell(int cage,int cage2); + //澧炲姞鐜荤拑鏁� + @Update("update storage_cage set number=number+1,width=width-glasswidth where id=#{id}") + void UpdateCageNumberAdd(int id); + //鍑忓皯鐜荤拑鏁� + @Update("update storage_cage set number=number-1,width=width+glasswidth where id=#{id}") + void UpdateCageNumberOut(int id); + //澧炲姞浠诲姟璁板綍 + @Insert("INSERT INTO `albania`.`storage_task`(`task_type`, `task_state`, `shelf_rack`, `load_rack`,start_time,glass_id,glasstype,flowcard,mateid,tier) VALUES (#{tasktype},#{taskstate},#{shelfrack},#{loadrack},now(),#{glassid},#{glasstype},#{flowcard},#{mateid},#{tier});") + void Inserttask(int tasktype, int taskstate, int shelfrack, int loadrack, String glassid, int glasstype,String flowcard,int mateid,int tier); + //鏂板涓�鏉$瀛愭暟鎹� + @Update("UPDATE `albania`.`storage_cage` SET `glass_id` =#{glassid}, `width` =width-#{glasswidth}, `glasswidth` =#{glasswidth}, `glassheight` =#{glassheight}, `glasswidthmm` =#{glasswidthmm}, `glassheightmm` = #{glassheightmm}, `state` = #{state}, `glasstype` = #{glasstype}, `number` = #{number} WHERE `id` =#{id};") + void AddCage(int id,String glassid,Double glasswidth,Double glassheight,Double glasswidthmm,Double glassheightmm,int state,String glasstype,int number); + //鑾峰彇杩涚墖鏁版嵁 + @Select("select glassid,flowcard,glasswidth as width,glassheight as height,glasswidthmm,glassheightmm,glasstype,thickness from queue where state=1 limit 1") + GlassInfo SelectGlass(); + //涓�鍙风嚎鏌ヨ浠诲姟 + @Select("select * from v_cagerelease1 where mateid not in(select mateid from v_cagerelease1 where surplus=0 group by mateid);") + GlassInfo SelectOutGlass1(); + //浜屽彿绾挎煡璇换鍔� + @Select("select * from v_cagerelease2 where mateid not in(select mateid from v_cagerelease2 where surplus=0 group by mateid)LIMIT 1;") + GlassInfo SelectOutGlass2(); + //娴佺▼鍗′换鍔℃煡璇� + @Select("select G.flowcard,G.glasstype,G.number,G.mateid,G.tier,G.starttime,G.finishnumber,IF((G.number-G.finishnumber-ku.KuCount)<0,G.number,ku.KuCount) as 'surplus',G.totaltier as id,G.width,G.glassid from (select Gfd.flowcard,Ggf.glasstype,Ggf.number,Ggf.mateid,Ggf.tier,Ggf.finishnumber,Gfd.starttime,Gfd.totaltier,Ggf.width,Ggf.glassid from flowcard as Gfd LEFT JOIN glassinfo as Ggf on Gfd.flowcard=Ggf.flowcard where Gfd.state=1 and Gfd.line=#{line}) as G left join (select glasstype,sum(number) AS KuCount from storage_cage where flowcard is not null group by glasstype) as ku on G.glasstype=ku.glasstype where G.mateid not in(select mateid from v_cagerelease1 where surplus=0 group by mateid)order by `g`.`starttime`,`g`.`mateid`,`g`.`finishnumber`,`g`.`tier`LIMIT 1;") + GlassInfo SelectOutGlass(int line); + //鑾峰彇璇ョ被鍨嬪湪搴撳瓨鐨勪綅缃� + @Select("select * from storage_cage where glasstype=#{glasstype} and number>0 limit 1") + StorageCage SelectCageGlass(int glasstype); + //鍙戦�佸嚭鐗囧悗澧炲姞宸插彂鏁伴噺 + @Update("update glassinfo set finishnumber=finishnumber+1 where flowcard=#{flowcard} and mateid=#{mateid} and tier=#{tier};") + void AddFinishNumber(String flowcard,int mateid,int tier); + //鑾峰彇褰撳墠浠诲姟鐨刬d + @Select("select id from storage_task where task_state=0 and glass_id=#{glassid} LIMIT 1") + GlassInfo SelectTaskId(String glassid); + //鍒犻櫎娴嬮噺琛ㄧ殑淇℃伅 + @Delete("delete from queue where glassid=#{glassid}") + int DeleteQueue(String glassid); + //鍒ゆ柇鏄惁鏄洿鍑烘ā寮� + @Select("select method from flowcard where state=1 and line=#{line} ORDER BY starttime LIMIT 1;") + GlassInfo SelectMethod(int line); + //鐩村嚭妯″紡浠诲姟鏌ヨ + @Select("select b.flowcard,b.glasstype,b.mateid,a.totaltier as id,IFNULL(c.number,0)as number,b.glassid from flowcard a left join glassinfo b on a.flowcard=b.flowcard left join(select sum(number)as number,glasstype from storage_cage GROUP BY glasstype)c on b.glasstype=c.glasstype where a.line=#{line} and c.number>0") + GlassInfo SelectOutGlass2(int line); + @Select("update storage_cage a set a.glasswidth=#{width},a.glassheight=#{height} where id=#{id} ") + void UpdateStorage(double width,double height,int id); + @Update("update queue set state=2 where glassid=#{glassid};") + void UpdateQueueState(String glassid); + } -- Gitblit v1.8.0