wuyouming666
2023-12-20 cb8959244281f922d3a972472853d0bb1df1e5b8
springboot-vue3/src/main/java/com/example/springboot/mapper/SpianMapper.java
@@ -15,7 +15,7 @@
public interface SpianMapper {
    // 判断相邻笼子是否有空格
    @Select("select COUNT(if(a.state1=0,cell,null))as cell,ROUND(id/2)as id from (select *,max(state)as state1 from storage_cage a  GROUP BY cage,cell)as a where (a.cage=#{cage1}-1 or a.cage=#{cage1}+1)and if(a.cage<6,a.cage>0 and a.cage<6,a.cage>5) and disabled=0 GROUP BY cage ORDER BY cell desc LIMIT 1")
    @Select("select COUNT(if(a.state1=0,cell,0))as cell,ROUND(id/2)as id from (select *,max(state)as state1 from storage_cage a  GROUP BY cage,cell)as a where (a.cage=#{cage1}-1 or a.cage=#{cage1}+1)and if(a.cage<6,a.cage>0 and a.cage<6,a.cage>5) and disabled=0 GROUP BY cage ORDER BY cell desc LIMIT 1")
    int selectCage(int cage1);
    // @Select("(select*from storage_cage as a where a.state=0 and cage%2=0 ORDER BY
@@ -42,7 +42,7 @@
    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;")
    @Select("select COUNT(tier)as tier from storage_cage where  cage=#{cage} and cell=#{cell} and state=1;")
    int selectsum(int cage, int cell);
    // 完成进片中的玻璃状态
@@ -77,7 +77,7 @@
    StorageCage selectGlassCage(int cage, double width, int cage1, int cage2);
    // 删除笼子信息(出片)
    @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;")
    @Update("update storage_cage as a set state=#{state},glass_id=null,order_id=null,glasswidth=null,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);
    // 改变玻璃状态为出片中
@@ -109,7 +109,7 @@
    void UpdataOutCage1(double width, int cage, int cell);
    // 调拨更换笼子信息
    @Update("update storage_cage as a,(select*from storage_cage b where b.cage=#{cage} and b.cell=#{cell} and b.tier=#{tier})as b set a.glass_id=b.glass_id,a.order_id=b.order_id,a.state=1,a.glasswidth=b.glasswidth,a.glassheight=b.glassheight,a.glasswidthmm=b.glasswidthmm,a.glassheightmm=b.glassheightmm,a.listid=b.listid,a.boxid=b.boxid where a.id=#{id1}")
    @Update("update storage_cage as a,(select*from storage_cage b where b.cage=#{cage} and b.cell=#{cell} and b.tier=#{tier})as b set a.glass_id=b.glass_id,a.order_id=b.order_id,a.state=2,a.glasswidth=b.glasswidth,a.glassheight=b.glassheight,a.glasswidthmm=b.glasswidthmm,a.glassheightmm=b.glassheightmm,a.listid=b.listid,a.boxid=b.boxid where a.id=#{id1}")
    void UpdateDBCage(int id1, int cage, int cell, int tier);
    // @Insert("insert into user(name, date, address, user_no) values (#{name},
@@ -231,4 +231,7 @@
    // 把该进片的玻璃更新到出片队列
    @Select("update out_slice set state=0 where glassId=#{glassId} and state=3")
    void UpdateAddQueue(String glassId);
}
    //新增日志表格
    @Insert("INSERT INTO `canadames`.`log`( `text`,time) VALUES (#{logtxt},now());")
    void insertlog(String logtxt);
}